Automating a workflow transition on Pull Request merge with a branch specifier

So for all of our services we develop on feature branches, named after the JIRA issue number. We use git-hooks to inject the branch name (and thus the issue number) into the commit message, this hooks up commits with tickets, great!

We then get our developers to create a pull request from issue-number branch to master for the code review step. We automatically transition to the "Code Review" status on PR creation and transition to "Awaiting Test" on PR merge as we automatically deploy to our TEST environment on merges to master.

Now we release to our LIVE environment off a live branch, so we have a second PR from master -> live whenever we want to deploy. I'm aware I can set the same PR merge trigger to fulfil the automatic transition from "Awaiting Test" to "Resolved" (which to us means deployed to the LIVE environment) but often a single issue may have more than 1 PR so quite often we end up transitioning to "Awaiting Test" then straight to "Resolved" as we merge to issue-number, feature branches into master.

Now we can solve this issue if we have a conditional validator on the target branch for both transitions but I cannot see this anywhere in the JIRA cloud settings, anyone got any ideas how to achieve this (hopefully without resorting to Smart Commits :/)

Thanks,

Alex

 

PS. This is our workflow.

 

Screen Shot 2016-12-29 at 14.12.27.png

 

1 answer

In response to your multiple PR situation, can you address it with the "Unreviewed Code Condition"?

 

image2016-12-29 15:44:23.png

Hmm, maybe. I've updated the workflow to include this and will report back after a few tests, thanks for the advice Randy!

Nope doesn't work unfortunately, it still triggers all the way through to resolved in the case where there is only 1 pull request.

Looks like this is because of the evented nature of the transition triggers, because it listens to the same event twice, if it handles them in the wrong order it'll correctly transition from "Code Review" -> "Awaiting Test" on the first trigger. It'll then go from "Awaiting Test" -> "Resolved" on the second event, both of which pass the "Unreviewed Code Condition". 

Thanks for your answer it's a step in the right direction and I'll be keeping it in place but it's not the full solution unfortunately :/

Suggest an answer

Log in or Join to answer
Community showcase
Teodora [Botron]
Published Thursday in Marketplace Apps

Jira Inferno: The Nine Circles of Jira Administration Hell

If you spend enough time as a Jira admin - whether you are managing a single, mid-sized instance, a large enterprise one or juggling multiple instances at once - you will eventually find yourself in ...

274 views 0 12
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot