I'm using Asset Automations with Groovy Scripts as described here:Assets - Update attribute value from a referenced object | Jira and Jira Service Management | Atlassian SupportHow can I empty fields with Integer values.Also: Is there a way to use newer methods, since some of the used methods are deprecated?This throws an Exception...Kind regards.Toby
Hi @tobias schachner
I’ve worked with Asset Automations and Groovy scripts in JSM, and yes, the documentation examples often use older (sometimes deprecated) methods, which can be a bit frustrating.
To clear the integer field, you can use:object.setAttributeValue("Your Integer Attribute", null)
Just make sure the field is not required, otherwise this will throw a validation error.
About the deprecated functions, Atlassian has started encouraging use of newer, more structured methods via the Assets Java API, especially in Forge or ScriptRunner integrations, but in Asset Automations you're still limited to the older Groovy-based scripting environment.
object.setAttributeValue(attributeName, value)
Please remember to vote and accept this answer in case it helps you resolve your query.
Regards,Eugenio
It looks like you're new here. Sign in or register to get started.