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:
After the form is submitted, your HR department starts to work on different things for the newcomer.
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).
First step will be to create an Employee object - for this Create object action can be used like this (trigger issue data are used):
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:
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}}
The last step is to store the found Assets object in the custom field:
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.
Hana Kučerová
Atlassian Consultant
BiQ Group
Prague, Czech Republic
490 accepted answers
4 comments