Hi,
Is there a way to convert a list of values to JSON?
I have a multi-select custom field multi_field with these options:
- ABC 123
- ABC 456
- DEF 123
- DEF 456
- GHI 123
- GHI 456
In a group of issues, options 2+4+5 were chosen, for instance. I want to clone the issues using an automation rule, but to change the chosen options to be all with the suffix 123. meaning:
2: ABC 456 => ABC 123
4: DEF 456 => DEF 123
5: no change
I thought doing so with this smartvalue:
{
"fields": {
"multi_field": "{{issue.fields.multi_field.replace("456","123")}}"
}
} but this phrase returns a string ABC 123, DEF 123, GHI 123
while I need to retrieve a JSON object (according to the documentation) like:
[{"value": "ABC 123"}, {"value": "DEF 123"}, {"value": "GHI 123"}]
I tried using the asJsonStringArray & asJsonObjectArray functions but it didn't work for me.
Does someone have an idea how to solve this problem, maybe in a different way completely?
Thanks in advance