Automation - Add parent FixVersions to new ticket
Asked by anne_gerten:

Hello,

I created an automation that should add the parent ticket fixVersion to a newly created ticket.

This is my edit rule:

![jira fixversion automation.JPG](https://community.atlassian.com/t5/image/serverpage/image-id/343561i9486D44EF60B39EF/image-size/large?v=v2&px=999 "jira fixversion automation.JPG")

When creating a ticket, and running the automation, I get this error:

![jira fixversion automation 2.JPG](https://community.atlassian.com/t5/image/serverpage/image-id/343562iEE520E8B28B42B27/image-size/large?v=v2&px=999 "jira fixversion automation 2.JPG")

Any tips what I could do?

Thanks!


Answers:
author: Trudy Claspill
body: Hello [@anne_gerten](/t5/user/viewprofilepage/user-id/5365348)

You can do that without using Advanced Editing.

![Screenshot 2024-08-23 at 12.30.04?PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/343563i0D7357CD345C59B2/image-size/large?v=v2&px=999 "Screenshot 2024-08-23 at 12.30.04?PM.png")

comments: author: anne_gerten
body: That worked, thanks!!

If a parent has multiple fixVersions, is it possible to add only specific fixVersions to the children, like for example all parent fixVersions that start with Test?


author: Trudy Claspill
body: That would be a more complicated rule requiring you to figure out if there were Versions in the parent's Fix Version field that match your criteria, getting their full names, and then adding them to the child issue.

Adding them to the child issue would require Advanced Editing. An example of setting multiple values in the Fix Versions field can be found here:

<https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/#Fix-Versions>

I think I have worked it out:

I've added some Log actions to log information to the Audit Log for the rule execution. You can keep those or remove them.

![Screenshot 2024-08-23 at 1.27.33?PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/343573i2EB78F8221967CA3/image-dimensions/354x304?v=v2 "Screenshot 2024-08-23 at 1.27.33?PM.png")

![Screenshot 2024-08-23 at 1.28.42?PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/343574i76B92D68B927DCF5/image-dimensions/362x384?v=v2 "Screenshot 2024-08-23 at 1.28.42?PM.png")

1. Use a For Each Smart Value branch to iterate through the list of Fix Version values in the parent issue.

![Screenshot 2024-08-23 at 1.31.57?PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/343575iE1EF75F4BE96EC7F/image-size/large?v=v2&px=999 "Screenshot 2024-08-23 at 1.31.57?PM.png")

2. Check if the current value from the list starts with the relevant text.

![Screenshot 2024-08-23 at 1.32.38?PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/343577iDEF83212200A9E98/image-size/large?v=v2&px=999 "Screenshot 2024-08-23 at 1.32.38?PM.png")

3. Edit the issue to add that value to the Fix Versions field. In this case we have not changed to focus of the rule to any other issue (i.e. the parent) so the Edit action will operate against the issue that triggered the rule.

![Screenshot 2024-08-23 at 1.33.21?PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/343578i1F0F33D48ECA09CC/image-size/large?v=v2&px=999 "Screenshot 2024-08-23 at 1.33.21?PM.png")


author: anne_gerten
body: This worked great. Thanks so much!!


author: anne_gerten
body: Is it possible to do the same for when creating a new issue without parent first, and then when "manually" adding this new issue to a parent epic, to then run this rule as well to the newly added ticket to the epic?


author: Trudy Claspill
body: Yes, but the trigger would be different. You would use the Field Value Changed trigger to monitor the Parent field for changes.

And you need to consider which scenarios you want to handle:

1. Is this only when an issue that has no current parent Epic is added to an Epic?

2. Or do you want to handle a situation where an issue is moved from one Epic to another?

2.a. In that case do you want to clear the Fix versions from the child issue and start fresh with the new parent epic? Or just keep adding fix versions to the child issue?

3. What do you want to do, if anything, if an issue is removed from an Epic but not assigned to another Epic?


Tags: cloud

jira-cloud