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 Support
How 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
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)
for now as it's still supported in the automation engine.Please remember to vote and accept this answer in case it helps you resolve your query.
Regards,
Eugenio
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.