I have a lookup table linked to a multi-select custom field.
I want to combine all the matching values from the lookup table that were selected into a single field.
I have added a branch and used {{lookuptable.get()}} to log the different values. This adds them to the log exactly how I want them in my field. However when I try to populate the field I only get the last value.
This works and you can see it logs them separated by commas. When I add an edit issue field step and populate the field the same way it doesn't work.
Hi @Ryan Buffa
Short answer: please try a method like dynamic list searching to solve this as branching and list iteration will not work. If you want to try this, please continue reading this response.
There are two ways that do not work to solve your scenario:
One possible way to solve this is to "flatten" the table into a delimited string of key / value pairs, using the entries function for lookup tables, create a dynamic regular expression to find the selections from the field, use inline iteration and the match() function with that expression, and then parse out the values found using text functions.
For example, let's assume your field is customfield_12345 and the lookup table name is named varValueReplacementTable. I recommend writing each variable to the audit log to understand how this rule works.
{{#varValueReplacementTable.entries}}{{key}}:{{value}}{{^last}}~~{{/}}{{/}}
({{#issue.customfield_12345}{{value}}:.*{{^last}}|{{/}}{{/}})
{{varFlatTable.split("~~").match(varSearchExpression).substringAfter(":").join(", ")}}
That expression works by splitting the flattened table back into rows, searching for a match, and then extracting the values found, finally joining them together as a comma-separated values list.
Please note well some assumptions...
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.