Good Day together,
I'm facing a bit of a challenge with Jira Automation and I'm hoping someone can guide me in the right direction. Here's my desired result in a Jira Automation Set Block:
{
"fields": {
"customfield_12029": [{"value": "Freiburg"}, {"value": "Wiesbaden"}]
}
}However, the issue I'm encountering is that I only have the values "Freiburg" and "Wiesbaden" within the issue description as "Freiburg,Wiesbaden". I'm unsure about how to achieve the desired outcome using automation.
The complexity arises from the fact that the number of locations is dynamic, and it seems like I might need some sort of "for loop" to create the objects for the array.
While handling a single value is manageable, dealing with two values in a single string has proven to be quite challenging.
Splitting the string seems like an option, but due to the variable count of values, I can't implement this approach effectively. Additionally, setting 10 values, to cover ten possible values of which n could be null values, is not feasible because the function fails when attempting to set null values in a multi-select field.
I'd greatly appreciate any insights or ideas on how I could approach this problem and achieve the desired outcome using Jira Automation. Thanks in advance for your assistance!
I could use scriptrunner but my attempts to do so where not successful so far.
Best regards,
Björn Trier