Hello,
I am new to JIRA automation. We use Cloud version. I have a project that is Classic, Scrum. (cloud version of JIRA)
I would like to create an automation rule that can move my issue from RESOLVED to CLOSED only if the pull request ID is identifying specific repository.
For example, I have two repositories that may contribute work for a single issue. REP-A and REP-B. I would like the issue to be moved from RESOLVED to CLOSED if and only if the pull request from REP-B was merged in. Pull requests from REP-A must not result in closing the issue.
I was thinking to try using pull request ID, but I do not know how to reference it within the automation rules and which rule components would be most appropriate to try using for this. For example, if/else block or some other. I would also need to "parse/filter" the pull request ID to detect repository name.
The pull request ID as shown by JIRA seems to be a link that has some text and associated URL, e.g.
Text: parent/child!3 : This would be pull request #3 within parent/child repository
URL: https://gitlab.com/parent/child/-/merge_requests/3 : GitLab calls it Merge Request
I would like to detect "parent/child" within the pull request ID and do things differently depending on the actual repository names.
I would appreciate any pointers that can help me implement such rule.
Thanx,
Bogdan
Hi @Bogdan Kosanovic -- Welcome to the Atlassian Community!
Are you using the Pull Request Merged trigger in your rule? If so, have you checked this value to see if it has the repo information you need:
{{pullRequest.destinationBranch.repository}}
Best regards,
Bill
Hello @Bill Sheboy
Thanks for the hint. That is exactly what I was looking for. I'll try it out and report back. I even tried to "guess" the variable name to check. :)
BTW, where can I find the list of all such classes/objects that can be used in conditional rules?
Best Regards,
Bogdan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Actually, I found the place where all those smart values are listed. (https://support.atlassian.com/jira-software-cloud/docs/smart-values-development/)
The first attempt did not work, but I'll try a bit more before I ask another question.
Regards,
Bogdan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok. So, I figured this out (at least for my case). I had to use
{{pullRequest.destinationBranch.repository.url}}
Without the URL I could not use "does not contain" or "contains" successfully within the if-block condition. Maybe it is the way GitLab reports the repository. Nevertheless, it worked.
Thanks @Bill Sheboy for your help!
Regards,
Bogdan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am glad to hear that helped. Consider keeping a watch on that development smart value page and this issue to see other improvements in automation:
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.