Hi.
I would like to update an Epic Fix Versions from all children when Epic transitions.
does anyone have any idea how to accomplish?
Hi @Amir Shmulevich -- Welcome to the Atlassian Community!
Please clarify what you are trying to accomplish as it is unclear. And what have you tried thus far to solve the need?
Are you trying to accomplish this:
GIVEN there is an Epic with one or more child issuesAND the child issues have one or more selected Fix Version valuesWHEN the Epic transitions to status ???THEN select the list of Fix Version values from the child issues in the Epic's Fix Version
You do not indicate if the child values should replace any values in the Epic, add to them, or something else. You also do not indicate if the issues are all in the same Jira project
Assuming you want the values replaced and the issues are all in one project, you could first use Lookup Issues to gather the child issues. Then edit the Epic directly to set the values, likely with an iterator and advanced edit with JSON: https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/#Fix-Versions
Kind regards,Bill
Hi @Amir Shmulevich Welcome to the community!
To automatically update an Epic's Fix Versions based on its child issues' Fix Versions when the Epic transitions, you can set up a Jira Automation rule. Here's how you can achieve this:
Steps to Set Up the Automation Rule:
Go to Jira Automation:
In Jira, navigate to Project Settings > Automation (or Global Automation if you want this to apply to all projects).
Create a New Automation Rule:
Click on Create Rule.
Set the Trigger:
Select the Issue Transitioned trigger.
Configure it to trigger when the Epic transitions to the desired status (e.g., "Done" or any other transition you're interested in).
Add a Branch for Child Issues:
After the trigger, add a Branch rule/related issues action.
Choose For Epic’s stories (or other child issues). This ensures that the rule will act on all issues linked to the Epic.
Add Action to Copy Fix Versions:
After the branch, add a Lookup Issues action. In the JQL query, use the following query to fetch all child issues of the Epic:
"Epic Link" = {{issue.key}}
Next, add a Create Variable action. Define a variable like childFixVersions and use the following smart value to collect the Fix Versions from the child issues:
{{lookupIssues.Fix Versions.distinct}}
Update the Epic’s Fix Versions:
After the child issues are fetched, add a Edit Issue Fields action.
Set the Fix Versions field to the value of the childFixVersions variable you created:
{{childFixVersions}}
Save and publish the rule.
thanks. I followed your instructions and created the automation.
but when I sent the data in the {{childFixVersions}} I am getting the child issue keys and not the fix versions.
did I miss anything?
It sounds like the {{childFixVersions}} variable is capturing the child issue keys instead of the Fix Versions. This likely happened because lookupIssues by default returns the full set of issues, and if you're using the smart value incorrectly, it may be referencing the issue keys.
To fix this and properly extract the Fix Versions from the child issues, you can refine the smart value syntax to target the specific field (Fix Versions). Here's how you can adjust it:
In the Create Variable Action: The variable childFixVersions should reference the Fix Versions field of the child issues. Fix Versions is a multi-select field, so to capture it properly from all child issues, modify the smart value like this:
{{#lookupIssues}}{{Fix Versions.name}},{{/}}
This will iterate over each issue in lookupIssues and extract the Fix Versions by name.
If you want to remove any duplicates, you can apply the distinct function:
{{lookupIssues.Fix Versions.name.distinct}}
This will gather only the unique Fix Versions from all child issues.
when I changed the lookup value from "Epic Link" = {{issue.key}} to "Epic Link" = {{issue.parent.epic.summary}} - I started getting the fixVersion in my variable.
the value I see for the {{childFixVersions}} is "5, 6,5, 6,3, 4,"
but it is still not getting updated in the Epic fixVersions field. and the Epic fixVersions field is being deleted instead of updated.
Hi @Bill Sheboy , what you are describing is exactly what I am trying to accomplish.
I am looking to replace all fix versions values in Epic with the values from the children.
you answer regarding using the branch was correct - it doesn't work
I couldn't figure out how to accomplish this using lookup issues.
One challenge with a scenario like this is nested lists: the Fix Versions field is a list of zero-to-many values, for each issue. And there is a list of child issues for the parent Epic. Together that means there could be zero-to-many versions, including possible duplicates selected in the child issues.
But you want the distinct values to set the Epic's field. If the Lookup Issues result contains the child issues for the epic, the list of version names is this:
{{lookupIssues.fixVersions.name.join(",").replace("[","").replace("]","").split(",").trim().distinct}}
That works by merging the values within each issue's list, removing any nested, list syntax with square brackets, and then reducing the result to remove duplicates. With that you may create a dynamic JSON expression to set the values, as I noted earlier.
{ "fields" : { "fixVersions" : [ {{#lookupIssues.fixVersions.name.join(",").replace("[","").replace("]","").split(",").trim().distinct}} { "name": "{{.}}" } {{^last}}, {{/}} {{/}} ] }}
I recommend pausing to understand how that expression works before trying to use it in your rule.
UPDATED: I added a trim() call before the distinct one. This will remove leading / trailing spaces from the values, and help to reduce the duplication from the nested lists.
thanks @Bill Sheboy , this seems to do the trick.
the only thing I can't figure out now is how to remove space from the fixversion name that I am trying to add.
tried using the .replace(" ", "") in multiple locations - but it has no effect.
It looks like you're new here. Sign in or register to get started.