Modules@robinpath/jira
jira

@robinpath/jira

0.1.1Node.jsPublic

Jira module for RobinPath.

Jira

Jira module for RobinPath.

Package: @robinpath/jira | Category: Project Management | Type: Integration

Authentication

jira.setCredentials "mycompany.atlassian.net" "user@example.com" "your-api-token"

Call this once at the start of your script before using any other function. Credentials persist for the duration of the script execution.

Use Cases

Use the jira module when you need to:

  • Create a new Jira issue. -- Use jira.createIssue to perform this operation
  • Get a Jira issue by key. -- Use jira.getIssue to perform this operation
  • Update fields on a Jira issue. -- Use jira.updateIssue to perform this operation
  • Delete a Jira issue. -- Use jira.deleteIssue to perform this operation
  • Assign a Jira issue to a user. -- Use jira.assignIssue to perform this operation

Quick Reference

FunctionDescriptionReturns
setCredentialsSet Jira Cloud credentials for API access.Confirmation message.
createIssueCreate a new Jira issue.Created issue response with key and id.
getIssueGet a Jira issue by key.Issue details.
updateIssueUpdate fields on a Jira issue.Update response.
deleteIssueDelete a Jira issue.Deletion confirmation.
assignIssueAssign a Jira issue to a user.Assignment response.
transitionIssueTransition a Jira issue to a new status.Transition response.
addCommentAdd a comment to a Jira issue.Created comment.
getCommentsList comments on a Jira issue.Comments list.
searchIssuesSearch Jira issues using JQL.Search results with issues array.
listProjectsList all accessible Jira projects.Array of project objects.
getProjectGet details of a Jira project.Project details.
listBoardsList Jira agile boards.Board list with pagination.
getBoardSprintsGet sprints for a Jira board.Sprint list with pagination.
getSprintIssuesGet issues in a sprint.Issues in the sprint.
addLabelAdd a label to a Jira issue.Update response.
removeLabelRemove a label from a Jira issue.Update response.
getTransitionsGet available status transitions for a Jira issue.Available transitions.
addAttachmentAdd a file attachment to a Jira issue.Attachment details.
listUsersSearch for Jira users.Array of user objects.
getUserGet a Jira user by account ID.User details.
addWatcherAdd a watcher to a Jira issue.Confirmation message.
removeWatcherRemove a watcher from a Jira issue.Removal confirmation.
listPrioritiesList all available Jira priorities.Array of priority objects.
listIssueTypesList available issue types, optionally filtered by project.Array of issue type objects.

Functions

setCredentials

Set Jira Cloud credentials for API access.

Module: jira | Returns: string -- Confirmation message.

jira.setCredentials "mycompany.atlassian.net" "user@example.com" "your-api-token"
ParameterTypeRequiredDescription
domainstringYesJira cloud domain (e.g. mycompany.atlassian.net)
emailstringYesAtlassian account email
apiTokenstringYesAtlassian API token

createIssue

Create a new Jira issue.

Module: jira | Returns: object -- Created issue response with key and id.

jira.createIssue "PROJ" "Task" "Fix login bug" {"description":"Login page returns 500","priority":"High"}
ParameterTypeRequiredDescription
projectKeystringYesProject key (e.g. PROJ)
issueTypestringYesIssue type name (e.g. Task, Bug, Story)
summarystringYesIssue summary/title
optionsobjectNoOptional fields: description, priority, labels, assignee, components

getIssue

Get a Jira issue by key.

Module: jira | Returns: object -- Issue details.

jira.getIssue "PROJ-123"
ParameterTypeRequiredDescription
issueKeystringYesIssue key (e.g. PROJ-123)

updateIssue

Update fields on a Jira issue.

Module: jira | Returns: object -- Update response.

jira.updateIssue "PROJ-123" {"summary":"Updated summary","priority":{"name":"High"}}
ParameterTypeRequiredDescription
issueKeystringYesIssue key (e.g. PROJ-123)
fieldsobjectYesFields to update

deleteIssue

Delete a Jira issue.

Module: jira | Returns: string -- Deletion confirmation.

jira.deleteIssue "PROJ-123"
ParameterTypeRequiredDescription
issueKeystringYesIssue key (e.g. PROJ-123)

assignIssue

Assign a Jira issue to a user.

Module: jira | Returns: object -- Assignment response.

jira.assignIssue "PROJ-123" "5b10ac8d82e05b22cc7d4ef5"
ParameterTypeRequiredDescription
issueKeystringYesIssue key (e.g. PROJ-123)
accountIdstringYesAtlassian account ID of the assignee

transitionIssue

