Asset Object Created Trigger
You can use the Asset Object created with ScriptRunner trigger to create a rule that runs whenever an Assets object is created. You can also use the associated {{createdObject}}smart value to apply conditions to the rule and input the created object's information elsewhere, for example, into an email or a comment (see step 15 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 Create Issue action to create a Task every time a new object is created.
If you want to trigger this rule conditionally, use the Advanced compare condition with the {{createdObject}} smart value, and be careful not to add trailing spaces. Using {{createdObject}} you can retrieve the attribute values, in addition to other important object values. For example:
{{createdObject.objectKey}}
{{createdObject.id}}
{{createdObject.attributes.Name}}
{{createdObject.objectType.name}}If you wish to discover more attributes, you can add Log action to a rule that contains the Asset Object created with ScriptRunner trigger— {{createdObject}} 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 want to create a Task with the same name as the created object, you can use {{createdObject.attributes.Name}}.
Scope
The Asset Object created 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: Create a Task when a new License object is created
In the following example, we want a new Task to be created when a new License object is created. In this example, the purpose of the Task is to assign the new License to a user.