DEV Community ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป

DEV Community ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป is a community of 964,423 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in
Cover image for How integrate jira with my git branches with python

How integrate jira with my git branches with python

At work I have some development ruls like:

Every change on code should be comes with a Pull request and the branch name should be named like ID of jira.

Then we have branches like this:

  $ git branch -a
  remotes/origin/DEV-118
  remotes/origin/DEV-120
  remotes/origin/DEV-123
  remotes/origin/DEV-130
  remotes/origin/DEV-133
  remotes/origin/DEV-137
  remotes/origin/DEV-141
....
Enter fullscreen mode Exit fullscreen mode

with that you don't know each branch what is it ... then lets make some fun:

With this you will receive:

DEV-XXX <Assigned Name> <Status> <Title> <url>

Now you can lost between branches and jira issues :>

output

is this the integration ? comeon zodman! show me more!

Ok ok Imagine you have assigned the ticket DEV-foo1

In git you do:

git checkout -b DEV-foo1

and start hacking .... when you finish and everything looks good. you should create the pull request then you type:


gh pr create -B dev --title "$(jira-list | grep $(git rev-parse --abbrev-ref HEAD))"

Enter fullscreen mode Exit fullscreen mode

PUM! you created a pull request with ID and title from jira.

if you don't know what is gh its a github cli

Latest comments (0)

Take a look at this:

Settings

Go to your customization settings to nudge your home feed to show content more relevant to your developer experience level. ๐Ÿ›