npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

build-jira

v1.0.8

Published

Integrate JIRA APIs with your node application easily

Downloads

106

Readme

NPM Package For JIRA (Service Desk) REST API

HitCount Generic badge GitHub license GitHub contributors GitHub issues GitHub issues-closed

NPM

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

Service Desk Public REST API

Installation

Install with the node package manager npm:

$ npm install build-jira

How To Use?

Create the JIRA client

const JiraApi = require('build-jira').jira;

const jira = new JiraApi({
  host: <your-jira-host>,
  username: <jira-user>,
  password: <jira-user-password>
});

Get Service Desk Information

/* 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

/* 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

jira.getServiceDeskById(<service-desk-id>, (error, body) => {
  console.log('RESPONSE: ', error, body);
});

Create New Ticket In Service Desk

let input = {
  serviceDeskId: <service-desk-id>,
  requestTypeId: <request-queue-id>,
  summary: <your-ticket-title>,
  description: <explanation-about-ticket>
};

jira.createServiceDeskTicket(input, (error, body) => {
  console.log('RESPONSE:', error, body);
});

Get Customer Requests(Tickets)

/* 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: <start-index>,
  limit: <number-of-records-to-return>,
  requestOwnership: <ticket-ownership-type>,
  requestStatus: <request-ticket-status>,
  searchString: <string-to-get-matching-records>,
  serviceDeskId: <servicedeskid-to-get-records>
};

jira.getAllRequestsOfCustomer(input, (error, body) => {
  console.log('RESPONSE:', error, body);
});

Get Customer Request By Id

jira.getCustomerRequestById(<issue-id-key>, (error, body) => {
  console.log('RESPONSE: ', error, body);
});

Create Attachment For Issue/Ticket/Request In Service Desk


let input = {
  serviceDeskId: <service-desk-id>,
  issueId: <issue-id-to-add-attachment>,
  file: [<array-of-file-paths-to-attach>],
  comment: <comment-to-add-for-attachment-if-any>
};

jira.createCustomerAttachment(input, (error, body) => {
  console.log('RESPONSE:', error, body);
});

Add Comment On Customer Issue/Ticket/Request In Service Desk


let input = {
  issueId: <issue-id-to-add-attachment>,
  comment: <comment-to-add>
};

jira.addCommentOnCustomerRequest(input, (error, body) => {
  console.log('RESPONSE:', error, body);
});

Get All Comments On Customer Issue/Ticket/Request In Service Desk

/* If start and limit is not passed, then default values 0 and 10 will get applied respectively */

let input = {
  start: <start-index>,
  limit: <number-of-records-to-return>,
  issueId: <issue-id-to-add-attachment>
};

jira.getCommentsOnCustomerRequest(input, (error, body) => {
  console.log('RESPONSE:', error, body);
});

Get Customer Issue/Ticket/Request Status

/* If start and limit is not passed, then default values 0 and 10 will get applied respectively */

let input = {
  start: <start-index>,
  limit: <number-of-records-to-return>,
  issueId: <issue-id-to-add-attachment>
};

jira.getCustomerRequestStatus(input, (error, body) => {
  console.log('RESPONSE:', error, body);
});

Options

jiraApi options:

  • host<string>: The hostname for your jira server
  • user<string>: The username to log in with
  • password<string>: 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