Skip to main content

Quickly create jira issues from the command line

Project description

jira-issue

This script allows users to quickly create Jira issues from the command line. The script is python3 based and uses the jira-python. The goal is to minimize the effor needed to put in simple Jira issues.

If prerequisites are not automatically installed, run: sudo pip3 install jira python-editor

Configuration

The configuration is stored in ~/.jira_config. This file uses ini format with a DEFAULT section for items like the Jira credentials and custom sections that can be used to create templates that can be easily called. When a custom section is called, the DEFAULT is merged with the custom section and custom section items override DEFAULT. Here are the common fields for the configuration file:

username, token, server = Data needed to connect to github. Go to https://id.atlassian.com/manage/api-tokens to create a token.

assignee = github assignee ID
board = Board name to add this issue to ( or use board_id ).
board_id = Scrum board to add this issue to ( or use board).
issue = issue key to process ( leave blank to create a new issue).
key = the key for the project that issues will be created in.
type = Issue type to create.
labels = labels to assign. Labels can be in comma or space separated format. Labels can not contain spaces or commas.
close = Close the issue?
work = Time Spent string for the amount of work done (Examples: 30m, 1h ).

Custom Fields
Custom fields can be mapped to an alias name for more readable configuration. The following examples maps customfile_11135 to the alias squad and then assigns it the value of Alpha.

customfield_11135 = {"alias":"squad","type":"list"}
squad = Alpha

Custom Field Notes

  • Custom fields can only be configured in the DEFAULT section.
  • An alias can be specified in any section
  • A custom field can be configured but not used ( i.e. an the alias field not specified). In this case, the custom field will not be set
  • By default custom fields are of type text. Currently the only other option is a list. Use comma or space separation between list items

Usage

These examples are based on the jira_config.example file. The title field does not need to be quoted. This means that if you update an existing ticket that the title field has to be sent, but will be ignored.

Create an Ops Request and close it with 1.5 hours worked
jira-issue -u opsc -w 1.5h More evidence needed for soc2

Create a Support request with the tag ProdSupport and 30 minutes worked
jira-issue -u ps -w 30m Investigate deploy failure on core-api-prod-1a

Update the issue DC-1788 with hours
jira-issue -w 30m -i DC-1788 x

Update the issue DC-1788 with hours and close
jira-issue -w 30m -c -i DC-1788 x

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jira-issue-0.0.4.tar.gz (5.4 kB view hashes)

Uploaded Source

Built Distribution

jira_issue-0.0.4-py3-none-any.whl (5.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page