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.
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?
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.
Hi @Ignacia -- 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 :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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)?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:
project = myProject
AND issueType NOT IN (Story, Epic)
AND development[pullrequests].open = 0
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, I guess you didn't find a solution?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Ignacia I am also looking for something like this. Did you manage to find a solution?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No solution yet?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry for the late follow-up on this issue—spoiler: we don't use Jira anymore.
In the end, we couldn't find a reliable way to address this and ultimately decided to migrate to GitHub Projects for greater flexibility. At that time, the integration between Jira and GitHub was quite basic, whereas GitHub Projects offered workflows specifically designed for development teams. Additionally, if a custom workflow is required, you can create one using GitHub Actions.
That said, this solution may not be suitable for all types of teams. We were able to make this switch because our workflow didn’t require close issue tracking with the client team.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.