Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do I copy a single choice fields value to a multi choice field

Thorsten Witt November 5, 2021

Using project automatisation I would like to copy the value of a custom single-choice field (cf_11003) to another custom field. This custom field is of the type multi-choice (cf_11600) and has the same values as cf_11003.

I tried using:

{
"fields": {
"Kunden-Projekt": {
"value": "{{issue.parent.fields.customfield_11600.value.asJsonStringArray}}"
}
}
}

With this code I get the following error:

(data was not an array (Kunden-Projekt)) 

 

Any advice on how to solve this issue?

1 answer

0 votes
Thomas Deiler
Community Champion
November 5, 2021

Dear @Thorsten Witt ,

I have no clue about Automation, but probably this helps:

Selecting a single option for a multi select field would look like this in pure JSON:

{
"fields": {
"customfield_11600": [
{
"value": "Project X"
}
]
}
}

I guess that 

{{issue.parent.fields.customfield_11600.value.asJsonStringArray}}

will return

[
{
"value": "Project X"
},
{
"value": Project Y"
}
]

But when you substitute this in your upper example, it can't work.

Can you output

{{issue.parent.fields.customfield_11600.value.asJsonStringArray}}

in a log file for debugging? And from the logic, don't you need to use this instead?

{{issue.parent.fields.customfield_11003.value.asJsonStringArray}}

So long

Thomas

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events