git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Script to tie git and Jira

From
Bill Lear <rael@zopyra.com>
Date
Nov 17, 2009, 01:44 UTC
Message-ID
<19202.23.659967.922524@lisa.zopyra.com>

I have started a project on github that is essentially a script to tie git and Jira, at http://github.com/rael/git-jira. We use it at our company to help us with release management and it has proven useful. See the README file for complete details. Following is a brief overview.

The script implements a certain convention we use: developers do work on topic branches that are named after Jira tickets and are created as branches off of origin/master.

When you first run the script, it will prompt you for connection parameters to your Jira server. You will then be able to create new Jira issues and associated git branches:

% git jira open --summary "Better log filtration method"
git branch PROJ-20 created
% git branch -a
  PROJ-20
* master

You can supply defaults for project, component, and issue type in your git config file, and you can provide these as arguments to the script as well (the README shows how to do this).

You can add a suffix when opening an issue if you like, to help you remember the purpose of the branch:

% git jira open --summary "Better log filtration method" -x "improve_logging"
git branch PROJ-20_improve_logging created
% git branch -a
  PROJ-20_improve_logging
* master

Or, you can rely on the script to tell you details of a git jira branch (with or without a suffix):

% git jira describe -i PROJ-20_improve_logging Data for issue: PROJ-20

Issue key . . . . . . . . . . : PROJ-20 Type . . . . . . . . . . . . : Bug(1) Status . . . . . . . . . . . : Open(1) Priority . . . . . . . . . . : Major(3) Assignee . . . . . . . . . . : rael Reporter . . . . . . . . . . : rael Created . . . . . . . . . . . : 11/16/09 7:30 PM Updated . . . . . . . . . . . : 11/16/09 7:30 PM Due date . . . . . . . . . . : Summary . . . . . . . . . . . : Better filtration method Description . . . . . . . . . : Components . . . . . . . . . : 'Component1' Affects versions . . . . . . : Fix versions . . . . . . . . : Environment . . . . . . . . . : Resolution . . . . . . . . . : Votes . . . . . . . . . . . . : 0

Adding a '-v' or '--verbose' will add all comments to the output.
This will also work implicitly for the current branch:

% git checkout PROJ-20_improve_logging % git jira describe Data for issue: PROJ-20

Issue key . . . . . . . . . . : PROJ-20 Type . . . . . . . . . . . . : Bug(1) [...]

You can also resolve issues you have completed:

% git jira close -i PROJ-20 Successfully progressed issue: PROJ-20 with step 'Resolve Issue'

Feel free to provide comments, criticize, suggest improvements, etc.
Bill
Message 1 of 1 in “Script to tie git and Jira”
  1. Bill LearNov 17, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.