Jira JSON with If Else for Assets Fields in Automation (returns invalid if field is empty)

Rebecca
Contributor
November 27, 2023

Hi,

my JSON returns invalid as soon as one or both Assets custom fields are empty when I run an automation that clones issues from one project to another.

 

This is what my JSON looks like, when both fields contain objects - it is valid:

{
"fields": {
"customfield_13400": {{issue.customfield_13400.asJsonObjectArray("key")}},
"customfield_11501": {{issue.customfield_11501.asJsonObjectArray("key")}}
},

However, if one or both fields are empty - it returns invalid and the automation fails.

How can I use an "If-else-condition" for the two custom fields in JSON?

... something like this: if custom field is empty - do nothing, else copy the value from the custom field

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events