Hello,
I am new to Jira automation and any help would be greatly appreciated :)
How can I create a Jira automation so that if a pull request contains multiple commits with different Jira issue keys (for example PS-18, PS-19, PS-20), all of those issues are automatically transitioned to In Progress or Done?
I am currently using the new Jira Flows builder. I managed to create an automation that detects PS- in the PR title or commit messages, but the problem is that the transition only happens for one “main” work item instead of all issues referenced in the commits.
Example:
Commit 1: PS-18 Add tests
Commit 2: PS-19 Fix validation
Commit 3: PS-20 Add auth checks
What I want:
all issues (PS-18, PS-19, PS-20) should transition automatically.
Current behavior:
Jira seems to detect the commits,
but the “Transition the work item” action only transitions one issue.
Does the new Jira Flows builder support iterating through all issue keys found in commits?
Or is the only recommended solution:
1 pull request = 1 Jira issue?
Thanks for the help.
Hi @Nika Zupanc
First, did you confirm the smart value {{pullRequest.commits.message}} actually contains a list of work item keys? For example, does:
Let's assume it is one of those, and you want to branch over the keys to transition the work items.
{{pullRequest.commits.message.flatten}}
{{pullRequest.commits.message.flatten.trim.match("(PS-\d+)").distinct}}
key IN ( {{pullRequest.commits.message.flatten.trim.match("(PS-\d+)").distinct.join(", ")}} )
I wrote those expressions without testing with an actual PR and commits, so please adjust the regex to meet your needs and test accordingly. Perhaps test by just writing the smart value expression results to the audit log before attempting to transition the work items.
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.