Transition a Jira issue to a new status.

Module: jira | Returns: object -- Transition response.

jira.transitionIssue "PROJ-123" "31"
ParameterTypeRequiredDescription
issueKeystringYesIssue key (e.g. PROJ-123)
transitionIdstringYesTransition ID (use getTransitions to find available IDs)
optionsobjectNoOptional: fields, update

addComment

Add a comment to a Jira issue.

Module: jira | Returns: object -- Created comment.

jira.addComment "PROJ-123" "This issue needs further investigation."
ParameterTypeRequiredDescription
issueKeystringYesIssue key (e.g. PROJ-123)
bodystringYesComment text

getComments

List comments on a Jira issue.

Module: jira | Returns: object -- Comments list.

jira.getComments "PROJ-123"
ParameterTypeRequiredDescription
issueKeystringYesIssue key (e.g. PROJ-123)

searchIssues

Search Jira issues using JQL.

Module: jira | Returns: object -- Search results with issues array.

jira.searchIssues "project = PROJ AND status = Open" {"maxResults":10}
ParameterTypeRequiredDescription
jqlstringYesJQL query string
optionsobjectNoOptions: maxResults, startAt, fields

listProjects

List all accessible Jira projects.

Module: jira | Returns: array -- Array of project objects.

jira.listProjects
ParameterTypeRequiredDescription
(none)NoCall with no arguments

getProject

Get details of a Jira project.

Module: jira | Returns: object -- Project details.

jira.getProject "PROJ"
ParameterTypeRequiredDescription
projectKeystringYesProject key (e.g. PROJ)

listBoards

List Jira agile boards.

Module: jira | Returns: object -- Board list with pagination.

jira.listBoards {"projectKeyOrId":"PROJ"}
ParameterTypeRequiredDescription
optionsobjectNoOptions: projectKeyOrId, type, startAt, maxResults

getBoardSprints

Get sprints for a Jira board.

Module: jira | Returns: object -- Sprint list with pagination.

jira.getBoardSprints 42 {"state":"active"}
ParameterTypeRequiredDescription
boardIdnumberYesBoard ID
optionsobjectNoOptions: state (future, active, closed), startAt, maxResults

getSprintIssues

Get issues in a sprint.

Module: jira | Returns: object -- Issues in the sprint.

jira.getSprintIssues 100 {"maxResults":25}
ParameterTypeRequiredDescription
sprintIdnumberYesSprint ID
optionsobjectNoOptions: startAt, maxResults, fields

addLabel

Add a label to a Jira issue.

Module: jira | Returns: object -- Update response.

jira.addLabel "PROJ-123" "urgent"
ParameterTypeRequiredDescription
issueKeystringYesIssue key (e.g. PROJ-123)
labelstringYesLabel to add

removeLabel

Remove a label from a Jira issue.

Module: jira | Returns: object -- Update response.

jira.removeLabel "PROJ-123" "urgent"
ParameterTypeRequiredDescription
issueKeystringYesIssue key (e.g. PROJ-123)
labelstringYesLabel to remove

getTransitions

Get available status transitions for a Jira issue.

Module: jira | Returns: object -- Available transitions.

jira.getTransitions "PROJ-123"
ParameterTypeRequiredDescription
issueKeystringYesIssue key (e.g. PROJ-123)

addAttachment

Add a file attachment to a Jira issue.

Module: jira | Returns: object -- Attachment details.

jira.addAttachment "PROJ-123" "/path/to/report.pdf"
ParameterTypeRequiredDescription
issueKeystringYesIssue key (e.g. PROJ-123)
filePathstringYesLocal file path to attach

listUsers

Search for Jira users.

Module: jira | Returns: array -- Array of user objects.

jira.listUsers "john"
ParameterTypeRequiredDescription
querystringNoSearch query (name or email)

getUser

Get a Jira user by account ID.

Module: jira | Returns: object -- User details.

jira.getUser "5b10ac8d82e05b22cc7d4ef5"
ParameterTypeRequiredDescription
accountIdstringYesAtlassian account ID

addWatcher

Add a watcher to a Jira issue.

Module: jira | Returns: string -- Confirmation message.

jira.addWatcher "PROJ-123" "5b10ac8d82e05b22cc7d4ef5"
ParameterTypeRequiredDescription
issueKeystringYesIssue key (e.g. PROJ-123)
accountIdstringYesAtlassian account ID of the watcher

removeWatcher

Remove a watcher from a Jira issue.

Module: jira | Returns: string -- Removal confirmation.

