Forums

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

Asset Scriptrunner Automation: Issue with Non-Text Fields

Stephen.Carlsten
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 7, 2024

Hello Everyone, 

I have been trying to enhance our service management project with automation rules for our asset schema. I seem to have a hard time finding information on how to format the JSON escaping functions for fields that are not simple text. I also encounter failures when trying to update assets with certain field types. 

For example, 

I have a rule that should trigger when issues transition, search for an issue type, and update an associated assets object tethered to the issue with an assets object field. 


{
"objectKey": {{issue.Affected Asset.key.asJsonString}},
"Environment": "{{issue.fields.Environment.value}}"
}

Where "Environment" is a select-list text field for the issue and a select-list text attribute for the asset object. 

The rule succeeds on the automation page, but the asset object attribute is not updated. 


SR_update.png

SR_update2.png

 

Rules that use only "manual" text fields with alphanumeric characters have no trouble. 

Is there a more detailed list of JSON functions compatible with the Scriptrunner feature? And while here, any thoughts how to fix this failure?

Any help is highly appreciated!

Kind regards, 

Stephen

1 answer

0 votes
Kristian Walker _Adaptavist_
Community Champion
November 7, 2024

Hi Stephen,

I cannot advise you on how to do this with Automation Rules, but I can advise you that if you use the ScriptRunner Plugin, the HAPI (Helpful API) feature will allow you to set Asset field values using the helper functions it provides.

The documentation for this can be seen on the page here and may provide a way to set the field values you need.

Regards,

Kristian

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events