Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Update Asset Object using ScriptRunner in an Automation Rule using Json

Crystal Rouse April 17, 2024

We are trying to update an asset object in an automation rule by using "

Update Asset with ScriptRuner

The Json works if there is data being passed, but fails for nulls.  We tried the following:


{
"objectKey": {{issue.Key.Key.asJsonString}},
"if": {issue.customfield_1.asJsonString.length!=0}
{
"then": {"Description": {{issue.customfield_1.asJsonString}}}
},
"if": {issue.customfield_2.asJsonString.length!=0}
{
"then": {"FieldName": {{issue.customfield_2.asJsonString}}}
}
}


I know that we need to check for nulls, but can't get the syntax right.  

If there is any help or documentation, it would be greatly appreciated!

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events