- Notifications
You must be signed in to change notification settings - Fork61
A JavaScript/TypeScript wrapper for the JIRA Cloud, Service Desk and Agile REST API
License
MrRefactoring/jira.js
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Jira.js is a powerfulNode.js and browser-compatible module that provides seamless interaction with:
Designed for usability, consistency, and performance, it covers nearly 100% of Jira APIs and stays updated with new features.
Requires Node.js 20.0.0 or newer.
# Using npmnpm install jira.js# Using yarnyarn add jira.js# Using pnpmpnpm add jira.js
Create your first Jira issue in under 5 minutes:
import{Version3Client}from'jira.js';constclient=newVersion3Client({host:'https://your-domain.atlassian.net',authentication:{basic:{email:'your@email.com',apiToken:'YOUR_API_TOKEN',// Create one: https://id.atlassian.com/manage-profile/security/api-tokens},},});asyncfunctioncreateIssue(){constproject=awaitclient.projects.getProject({projectIdOrKey:'Your project id or key'});constnewIssue=awaitclient.issues.createIssue({fields:{summary:'Hello Jira.js!',issuetype:{name:'Task'},project:{key:project.key},},});console.log(`Issue created:${newIssue.id}`);}createIssue();
Full API reference and guides available at:https://mrrefactoring.github.io/jira.js/
- Create an API token:https://id.atlassian.com/manage-profile/security/api-tokens
- Configure the client:
constclient=newVersion3Client({host:'https://your-domain.atlassian.net',authentication:{basic:{email:'YOUR@EMAIL.ORG',apiToken:'YOUR_API_TOKEN'},},});
Only authorization code grants are supported. Implement your own token acquisition flow using Atlassian'sOAuth 2.0 documentation.
constclient=newVersion3Client({host:'https://your-domain.atlassian.net',authentication:{oauth2:{accessToken:'YOUR_ACCESS_TOKEN'},},});
Errors are categorized as:
HttpException: Server responded with an error (includes parsed error details)Error: Network/configuration issues (e.g., timeouts)
Example handling:
try{awaitclient.issues.getIssue({issueIdOrKey:'INVALID-123'});}catch(error){if(errorinstanceofHttpException){console.error('Server error:',error.message);console.debug('Response headers:',error.cause.response?.headers);}elseif(errorinstanceofError){console.error('Network error:',error.code);}else{console.error('Unexpected error:',error);}}
Access endpoints using theclient.<group>.<method> pattern:
// Get all projectsconstprojects=awaitclient.projects.searchProjects();// Create a sprintconstsprint=awaitclient.sprint.createSprint({name:'Q4 Sprint'});
Available API groups:
🔽 Agile Cloud API
🔽 Core REST API (v2/v3)
- announcementBanner
- appDataPolicy
- applicationRoles
- appMigration
- auditRecords
- avatars
- classificationLevels
- dashboards
- filters
- filterSharing
- groupAndUserPicker
- groups
- instanceInformation
- issues
- issueAttachments
- issueBulkOperations
- issueComments
- issueCustomFieldAssociations
- issueCustomFieldConfigurationApps
- issueCommentProperties
- issueFields
- issueFieldConfigurations
- issueCustomFieldContexts
- issueCustomFieldOptions
- issueCustomFieldOptionsApps
- issueCustomFieldValuesApps
- issueLinks
- issueLinkTypes
- issueNavigatorSettings
- issueNotificationSchemes
- issuePriorities
- issueProperties
- issueRemoteLinks
- issueResolutions
- issueSearch
- issueSecurityLevel
- issueSecuritySchemes
- issueTypes
- issueTypeSchemes
- issueTypeScreenSchemes
- issueTypeProperties
- issueVotes
- issueWatchers
- issueWorklogs
- issueWorklogProperties
- jiraExpressions
- jiraSettings
- jql
- jqlFunctionsApps
- labels
- licenseMetrics
- myself
- permissions
- permissionSchemes
- plans
- prioritySchemes
- projects
- projectTemplates
- projectAvatars
- projectCategories
- projectClassificationLevels
- projectComponents
- projectEmail
- projectFeatures
- projectKeyAndNameValidation
- projectPermissionSchemes
- projectProperties
- projectRoles
- projectRoleActors
- projectTypes
- projectVersions
- screens
- screenTabs
- screenTabFields
- screenSchemes
- serverInfo
- serviceRegistry
- status
- tasks
- teamsInPlan
- timeTracking
- uiModificationsApps
- users
- userNavProperties
- userProperties
- userSearch
- webhooks
- workflows
- workflowTransitionRules
- workflowSchemes
- workflowSchemeProjectAssociations
- workflowSchemeDrafts
- workflowStatuses
- workflowStatusCategories
- workflowTransitionProperties
- appProperties
- dynamicModules
See full group list inoriginal documentation.
Optimize bundle size by importing only needed modules:
// custom-client.tsimport{BaseClient}from'jira.js';import{Issues}from'jira.js/version3';import{Board}from'jira.js/agile';exportclassCustomClientextendsBaseClient{issues=newIssues(this);board=newBoard(this);}// Usageconstclient=newCustomClient({/* config */});awaitclient.issues.getIssue({issueIdOrKey:'KEY-1'});
Explore our other Atlassian integration libraries:
- Confluence.js - Interact with Confluence API
- Trello.js - Trello API integration
MIT License © MrRefactoringSeeLICENSE for details.
About
A JavaScript/TypeScript wrapper for the JIRA Cloud, Service Desk and Agile REST API
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.