Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to obtain newly created Assets object in the automation rule

When you create a new issue in the automation rule, there's smart value {{createdIssue}}, which can be used further in the rule. But when you create Assets object, there's no smart value for a newly created object. What can be done? 


 

Let's assume you've got service management project prepared for your HR department. One of the requests is called Employee onboarding and the form contains these fields:

  • What is the employee name? (Summary)
  • What date does the employee start? (Start date)
  • What is the employee e-mail? (Employee e-mail)
  • Where is the employee located? (Employee location)
  • ...

jsm_form.png

After the form is submitted, your HR department starts to work on different things for the newcomer.

jsm_issue_detail.png

As a one of the steps (for example after the issue is resolved, i.e. transitioned to Done) you want to add this employee to Assets, where you have database of your employees (which means you have created appropriate object scheme called HR and object type called Employee in it).

assets_object_scheme.png

Let's create the automation rule.

First step will be to create an Employee object - for this Create object action can be used like this (trigger issue data are used):

automation_rule_create_object.png

Now what we would like to do is to store the newly created object to the issue, so that we have all issues connected to the Employee object visible in the Linked issues section in the object's detail. For this we've prepared custom field Employee with simple configuration:

custom_field_employee_configuration.png


Because there's no smart value for a newly created object, we use Lookup objects action - we search for a newly created object in the database. If the object has some unique value (in our case e-mail), the result will be only one. So, in our situation we will use query:


objectType = Employee AND "E-mail" = {{triggerIssue.Employee e-mail}}

automation_rule_lookup_objects.png

The last step is to store the found Assets object in the custom field:

automation_rule_edit_issue.png

jsm_issue_detail_with_object.png

assets_object.png


Summary

If the object, which you have created in the automation rule, is somehow unique (one attribute or combination of more attributes), you can search for this object using Lookup objects action and use the smart value {{lookupObjects}} from the result.

2 comments

Tomislav Tobijas
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 16, 2023

Cool article 🙂 Thanks for sharing!

David Foote September 11, 2023

This solved a problem I was having with creating and immediately linking an Asset to a card - thanks for sharing!

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events