JSON format errors in automation for jira server (Additional fields in Edit issue action)

YogeshKR
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 6, 2023

Hello Team, 

Is it possible to add loop inside JSON format? 
I have a field called "Checklist" and would like to copy the checklist value to another checklist using Automation. 

Below is the JSON format for single item addition,(this is working fine)
{
"update": {
"<source checklist>": [
{
"add": [
{
"name": "{{issue.<destination checklist>}}"
}
]
}
]
}
}

But if I want to add multiple items using below loop inside the Json which is not getting as expected. 
{{#issue.<destination checklist>}}
{{name}}
{{/}}

The below part should run as a loop, 
{
"name": "{{issue.<destination checklist>}}"
}



I used my Json as below format with no luck,
{
"update": {
"<source checklist>": [
{
"add": [
{{#issue.<destination checklist>}}
{
"name": "{{name}}"
}
{{/}}
]
}
]
}
}

Any help is appreciated.
Thanks in Advance ! 

1 answer

0 votes
Maxime Lefebvre _Okapya_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 18, 2023

Hi Yogesh,

Please take a look at the Automation for Jira documentation of our Checklist App here.

It should help you understand how to format the JSON properly for it to work!

Kind regards,
Maxime

Suggest an answer

Log in or Sign up to answer