https://github.com/chetanppatil/build-jira
Wrapper for JIRA APIs
https://github.com/chetanppatil/build-jira
jira jira-rest-api jira-service-desk nodejs servicedesk
Last synced: 6 months ago
JSON representation
Wrapper for JIRA APIs
- Host: GitHub
- URL: https://github.com/chetanppatil/build-jira
- Owner: chetanppatil
- License: mit
- Created: 2018-02-25T15:13:54.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-02-28T22:41:49.000Z (almost 3 years ago)
- Last Synced: 2025-06-10T00:28:44.147Z (6 months ago)
- Topics: jira, jira-rest-api, jira-service-desk, nodejs, servicedesk
- Language: JavaScript
- Size: 332 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NPM Package For JIRA (Service Desk) REST API
[](http://hits.dwyl.io/chetan07j/build-jira)
[](https://standardjs.com)
[](https://github.com/Chetan07j/build-jira/blob/master/LICENSE)
[](https://github.com/Chetan07j/build-jira/graphs/contributors/)
[](https://github.com/Chetan07j/build-jira/issues/)
[](https://github.com/Chetan07j/build-jira/issues?q=is%3Aissue+is%3Aclosed)
[](https://nodei.co/npm/build-jira/)
A node.js module, which provides an object oriented wrapper for the JIRA REST API.
This library is built to support version `3.9.1` of the JIRA Service Desk API.
JIRA Service Desk API documentation can be found [here](https://docs.atlassian.com/jira-servicedesk/REST/3.9.1/)
[Service Desk Public REST API](https://developer.atlassian.com/cloud/jira/service-desk/rest/)
## Installation
Install with the node package manager [npm](http://npmjs.org):
```shell
$ npm install build-jira
```
## How To Use?
### Create the JIRA client
```javascript
const JiraApi = require('build-jira').jira;
const jira = new JiraApi({
host: ,
username: ,
password:
});
```
### Get Service Desk Information
```javascript
/* For servicedeskInfo input is not required, hence first parameter is null in this call. */
jira.serviceDeskInfo(null, (error, body) => {
console.log('RESPONSE: ', error, body);
});
```
### Get All Service Desks
```javascript
/* If start and limit is not passed, then default values 0 and 10 will get applied respectively */
jira.getAllServiceDesks({ start: 0, limit: 10 }, (error, body) => {
console.log('RESPONSE: ', error, body);
});
```
### Get Service Desk By Id
```javascript
jira.getServiceDeskById(, (error, body) => {
console.log('RESPONSE: ', error, body);
});
```
### Create New Ticket In Service Desk
```javascript
let input = {
serviceDeskId: ,
requestTypeId: ,
summary: ,
description:
};
jira.createServiceDeskTicket(input, (error, body) => {
console.log('RESPONSE:', error, body);
});
```
### Get Customer Requests(Tickets)
```javascript
/* If start and limit is not passed, then default values 0 and 10 will get applied respectively */
/*
NOTE: HERE input IS NOT MANDATORY
IF YOU PASS IT THEN IT WILL RETURN DATA ACCORDINGLY
ELSE IT WILL RETURN DEFAULT DATA
*/
let input = {
start: ,
limit: ,
requestOwnership: ,
requestStatus: ,
searchString: ,
serviceDeskId:
};
jira.getAllRequestsOfCustomer(input, (error, body) => {
console.log('RESPONSE:', error, body);
});
```
### Get Customer Request By Id
```javascript
jira.getCustomerRequestById(, (error, body) => {
console.log('RESPONSE: ', error, body);
});
```
### Create Attachment For Issue/Ticket/Request In Service Desk
```javascript
let input = {
serviceDeskId: ,
issueId: ,
file: [],
comment:
};
jira.createCustomerAttachment(input, (error, body) => {
console.log('RESPONSE:', error, body);
});
```
### Add Comment On Customer Issue/Ticket/Request In Service Desk
```javascript
let input = {
issueId: ,
comment:
};
jira.addCommentOnCustomerRequest(input, (error, body) => {
console.log('RESPONSE:', error, body);
});
```
### Get All Comments On Customer Issue/Ticket/Request In Service Desk
```javascript
/* If start and limit is not passed, then default values 0 and 10 will get applied respectively */
let input = {
start: ,
limit: ,
issueId:
};
jira.getCommentsOnCustomerRequest(input, (error, body) => {
console.log('RESPONSE:', error, body);
});
```
### Get Customer Issue/Ticket/Request Status
```javascript
/* If start and limit is not passed, then default values 0 and 10 will get applied respectively */
let input = {
start: ,
limit: ,
issueId:
};
jira.getCustomerRequestStatus(input, (error, body) => {
console.log('RESPONSE:', error, body);
});
```
## Options
jiraApi options:
- `host`: The hostname for your jira server
- `user`: The username to log in with
- `password`: Keep it secret, keep it safe
## Implemented APIs
- Service Desk
- Infomation
- Get All Service Desks
- Get Service Desk By Id
- Create New Ticket In Service Desk
- Get All Requests Of Customer
- Get Customer Request By Id
- Create Attachment To Customer Request
- Add Comment on Customer Request
- Get All Comments On Customer Request
- Get Customer Request Status (Current And History)
## Changelog
- _1.0.8 addCommentOnCustomerRequest, getCommentsOnCustomerRequest, getCustomerRequestStatus functions added, and other changes_
- _1.0.6 createCustomerAttachment function added_
- _1.0.5 getAllRequestsOfCustomer, getCustomerRequestById functions added and Javascript Standard Style Guid applied_
- _1.0.4 README updated_
- _1.0.3 createServiceDeskTicket function added_
- _1.0.2 serviceDeskInfo parameter corrected_
- _1.0.1 READEME file added_
- _1.0.0 Initial version_