Command-line API for Atlassian JIRA using the Tomitribe CREST library

Related tags

jamira
Overview

Atlassian JIRA Command-Line (CLI)

Jamira is a command-line API for Atlassian JIRA using the Tomitribe CREST library.

Installation

Jamira can be downloaded as a ready-to-go executable from Maven Central

curl https://repo1.maven.org/maven2/org/tomitribe/jamira/jamira-cli/0.1/jamira-cli-0.1.sh > /usr/local/bin/jamira
chmod 755 /usr/local/bin/jamira

Installation using JBang

Jamira can be installed and run with jbang - it will even setup java for you if you do not have that available.


curl -Ls sh.jbang.dev | bash -s app install [email protected]/jamira jamira ---

Completion

Additionally, if you want command completion you can add the following to your ~/.bash_profile, ~/.bashrc or similar environment setup scripts:

source "$(jamira _completion -f)"

Setup

Jamira has accounts in a similar way git has remotes. An account can be setup using the account add command

Usage: account add  Name Username Password URI

The Name value should be any short identifier with no spaces and all lowercase. Any other command that has an --account flag can use that identifier to locate the login information and URL of your desired JIRA server.

Example setup:

$ jamira account add apache elmerfudd "GetTh3Rabb1t" https://issues.apache.org/jira

$ jamira account list
  name    username             serverUri
-------- ----------- --------------------------------
 apache   elmerfudd   https://issues.apache.org/jira

Commands

$ jamira
Commands:

   account
   bulk-create
   create
   help
   list

List

$ jamira list
Usage: list [subcommand] [options]

Sub commands:

   components
   favourite-filters
   fields
   groups
   issue-link-types
   issue-types
   priorities
   project-roles
   projects
   resolutions
   statuses
   subtasks
   users
   versions

List Priorities

For example to list all of the priorities setup in the JIRA install:

$ ./jamira-cli/target/jamira list priorities
  id       name                                                     description
------- ---------- --------------------------------------------------------------------------------------------------------------
     1   Blocker    Blocks development and/or testing work, production could not run
 10000   Urgent     This issue should block release until it is resolved, and trigger immediate release once resolved.
     2   Critical   Crashes, loss of data, severe memory leak.
 10001   High
     3   Major      Major loss of function.
 10002   Normal
     4   Minor      Minor loss of function, or other problem where easy workaround is present.
 10003   Low
     5   Trivial    Cosmetic problem like misspelt words or misaligned text.
 10100   P0          Outage blocking development and/or testing work; requires immediate and continuous attention
 10101   P1         Critical bug: data loss, total loss of function, or loss of testing signal due to test failures or flakiness
 10102   P2         Default priority. Will be triaged and planned according to community practices.
 10103   P3         Non-urgent bugs, features, and improvements
 10104   P4          Trivial items, spelling errors, etc.

List Subtasks

To list all of the subtasks for a specific issue

$ jamira list subtasks OPENEJB-142
   issueKey                           summary                          status.name
-------------- ------------------------------------------------------ -------------
 OPENEJB-145    iTest: StatelessRemoteJndiTests                        Closed
 OPENEJB-146    iTest: StatelessLocalJndiTests                         Closed
 OPENEJB-147    iTest: StatelessHomeIntfcTests                         Closed
 OPENEJB-148    iTest: StatelessEjbHomeTests                           Closed
 OPENEJB-149    iTest: StatelessEjbObjectTests                         Closed
 OPENEJB-150    iTest: StatelessEjbLocalHomeTests                      Closed
 OPENEJB-151    iTest: StatelessEjbLocalObjectTests                    Closed
 OPENEJB-152    iTest: StatelessRemoteIntfcTests                       Closed
 OPENEJB-153    iTest: StatelessLocalIntfcTests                        Closed
 OPENEJB-154    iTest: StatelessHomeHandleTests                        Closed

Create

Can create issues, versions and components. For common issue types there are convenience commands; bug, improvement, new-feature, task, subtask.

$ jamira create
Missing sub-command
Usage: create [subcommand] [options]

Sub commands:

   bug
   component
   improvement
   issue
   new-feature
   subtask
   task
   version
   wish

Create Sub-Task

Sub-tasks can be created by simply specifying the parent issue key and supplying a text summary to use for the new issue

$ jamira create subtask
Missing argument: IssueKey

Usage: create subtask [options] IssueKey String

Options:
  --account=<Account>               Shortname of the JIRA server
                                    (default: default)
  --affected-version=<String[]>     The names of the versions affected by the issue
  --assignee=<String>               Username of the person to which the issue should be assigned
  --component=<String[]>            The component names relating to the issue
  --description=<String>            Long description of the issue
  --fix-version=<String[]>          The names of the versions affected by the issue
  --priority=<String>               The name of the priority for the issue
  --reporter=<String>               Username of the person who is the reporter of the issue

For example:

jamira create subtask TOMEE-3002 "Test caching"

Bulk-create

When you have several issues you need to create it’s advised to use the bulk API.

$ jamira bulk-create
Missing sub-command
Usage: bulk-create [subcommand] [options]

