Asset Object Updated Trigger
You can use the Asset Object updated with ScriptRunner trigger to create a rule that runs whenever an Assets object is updated. You can also use the associated {{updatedObject}}smart value to apply conditions to the rule and input the updated object's information elsewhere, for example, into an email or a comment (see step 14 in the example below for a working example of how to use this smart value).
There are many things you can do with this trigger. For example, you could use the Send email action and ensure an email is sent to a specific user every time an object is updated.
If you want to trigger this rule conditionally, use the Advanced compare condition with the {{updatedObject}} smart value, and be careful not to add trailing spaces. Using {{updatedObject}} you can retrieve the attribute values, in addition to other important object values. For example:
{{updatedObject.objectKey}}
{{updatedObject.id}}
{{updatedObject.attributes.Name}}
{{updatedObject.objectType.name}}If you wish to discover more attributes, you can add Log action to a rule that contains the Asset Object updated with ScriptRunner trigger— {{updatedObject}} must be added as the value in the Log action. Once the rule has run, you can check the audit log and it will display available attributes for you to use.
Retrieving object attributes using smart values is helpful in many contexts. For example, if you only want an email sent when the object updated is a specific object type, you can use {{updatedObject.objectType.name}}, and enter the object type you want to match.
Scope
The Asset Object updated with ScriptRunner trigger is a Global trigger, which means a rule with this trigger is applied to all projects and can only be managed by Jira Administrators.
Example: Send an email when an object is updated
In the following example, we want an email to be sent to a specific user if any License object has been updated. We want the user to be notified of the change so they can check whether it is valid and decide if they want to take action.