Package: jira-commands
jira-commandsTable of ContentsScriptsConfigurationBasic AuthenticationOAuth AuthenticationPAT authenticationInstallationRun via docker / nerdctlDirect pip installZSH pluginzgenomAntigenoh-my-zshSome command-line tools for interacting with JIRA.ScriptsAll of these scripts support--helpto get a detailed list of command line options.NameDescriptionjcMain driver. Will run all the other commands inside a docker container for you.jc add label/jc label addAdd a label to a ticketjc assign subtasks/jc assign ticket subtasksAssign a ticket to someone.jc assign ticket/jc ticket assignAssign a ticket to someone.jc close subtasks/jc close ticket subtasksClose all of a ticket's subtasksjc close ticket/jc ticket closeClose a ticketjc comment on subtasks/jc comment on ticket subtasksAdd identical comment to all of a ticket's subtasksjc comment on ticket/jc ticket commentComment on a ticketjc create ticket/jc ticket createCreate a ticket. You will needjc custom field allowed valuesList a custom field's allowed values since JIRA isn't forthcoming about them.jc examine ticket/jc ticket examineDetailed dump of a ticket and all its custom field namesjc extract customfield mappingsExtract the custom field mappings from an issue into a filejc get label/jc list labelsList labels on a ticketjc get link typesPrints the names of all link types defined on your JIRA instance.jc get priority idsPrints the names of all ticket priorities defined on your JIRA instance.jc label remove/jc remove labelRemove a label from a ticketjc link tickets/jc ticket linkLink two tickets. Usejc get link typesto see what link names are defined on your JIRA server. Case matters.jc list project ticketsList open tickets in a given JIRA projectjc list subtasksClose all of a ticket's subtasksjc list ticket transitions/jc ticket transition listSee the availale transitions for a given ticket.jc transition ticket to/jc ticket transition setTransition a ticket to another state. Usejc list ticket transitionsto see which are availablejc vivisect ticket/jc ticket vivisectDetailed dump of a ticket to find out all the custom field names and other innards.jc transition subtasks/jc transition ticket subtasksTransition all of a ticket's subtasks to a specific stateThejcprogram is the main driver script and will find the subcommands, so you can dojc ticket comment --ticket ABC-123 --comment 'foo bar baz'and it will find thejc-ticket-commentscript and run it with the--ticketand--commentarguments.If you're using the docker method,jcwill automatically run the subcommands inside a container for you. If you've installed via pip, it'll find the commands where they were installed in your$PATH.ConfigurationThejccommands all read settings from~/.jira-commands/jira.yaml. Settings in the file can be overridden by specifying command-line options.Basic AuthenticationI'm setting my username and jira server in the example configuraation file below. The tools will ask for my password when I run them.jira_server:https://jira.example.comusername:YOUR_JIRA_USERYou can specify apasswordkey but it's a terrible idea.OAuth AuthenticationHere's an example settings file for oauth authentication. Add--auth=OAUTHto use oath instead of basic authentication.jira_server:https://jira.example.com/oauth_access_token:ABCDabcdABCDabcdABCDabcdABCDabcdoauth_access_token_secret:ABCDabcdABCDabcdABCDabcdABCDabcdoauth_consumer_key:OAUTH_CONSUMER_KEY_IDoauth_private_key_pem_pathL:/path/to/pem/fileusername:YOUR_JIRA_USERPAT authenticationHere's an example settings file for PAT authentication.username:YOUR_JIRA_USERpat_token:xyzzyAbc123jira_server:https://jira.example.com/InstallationRun via docker / nerdctlThis is the recommended way to use thejccommands, and how it will be run if you use one of the ZSH frameworks detailed below.If you're not using a ZSH framework, clone this repository and add itsbindirectory to your$PATH. It contains ajcscript that will detect whether you havenerdctlordockerand if it finds them, map~/jira-commands(and the configuration file there) into a volume in thejira-commandscontainer and run the tools inside the container.Direct pip installsudo pip install jira-commandswill install the command-line tools viapip. This may cause compatibility annoyances with other python tools on your system, so there's adocker/nerdctloption as well.ZSH pluginThe tooling has been packaged as a ZSH plugin to make using it as easy as possible for ZSH users.zgenomIf you're usingZgenom:Addzgenom load unixorn/jira-commandsto your.zshrcwith your other pluginszgenom reset && zgenom saveAntigenIf you're usingAntigen:Addantigen bundle unixorn/jira-commandsto your .zshrc where you've listed your other plugins.Close and reopen your Terminal/iTerm window to refresh context and use the plugin. Alternatively, you can runantigen bundle unixorn/jira-commandsin a running shell to haveantigenload the new plugin.oh-my-zshIf you're usingoh-my-zsh:Clone the repository into a newjira-commandsdirectory in oh-my-zsh's plugin folder:git clone https://github.com/unixorn/jira-commands.git $ZSH_CUSTOM/plugins/jira-commandsEdit your~/.zshrcand addjira-commands– same as clone directory – to the list of plugins to enable:plugins=( ... jira-commands )Then, restart your terminal application to refresh context and use the plugin. Alternatively, you can source your current shell configuration:source ~/.zshrc