Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Update Fix versions in tickets automatically when merging a PR

Martin Cigorraga
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 15, 2025

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

  • Keeps Jira data accurate and consistent
  • Saves time by eliminating repetitive manual work

I’ll share my current automation attempt below. Any guidance, examples, or pointers would be much appreciated.

Thanks in advance!

 

Screenshot from 2025-08-15 10-14-17.pngScreenshot from 2025-08-15 10-16-12.pngScreenshot from 2025-08-15 10-16-31.pngScreenshot from 2025-08-15 10-16-46.png

 

2 answers

0 votes
Marc - Devoteam
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.
August 15, 2025

Hi @Martin Cigorraga 

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?

0 votes
John Funk
Community Champion
August 15, 2025

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. 

Martin Cigorraga
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 15, 2025

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:

  • Using a custom regex: {{pullRequest.labels.match("fixVersion\\.(.*)").get(1)}}
  • Selecting "Last released version" from the dropdown

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.

 

LWI-0.pngLWI-1.pngLWI-2.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.
August 15, 2025

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events