A lot of us use Git to maintain our code-base. And a lot of companies out there, like mine, use Jira for project management. A nice feature of Jira is the Git Version Control Viewer, which lets one track all the commits made against a ticket. The catch being, you have to mention the ticket number in your commits. While this is not that big a deal, it gave me an idea for a simple project I could write to learn python.
Together with Michael Pitidis, we wrote a tool in python that sets up the Git & Jira integration for the developer. We called it GitJira (we decided to use the creativity in the code rather than the name). Of course, the pre-requisite is that you have the Git Version Control Viewer plugin installed in Jira (comes by default).
In its present form, it supports three functionalities -
- Create branches of the format -
<issue type>/<ticket number>- given just the ticket id
- Automatically transition tickets to in-progress when you create a branch for a ticket
- Fetch the summary of a ticket and add to commit message when committing a branch created by gitjira
So for instance, if you do
gitjira -b ABC-123
it will automatically query your Jira instance and get the issue type (lets say a bug) and create a branch called -
and will change the status of the ticket to in-progress.
When you try to commit this branch
it will fetch the ticket summary and automatically add it to your Git commit message and leave you in your Git text editor.