The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

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

TAGS
AUG Leaders

Atlassian Community Events