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

Create Asset with ScriptRunner - Custom Field

Connie H Johnston March 15, 2024

We trying to use an automation rule to create an Asset object using the Create Asset with ScriptRunner extension.  We were able to create an object using the format example of {{issue.summary.asJsonString}}.

{
    "objectTypeId": 217,
    "DESIO": {{issue.summary.asJsonString}}
}

However, We need to assign the "DESIO" attribute to a Custom Field named "DESIO Number", but are having trouble with the syntax as seen in the screenshot. We also tried using:  

{
"objectTypeId": 217,
"DESIO": {{issue.customfield_12016.asJsonString}}
}

But that doesn't work either. Does anyone have the format we need to use for Custom Fields?  The Asset object using the Create Asset extension requires a JSON format. I'm just not sure how to pass a Custom Field in that format. 
CreateAsset.jpg

2 answers

1 accepted

0 votes
Answer accepted
Connie H Johnston March 18, 2024

We kept testing and were able to get the automation rule to work correctly!! The Json format of

 {
"objectTypeId": 217,
"DESIO": {{issue.customfield_12016.asJsonString}}
}

is correct! But since the custom field was just created in the prior step of the automation rule, I had to add a step to "Re-fetch the Issue data" CreateAsset#2.jpg

0 votes
Connie H Johnston March 15, 2024

CreateAssetAuditlog.jpg

Here's the audit log

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events