I have a custom field of type Select List (multiple choices) - this is called Program Impact. Whenever this is updated, I want to update a short text field (called PI Abbr) with a string which is a concatenation of abbreviations for the multiple choices in the Program Impact field.
e.g. If Program Impact is updated and the choices
"Long textA" and "Long textC" are seldected, the resultant "PI Abbr" field contains
"CodeN, CodeZ". This is based on a lookup table in the rule shown below
| LongtextA |
CodeN |
| LongtextB |
CodeY |
| LongtextC |
CodeZ |
| LongtextD |
CodeA |
The rule is a single issue rule so the branch executes inline, so I have created a variable
varAbbrStr outside of the rule and was hoping to update that in the branch but can't work out how to concatenate those values. Alternatively I would concatenate the new abbreviation in each branch to the {{issue.PI Abbr}} field value but I think that would mean refetching every loop which will impact performance. In the rule, when the value changes for the Program Impact rule, I clear issues 'PI Abbr' field and create an empty variable varAbbrStr.. In the branch, I iterate though each value set in {{issue.Programme Impact}}, lok up its abbreviated equivalent in the lookup table and attempt to build a concatenation of each of the abbreviations lookup that I can use to finally set the "PI Abbr" field.
I have a workaround which is creating PI Abbr also as a multi-select and I could just set that each time arounf the loop. I prefer not to do that because then changes to the abbreviations means maintenance in two places, Jira custom field and the automation script
