1.0.14 • Published 2 years ago

ticket-machine v1.0.14

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Ticket machine

Build workflow status

This is a tool to generate tickets in JIRA.

Usage

In order to use this library you need API token. Visit https://id.atlassian.com/manage-profile/security/api-tokens and get for yourself API token.

Install package

yarn add ticket-machine

Create a config file

// config.tm.ts

import type { Config } from 'ticket-machine/config';

const config: Config = {
  username: () => process.env.USERNAME, // your email address ie. john@example.com
  password: () => process.env.PASSWORD, // your token ie. token1234abc
  epic: () => process.env.EPIC, // name of the epic where tickets will be created ie. PR-22
  project: () => process.env.PROJECT, // name of the project where ticket will be creted, ie. PR
  issueType: () => process.env.ISSUETYPE, // type of the issue ie. Story
  labels: () => ['front-end'], // labels for the new created ticket
  jql: entry => `text ~ "${entry}" AND "Epic Link" = ${process.env.EPIC_ID}`, // Search query that will be executed to make script idempotent
  summary: entry => `TODO for ${entry}`, // Title of the ticket
  description: entry => `TODO for ${entry}`, // Description of the ticket
  transform: () => {
    return (entry: Todo, ticket: Issue) => {};
  },
};

export default config;

Run command

npx ticket-machine run

How it works?

  1. It will try login with credentials that you provided
  2. It will search for ticket with provided jql
  3. In case when there is a ticket it will skip ticket creation
  4. When there is no ticket for given jql query it will create ticket

Usage

Ticket machine

Usage:
  tm run [--config=<file>]
  tm transform [--config=<file>]
  tm -h | --help

Options:
  -h --help       Show this screen.
  --config=<file> Config file [default: 'config.tm.ts']

Installation

You need node.js in version 16 and higher, and yarn to run this project. To install dependencies just run:

yarn install

Build

In order to build this library execute:

yarn build

Tests

In order to run test you can simply execute:

yarn test

Linter

We are using ESLint to check quality of the code.

yarn lint

Prettier

To check if the code is correctly formatted, use prettier.

yarn prettier

In order to fix files with prettier execute:

yarn prettier:write
1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago