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

jira-tickets-tracker

v1.5.0

Published

Tracks jira tickets according to their status

Downloads

644

Readme

Jira ticket tracker

0 dependencies 100% unit tested simple tool that helps teams not to forget about jira tickets transferring to certain statuses.

jira-tickets-tracker will parse your code and search for jira links in it. It could be a comment or a string. Basically anything starting with https:// and ending with a space like: https://myProject.atlassian.net/browse/MP-42 Note: if you want to mention ticket but don't want to track it just remove the protocol or leave just the key like myProject.atlassian.net/browse/MP-42 or MP-42

It will then check status for every unique found ticket and if the status of the ticket matches the status you want to track it will log the result mentioning the tickets with expected status and exit process with 1.

Flow example: I'm writing auto tests. Auto test finds a bug and I disable that test until the bug is fixed and I leave a comment with the bug ticket in the code near the test. Then the bug gets fixed and I miss jira notification. But I have a nightly CI job instead that became red notifying that my ticket is in Done status. The job will remain red until I enable my test back and remove the comment with the ticket.

npm downloads

Installation

$ npm install jira-tickets-tracker --save-dev

Basic usage

The code provided below will log found issues and exit the process with "1". If nothing is found

void async function main() {
  try {
    const {parsedKeys} = await checkJiraStatuses({
      jiraUserEmail: 'jiraUserEmail',
      jiraUserToken: 'jiraUserToken',
      // to get the token for your user follow this documentation: 
      // https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/
      jiraAddress: 'https://myProject.atlassian.net',
      // make sure it starts with "https://" just copy the link from a browser
      dirPathWithJiraLinks: `${process.cwd()}/specs`,
      // it will search every file inside "specs" directory
      behaviorConfig: [{
        message: 'Please update tests, containing resolved issues',
        // message to be logged when tickets found
        statusNames: ['Done', 'Complete', 'Closed'],
        // statuses to track. Just write them the same way they are written on the button of Jira UI
      }],
    })
  } catch (e) {
    console.log(e);
  }
}();

Additionally, you can get status for a single ticket

await getStatus({
  jiraUserEmail: 'jiraUserEmail',
  jiraUserToken: 'jiraUserToken',
  // to get the token for your user follow this documentation: 
  // https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/
  jiraAddress: 'https://myProject.atlassian.net',
  // make sure it starts with "https://" just copy the link from a browser
  key: 'JIRA42',
}) // {networkStatusCode: 200, ticketStatus: "Closed"}

Changelog

  • 1.0.0 - Initial release
  • 1.1.0 - Fixed issue of last slash in jira link
  • 1.2.0 - all statuses logging
  • 1.2.1 - improved readme
  • 1.3.0 - Added logging of summaries
  • 1.4.0 - Get status function
  • 1.4.1 - Fixed types export
  • 1.5.0 - Returns hardcoded keys

Contributing

  • Create a personal fork of the project on Github.
  • Clone the fork on your local machine. Your remote repo on Github is called origin.
  • Add the original repository as a remote called upstream.
git remote add upstream https://github.com/Gennadiii/jira-tickets-tracker
git remote -v
origin  https://github.com/username/jira-tickets-tracker.git (fetch)
origin  https://github.com/username/jira-tickets-tracker.git (push)
upstream        https://github.com/Gennadiii/jira-tickets-tracker (fetch)
upstream        https://github.com/Gennadiii/jira-tickets-tracker (push)
  • If you created your fork a while ago be sure to pull upstream changes into your local repository. git merge upstream/develop
  • Implement fix or feature.
  • Follow the code style of the project, including indentation.
  • Run tests from __spec__ folder (npm test).
  • Write or adopt tests as needed.
  • Make sure you didn't miss any tests (npm run test-coverage).
  • Add or change the documentation as needed.
  • Squash your commits.
  • Push your branch to your fork on Github, the remote origin.
  • From your fork open a pull request. Target the project's master.