Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,555,782
Community Members
 
Community Events
184
Community Groups

How to find all issues associated with a pull request?

I've been using Jira automation rules and GitHub to track the development process on my team, and we've been struggling with this issue. 

At the moment, we have a rule that works only when one issue is linked to one pull request (see below), writing the issue key on the title of the pull request. But my objective is to make a rule such that "When a pull request is merged, all the issues that are linked to that pull request transition to the status 'Ready For Build'", since sometimes multiple Jira issues/development issues are addressed on a single branch and then a single pull request is needed. 

image.png

From the question "Update multiple issues, that are not linked, using Jira Automation" the solution seems to be using a branch action and a JQL query (see the second figure below). But the thing is that I've not been able to find a way to detect all the issues associated with the merged pull request using JQL. Is there a way to do this?  

image.png

I've already checked that the pull request linked all my issues. In my case, the branch name was "WF-1009-WF-542-WF-635-model-plot" and the pull request title was something like "WF-1009 WF-542 WF-635: fixes of ..... #49", so the pull request #49 is correctly linked to the issues WF-1009, WF-542 and WF-635. Furthermore, every issue has the branch "WF-1009-WF-542-WF-635-model-plot" associated. 

1 answer

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Oct 21, 2021

Hi @Ignacia Sanchez -- Welcome to the Atlassian Community!

I note in your screen grab that there is an error icon by the JQL branch.  Did you define the JQL for the branch?  If not, you could probably move the JQL from the condition immediately below it to the branch, and then delete the condition.

Or, move it above as shown in this article which is quite similar to your use case:

https://www.atlassian.com/devops/automation-tutorials/jira-automation-rule-on-pullrequest-merge

Kind regards,
Bill

Hello Bill! Yes, the error icon is because (for the purpose of taking the screenshot) I didn't add any JQL query haha. The main question is precisely how to make a query in that block that detects all the Jira issues associated with the merged pull request :) 

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Oct 21, 2021

Sorry, I am not currently set up to test this rule with a build pipeline...My understanding was that trigger fires for each issue associated to the PR.  Is that not the case you are observing (i.e. it is firing only once, and not once per issue)?

Yes, my understanding was also that the trigger would fire for each issue associated to the PR, but the main thing is that is not happening, and that's why I searched for another way of doing it. In this case, I found that maybe I could do it with a JQL, but I dont know how to access to "all Jira issues associated with the merged pull request"

To complement the comprehension of the problem, here's some audit logs for the rule [F] that I thought It will work, but It didn't: The Jira Issue WF-636 had only one Pull request associated, so it worked properly. But the Jira Issues WF-1009, WF-542 and WF-635 (that where associated  all to one pull request), didn't worked. The rule developmen[pullrequests].open = 0 was true for all of them. 

PS: I added only the audit log for the Jira Issue WF-635, but for WF-1009 and WF-542 the image is the same. image.pngimage.png

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Oct 22, 2021

Thanks for that info!  Based on your findings, you could branch with some adjustments to your rule.  Please try this to see how it helps:

  • trigger: pull request merged
  • branch: on JQL, changing myProject to your project
project = myProject 
AND issueType NOT IN (Story, Epic)
AND development[pullrequests].open = 0
    • action: transition the issue

I don't think this will work since my objective is only to transition the issues that are related to the pull request that's been merged. In fact, I wrote this JQL query on the advanced Issue navigator and more than 700 Jira issues where returned. 

What I really need is, on a branch, some JQL query like:  

project = myProject 
AND issueType NOT IN (Story, Epic)
AND development[pullrequests].open = 0 
AND pullrequest.Number = development[pullrequestNumber]

 And my main question is precisely if something like pullrequest.Number = development[pullrequestNumber] exists in Jira, or if there is some other way to access all the related issues of the merged pull request, so that every related issue with the pull request will be transitioned.

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Oct 25, 2021

I haven't been able to learn that info after a few searches.  If you are on a paid license of Jira, please consider working with your site admin to submit this as a support ticket: https://support.atlassian.com/contact/#/

And once you hear from them, please consider posting what you learn to benefit the community.  Thanks!

Like Ignacia likes this

I'll do that, and I'll post it If I know something. Thanks for the help! 

Like Bill Sheboy likes this

Hi, I guess you didn't find a solution?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events