How to tell if there are multiple pull requests associated with an issue via smart value?

joshua.peeling July 22, 2020

I am trying to create an automation rule that triggers when a pull request is merged that is linked to a jira issue. I want to transition the issue from "In Progress" to "Done". However, I only want to actually transition the issue if ALL of the pull requests associated with the jira issue are merged. If one pull request has been merged, but another is still open, I want the ticket to stay in "In Progress". I know there is an existing smart value {{pullRequest.state}}. Is there a way to get ALL of the pullRequests for the issue, and not just the one being merged?

1 answer

1 accepted

5 votes
Answer accepted
Artur.Cybruch August 26, 2020

We had the same use case and we used the following to transition an item once all PRs are merged:

WHEN: pull request merged
IF: issue matches JQL
 development[pullrequests].open = 0
THEN: transition an issue to <status>

 

joshua.peeling August 26, 2020

This is awesome, thanks so much!! Exactly what I was looking for.

Like Artur.Cybruch likes this
Tim October 27, 2020

Hello @Artur.Cybruch

 

I have exactly the same issue, but I can't find where to put this code, would you mind to tell me a bit more ?

 

Thanks

Volker Gimple February 11, 2021

Had the same issue. If you are looking at the new automation approach then this video from Atlassian might have the answer for you: (1597) How to transition a Jira issue when a pull request is merged - YouTube

Artur.Cybruch April 28, 2021

@Timothee Grosjean this has to be done by an administrator of your JIRA Cloud as only they would be able to add this to the automation in JIRA. This can be found by going to "Settings" -> "System" -> scroll to the bottom until you can see "Automation Rules" section. Once inside the automation area, your admins would be able to create a rule like this (obviously, this would need to be customised based on your company needs):

automation rules.png

Like Olga Ivanova likes this
Robin Brinkhoff September 28, 2021

Thanks for the example - works.

Like Artur.Cybruch likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events