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 🙏

© 2025 – Pkg Stats / Ryan Hefner

js-jira

v0.12.2

Published

JS based JIRA API

Readme

JavaScript JIRA API#

This was forked from https://github.com/steves/node-jira . Big thanks to steves for starting the code base.

A node.js module, which provides a great interface for the JIRA REST API.

JIRA REST API documentation can be found here

Installation

Install with the node package manager npm:

$ npm install js-jira

or

Install via git clone:

$ git clone git://github.com/clearly/js-jira.git
$ cd js-jira
$ npm install

Examples

Create the JIRA client

  JiraApi = require('jira').JiraApi;
  var jira = new JiraApi({
    scheme    : 'https',              // Default 'https'
    host      : 'jira.yourdomain.com' // REQUIRED
    port      : 443                   // Default 443
    user      : 'MyJiraId',           // REQUIRED
    password  : 'NotASecret'          // REQUIRED
    version   : '2'                   // Default '2'
    base      : 'jira'                // Default '' - The prefix in your install before /rest/api
  });

Find the status of an issue

jira.findIssue(issueNumber, function(error, issue) {
    console.log('Status: ' + issue.fields.status.name);
});

Currently there is no explicit login call necessary as each API call uses Basic Authentication to authenticate.

Get an issue remote links

Returns an array of remote links data.

jira.getRemoteLinks(issueKey, function(err, links) {
    if (!err) {
        console.log(issueKey + ' has ' + links.length + ' web links');
    }
});

Create a remote link on an issue

Returns an array of remote links data.

// create a web link to a GitHub issue
var linkData = {
    "object": {
        "url" : "https://github.com/steves/node-jira/issues/1",
        "title": "Add getVersions and createVersion functions",
        "icon" : {
            "url16x16": "https://github.com/favicon.ico"
        }
    }
};

jira.createRemoteLink(issueKey, linkData, function (err, link) {
    
});

More information can be found by checking JIRA Developer documentation.

Options

JiraApi options:

  • protocol<string>: Typically 'http:' or 'https:'
  • host<string>: The hostname for your jira server
  • port<int>: The port your jira server is listening on (probably 80 or 443)
  • user<string>: The username to log in with
  • password<string>: Keep it secret, keep it safe
  • Jira API Version<string>: Known to work with 2 and 2.0.alpha1
  • verbose<bool>: Log some info to the console, usually for debugging
  • strictSSL<bool>: Set to false if you have self-signed certs or something non-trustworthy
  • oauth: A dictionary of consumer_key, consumer_secret, access_token and access_token_secret to be used for OAuth authentication.
  • base<string>: A base slug if your JIRA instance is not at the root of host

Implemented APIs

  • Authentication
    • HTTP
    • OAuth
  • Projects
  • Pulling a project
  • List all projects viewable to the user
  • List Components
  • List Fields
  • List Priorities
  • Versions
  • Pulling versions
  • Adding a new version
  • Pulling unresolved issues count for a specific version
  • Rapid Views
  • Find based on project name
  • Get the latest Green Hopper sprint
  • Gets attached issues
  • Issues
  • Add a new issue
  • Update an issue
  • Add watcher to an issue
  • Transition an issue
  • Pulling an issue
  • Issue linking
  • Add an issue to a sprint
  • Get a users issues (open or all)
  • List issue types
  • Search using jql * Set Max Results * Set Start-At parameter for results
  • Add a worklog
  • Delete a worklog
  • Add new estimate for worklog
  • Add a comment
  • Remote links (aka Web Links) * Create a remote link on an issue * Get all remote links of an issue
  • Transitions
  • List
  • Users
  • Search

TODO

  • Refactor currently implemented APIs to be more Object Oriented
  • Refactor to make use of built-in node.js events and classes

Changelog

  • 0.9.2 Smaller fixes and features added
    • proper doRequest usage (thanks to ndamnjanovic)
    • Support for @ in usernames (thanks to ryanplasma)
    • Handling empty responses in getIssue
  • 0.9.0 Add OAuth Support and New Estimates on addWorklog (thanks to nagyv)
  • 0.8.2 Fix URL Format Issues (thanks to eduardolundgren)
  • 0.8.1 Expanding the transitions options (thanks to eduardolundgren)
  • 0.8.0 Ability to search users (thanks to eduardolundgren)
  • 0.7.2 Allows HTTP Code 204 on issue update edit (thanks to eduardolundgren)
  • 0.7.1 Check if body variable is undef (thanks to AlexCline)
  • 0.7.0 Adds list priorities, list fields, and project components (thanks to eduardolundgren)
  • 0.6.0 Comment API implemented (thanks to StevenMcD)
  • 0.5.0 Last param is now for strict SSL checking, defaults to true
  • 0.4.1 Now handing errors in the request callback (thanks mrbrookman)
  • 0.4.0 Now auto-redirecting between http and https (for both GET and POST)
  • 0.3.1 Request is broken, setting max request package at 2.15.0
  • 0.3.0 Now Gets Issues for a Rapidview/Sprint (thanks donbonifacio)
  • 0.2.0 Now allowing startAt and MaxResults to be passed to searchJira, switching to semantic versioning.
  • 0.1.0 Using Basic Auth instead of cookies, all calls unit tested, URI creation refactored
  • 0.0.6 Now linting, preparing to refactor
  • 0.0.5 JQL search now takes a list of fields
  • 0.0.4 Added jql search
  • 0.0.3 Added APIs and Docco documentation
  • 0.0.2 Initial version