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.

4 comments

Tomislav Tobijas _Koios_
Atlassian Partner
May 16, 2023

Cool article 🙂 Thanks for sharing!

David Foote
Contributor
September 11, 2023

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

Ingrid Heitmann October 23, 2024

Hi @Hana Kučerová and thanks for this article. Could you please expand/explain how I can get "hold of" key for a newly created object, using trigger Object created, when these objects are not linked to a ticket?

 

My challenge is within this scope:

Object type Organisation - objects created through CSV import.

Object type Details - is stored in another object schema, with an attribute being Organisation

 

  • Organisation is kept up to date through CSV imports. When importing, "decommisioned" Organisations are a archived and new ones created. This import works fine. Sometimes 1 new object is created, other times more than 1
  • I now want to expand the setup, so that when an Organisation object is created, another object in another object type to be created and linked to this newly created
  • Each Organisation object is unique, but during the automation run, I do not know what the unique object attributes are. In other words, I do not know what unique characteristics I can link the lookup to

Do you have any idea as to what my lookup query can look like? 

Hana Kučerová
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 25, 2024

Hi @Ingrid Heitmann ,

I believe you can create an automation rule like this:

  1. When: Object created (from your object scheme with Organisation object type)
  2. If: Object matches AQL: objectType = "Organisation"
  3. Then: Create object ....

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events