Copying one custom field value over to the Fix version field value options

Alex Degregori February 3, 2021

For some additional context, I am syncing a custom multi-select field over to the Fix version field via automation.  In order for this to work (which it does), the values in the custom dropdown and the Fix version field need to be the same.

So to accomplish this I have set up an automation to edit the Fix version field values anytime the custom dropdown is updated. However, I am running into issues when multiple values are selected. My current setup, which doesn't work for multiple values,  is this: Screen Shot 2021-02-03 at 10.42.00 AM.png

This works as expected when a single value is selected in the "Custom Sprint" multi-select field. However, when two or more fields are selected, I get the following issue: 

Screen Shot 2021-02-03 at 10.44.11 AM.png

Instead of creating two separate versions, it creates one with the two field names together. This makes sense because of the value, {{issue.customefield_10050}}, I have in the automation rule. I can't seem to figure out how to separate the multiple fields to represent different values. I am thinking it may have to use some of the #changelog functionality. Any ideas or suggestions would be awesome! Thanks in advance. 

1 answer

1 accepted

3 votes
Answer accepted
Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 3, 2021

Oh. Tricky.

So, unfortunately Automation does not have a way to iterate over multiple values from a field.

https://codebarrel.atlassian.net/browse/AUT-81

All I can think of is an ugly brute force of creating versions for each possible value.

So attempt to create a version for the first element:

{{issue.customfield_10050.get(0)}}

And then for the second element:

{{issue.customfield_10050.get(1)}}

And so on...

{{issue.customfield_10050.get(2)}}

The problem, of course, is that you have to do this for the maximum number of options in your field.

Also, I was a little worried about what might happen if you try to set a version to an empty value. But Automation appears to do the right thing, and continues trucking along:

Screen Shot 2021-02-03 at 11.50.21 AM.png

Your log files will show an error, but I don't think it's severe enough to generate a notification.

Alex Degregori February 3, 2021

Wow Darryl, you are a lifesaver. Thanks again for the solution and easy to follow explanation. 

This works wonderfully! The errors should be fine within this automation rule. 

Like Darryl Lee likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events