JSON format in automation

agente January 23, 2024

Hi,
I am trying to copy the users from a multi user piker field to another field of the same type, but the deactivated users give me an error. I tryed to solve it with the following JSON code within the automation:


      {
           "update": {
               "customfield_10701": [
                    {{#issue.epic.customfield_10800}}
                         {{#if(active)}}
                               {"add": {"name": "{{name}}"}}{{^last}},{{/}}
                         {{/}}
                    {{/}}
               ]
          }
    }

 

Can you tell me where the error is?

Regards,
Juan Fran.

1 answer

1 accepted

1 vote
Answer accepted
Bill Sheboy
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.
January 23, 2024

Hi @agente 

For a dynamic JSON generation error, I recommend writing that entire expression to the audit log, as that will show where the error is in the JSON.

I suspect the problem is the conditional comma delimiter with {{^last}}; it is inside of the active conditional, and so may not be resolving as expected.

Kind regards,
Bill

Suggest an answer

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

Atlassian Community Events