Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to copy multiple fix versions to linked task

Derek Owens May 23, 2023

I'm trying to copy fix version(s) from issues in project A to linked tasks in project B.

My automation works fine when there is only one fix version, but when I have more than one, Jira sees the comma delimited string of fix versions as a single fix version and reports an error.

What do I need to change so that each version returned by {{lookupIssues.fixVersion.name}} is seen as an individual fix version when populating the linked task?

What my rule looks like...Lookup Issues.png Create Variable.png
Edit Issue.png
What the audit log is showing...
Audit Log 2.png

2 answers

1 vote
YY Brother
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 30, 2023

Use a create variable action to store the fix version:

  • Variable name: FixVersion
  • Smart value: { "fields": { "fixVersions": [ {{#issue.fixVersions}} {"name": "{{name}}"} {{^last}}, {{/}} {{/}} ] } }

 

For Linked issue branch:

  • Edit issue fields - Additional fields: {{FixVersion}}
Derek Owens May 31, 2023 edited

Thanks for the suggestion, @YY Brother !

Except for the differently named variables, is this what you were suggesting I do?

Create Variable 4.png Additional Fields.png
When I follow these steps, I get the following error in the audit log:

Audit Log 4.png

If I use "set": the automation runs successfully but the Fix versions field still is not populated after the automation runs.

{
"fields": {
"fixVersions": [{"set:" {"name": "{{linkedFixVersions}}"} }]
}
}

 I also tried setting Fix versions equal to {{linkedFixVersions}} like so, but this didn't work either.

Edit Issue with Smart Value.png

0 votes
Christopher Maxwell
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 24, 2023

Hi @Derek Owens ,

While I don't have experience with what you are asking about, I recommend you review this Atlassian Community post:

https://community.atlassian.com/t5/Jira-Software-questions/Automation-Errors-out-when-copying-multiple-fixversions-from-a/qaq-p/2240179

We try not to link out when answering a question, but that post is about setting more than one fix version either via a list iterator, or using JSON functions.

The proposed solution on that ticket worked... If something similar works for you it would be great if you would post an update here!

 

-- Christopher

Derek Owens May 24, 2023

Thanks for sharing tihs, @Christopher Maxwell! This is exactly what I'm trying to do!

I followed the same actions that @Jeffrey Bistrong showed in his screenshots but I'm still getting an error in the audit log.Create Variable 3.png Edit Issue 3.png Audit Log 3.png

Christopher Maxwell
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 26, 2023

Hi @Derek Owens , I'll start off by saying - good job on the screenshots/documentation. Troubleshooting isn't always easy, but it's easier with more, rather than less, info!

Are you able to manually assign those fix versions to ticket PLTRR-2615?

Derek Owens May 30, 2023

Yes, @Christopher Maxwell but I'm lazy and wanted to automate it since it won't just be copied to this task but also this task's sub-tasks.

I'm pretty certain this isn't the most elegant way to assign FV, but I was able to pass the first FV in the list index to the subtask with this JSON.

{
"fields": {
     "fixVersions": [{"name": "{{linkedFixVersions.replaceAll("[\[|\]|\s]","").split(",").get(0)}}" }]
}
}

 If there's a way to grab the total number of indexes in the FV list and loop through each of these with the code above, then I think I'd be able to grab all of them.

Suggest an answer

Log in or Sign up to answer