Sub commands:

   issues
   subtasks

Bulk-create Subtasks

Subtasks can be created in bulk using the following command. The summary for each subtask is read from the piped input stream. This allows several lines of text to be generated on the command line and each line becomes a subtask.

$ jamira bulk-create subtasks
Missing argument: IssueKey

Usage: bulk-create subtasks [options] IssueKey

Options:
  --account=<Account>               The shortname of the jira install configured via the `setup` command
                                    (default: default)
  --affected-version=<String[]>     The names of the versions affected by the issue
  --assignee=<String>               Username of the person to which the issue should be assigned
  --component=<String[]>            The component names relating to the issue
  --fix-version=<String[]>          The names of the versions affected by the issue
  --priority=<String>               The name of the priority for the issue
  --reporter=<String>               Username of the person who is the reporter of the issue

For example:

$ echo -e "Bulk insert"{1..10}"\n"
Bulk insert1
 Bulk insert2
 Bulk insert3
 Bulk insert4
 Bulk insert5
 Bulk insert6
 Bulk insert7
 Bulk insert8
 Bulk insert9
 Bulk insert10

$ echo -e "Bulk insert"{1..10}"\n" | jamira bulk-create subtasks TOMEE-3002
TOMEE-3021
TOMEE-3022
TOMEE-3023
TOMEE-3024
TOMEE-3025
TOMEE-3026
TOMEE-3027
TOMEE-3028
TOMEE-3029
TOMEE-3030
Issues
  • add jbang catalog and docs

    add jbang catalog and docs

    I spotted the shaded jar so made a jbang catalog that will pick up the LATEST (wether local snapshot or latest in maven repo).

    You can change it to RELEASE if you want snapshots to be ignored, of set it to specific version number dependent on what you want jbang [email protected]/jamira to do.

    btw. you can also instead put the alias in a repo called tomitribe/jbang-catalog and then it would just be jbang [email protected]

    opened by maxandersen 0
  • Adjust default SocketTimeOut to allow large bulk processing to complete

    Adjust default SocketTimeOut to allow large bulk processing to complete

    What does this PR do?

    Atlassian has hard-coded a 20 second socket timeout in their HttpClientOptions and do not allow the user to specify / modify them during the creatioin of the REST client.

    This PR override sthe default SocketTimeOut with 60 minutes to allow bulk processing to complete without a SocketTimeoutException by making the client factory configurable (allow custom http client options)

    opened by rzo1 0
  • PoC: Running Jamira as native binary via Quarkus and GraalVM

    PoC: Running Jamira as native binary via Quarkus and GraalVM

    Hey @dblevins, as discussed here's a quick stab at running Jamira as a native binary, via Quarkus and GraalVM. You could do this solely with GraalVM of course, but Quarkus takes care of a lot of the required configuration already, so it was much easier for me to do it that way. This is really just a quick draft / proof-of-concept, but it shows what's doable.

    jamira_native

    opened by gunnarmorling 1
Owner
Tomitribe
Experts of Tomcat and Java EE - Champion of Open Source Software!
Tomitribe
Several implementations of a text table, originally using ASCII and UTF-8 characters for borders.

ASCII Table ASCII table - A simple tool to format tables with various row/column options for indentation, indentation character, alignment, padding (l

Sven van der Meer 303 Mar 10, 2021
Java annotation-based framework for parsing Git like command line structures

Airline Airline is a Java annotation-based framework for parsing Git like command line structures. Latest release is 0.8, available from Maven Central

null 837 Mar 8, 2021
ASCII renderer in pure java with no external dependencies

Java ASCII Render ASCII renderer in pure java with no external dependencies. Java ASCII Render supports graphical primitives/elements, layers, context

David E. Veliev 112 Mar 9, 2021
A command line parser generator

jbock is a command line parser that works similar to airline and picocli. While most of these other tools scan for annotations at runtime, jbock is an

H90 37 Feb 16, 2021
JLine is a Java library for handling console input.

JLine JLine is a Java library for handling console input. It is similar in functionality to BSD editline and GNU readline but with additional features

null 832 Mar 10, 2021
args4j

args4j args4j is a small Java class library that makes it easy to parse command line options/arguments in your CUI application. See more info at [http

Kohsuke Kawaguchi 711 Mar 4, 2021
Jansi is a small java library that allows you to use ANSI escape sequences to format your console output which works even on windows.

Description Jansi is a small java library that allows you to use ANSI escape codes to format your console output which works even on Windows. It also

FuseSource 805 Mar 11, 2021
Command line parsing framework for Java

JCommander This is an annotation based parameter parsing framework for Java 8. Here is a quick example: public class JCommanderTest { @Parameter

Cedric Beust 1.6k Mar 12, 2021
Java library for creating text-based GUIs

Lanterna Lanterna is a Java library allowing you to write easy semi-graphical user interfaces in a text-only environment, very similar to the C librar

null 1.6k Mar 10, 2021
A library for creating interactive console applications in Java

Text-IO Text-IO is a library for creating Java console applications. It can be used in applications that need to read interactive input from the user.

Beryx 228 Mar 5, 2021