jira.removeWatcher "PROJ-123" "5b10ac8d82e05b22cc7d4ef5"
ParameterTypeRequiredDescription
issueKeystringYesIssue key (e.g. PROJ-123)
accountIdstringYesAtlassian account ID of the watcher

listPriorities

List all available Jira priorities.

Module: jira | Returns: array -- Array of priority objects.

jira.listPriorities
ParameterTypeRequiredDescription
(none)NoCall with no arguments

listIssueTypes

List available issue types, optionally filtered by project.

Module: jira | Returns: array -- Array of issue type objects.

jira.listIssueTypes "PROJ"
ParameterTypeRequiredDescription
projectKeystringNoOptional project key to filter issue types

Error Handling

All functions throw on failure. Common errors:

ErrorCause
Jira API error (${res.status}): ${text}Check the error message for details
Jira Agile API error (${res.status}): ${text}Check the error message for details
jira.setCredentials requires domain, email, and apiToken.Check the error message for details
jira.createIssue requires projectKey, issueType, and summary.Check the error message for details
jira.getIssue requires an issueKey.Check the error message for details
jira.updateIssue requires issueKey and fields.Check the error message for details
jira.deleteIssue requires an issueKey.Check the error message for details
jira.assignIssue requires issueKey and accountId.Check the error message for details
@desc "Create issue and validate result"
do
  set $result as jira.createIssue "PROJ" "Task" "Fix login bug" {"description":"Login page returns 500","priority":"High"}
  if $result != null
    print "Success"
  else
    print "No result"
  end
enddo

Recipes

1. List and iterate Issue

Retrieve all items and loop through them.

@desc "Setup authentication"
do
  jira.setCredentials $token
enddo

@desc "Get issue and iterate results"
do
  set $result as jira.getIssue "PROJ-123"
  each $item in $result
    print $item
  end
enddo

2. Create a new item with createIssue

Create a new resource and capture the result.

@desc "Setup authentication"
do
  jira.setCredentials $token
enddo

@desc "Create issue"
do
  set $result as jira.createIssue "PROJ" "Task" "Fix login bug" {"description":"Login page returns 500","priority":"High"}
  print "Created: " + $result
enddo

3. Create and update workflow

Create an item and then update it.

@desc "Setup authentication"
do
  jira.setCredentials $token
enddo

@desc "Create issue and update issue"
do
  set $created as jira.createIssue "PROJ" "Task" "Fix login bug" {"description":"Login page returns 500","priority":"High"}
  # Update the created item
  jira.updateIssue "PROJ-123" {"summary":"Updated summary","priority":{"name":"High"}}
enddo

4. Check before creating

List existing items and only create if needed.

@desc "Setup authentication"
do
  jira.setCredentials $token
enddo

@desc "Get issue and create issue"
do
  set $existing as jira.getIssue "PROJ-123"
  if $existing == null
    jira.createIssue "PROJ" "Task" "Fix login bug" {"description":"Login page returns 500","priority":"High"}
    print "Item created"
  else
    print "Item already exists"
  end
enddo

5. Multi-step Jira workflow

Chain multiple jira operations together.

@desc "Setup authentication"
do
  jira.setCredentials $token
enddo

@desc "Create issue, get issue, and more"
do
  set $r_createIssue as jira.createIssue "PROJ" "Task" "Fix login bug" {"description":"Login page returns 500","priority":"High"}
  set $r_getIssue as jira.getIssue "PROJ-123"
  set $r_updateIssue as jira.updateIssue "PROJ-123" {"summary":"Updated summary","priority":{"name":"High"}}
  print "All operations complete"
enddo

6. Safe createIssue with validation

Check results before proceeding.

@desc "Setup authentication"
do
  jira.setCredentials $token
enddo

@desc "Create issue and validate result"
do
  set $result as jira.createIssue "PROJ" "Task" "Fix login bug" {"description":"Login page returns 500","priority":"High"}
  if $result != null
    print "Success: " + $result
  else
    print "Operation returned no data"
  end
enddo

Related Modules

  • asana -- Asana module for complementary functionality
  • clickup -- ClickUp module for complementary functionality
  • linear -- Linear module for complementary functionality
  • monday -- Monday.com module for complementary functionality
  • todoist -- Todoist module for complementary functionality

Versions (1)

VersionTagPublished
0.1.1latest1 months ago
Install
$ robinpath add @robinpath/jira

Collaborators

Dumitru Balaban
Dumitru Balaban
@dumitru
View all @robinpath modules
Version0.1.1
LicenseMIT
Unpacked Size8.7 KB
Versions1
Weekly Downloads26
Total Downloads26
Stars0
Last Publish1 months ago
Created1 months ago

Category

productivity