Hi all,
I’m trying to automate a step in our workflow and could use some help.
The problem
Whenever we merge a PR that fixes a Jira issue, the Fix Versions field has to be updated manually for each ticket. This step is often forgotten, leading to inconsistent Jira data.
What I want to do
Have Jira automatically populate Fix Versions when a linked PR is merged in GitHub, based on predefined rules.
The best approach I’ve found so far is using a label assigned to the PR. This would also help enforce repository rules — if the fix versions label is not set, the PR can’t be merged.
Why
I’ll share my current automation attempt below. Any guidance, examples, or pointers would be much appreciated.
Thanks in advance!
Welcome to the community.
What do the audit log provide when the rule is run?
Does the smart values used in the edit action provide a value, set a log action in the rule to check this
If it does, you could try to create a variable and then in the edit action set the fix version field to the variable value.
Also do the Fix Versions you use in the labels already exist?
Hi Martin - Welcome to the Atlassian Community!
I am not an expert on GitHub, but might can help with the automation. For the Branch, why not use the Linked Work Items branch instead of what you are doing now- which I am not sure what you are doing in that step.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi John,
Appreciate the prompt response.
To clarify, my goal with {{pullRequest.commits.issueKeys}} was to identify the associated issue keys (e.g., HDM-123) from the commits in the merged pull request so that the automation can apply changes to those linked tickets.
I tried replicating the previous setup using the Linked Work Items branch as you suggested, but the Fix Versions field isn't being updated after the pull request is merged.
For the Edit Work Items component, I tested two approaches:
Neither triggered the Fix Version update. Any idea what might be missing for the automation to target and update the related issues properly?
Thanks again for your help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Martin Cigorraga -- Welcome to the Atlassian Community!
Did you know that list indexing in smart values is zero-based, not one-based? Thus your expression the Edit Work Item action is getting the second one, not the first. When you want the first one, use either get(0) or the first function.
And, to select the Fix Version by name in an edit action, I believe you need to use JSON and not the field from the dropdown. (With the dropdown, the version ID, not the name must be supplied.) Please see this information for how to select the version with JSON:
https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/#Fix-Versions
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.