Lookup Asset (Insight) Object
This feature is currently in Beta. If you have any feedback for us, please add a comment to SRJIRA-6839.
We’ve provided an easy way to look up/retrieve Insight/Asset objects in Automation for Jira. You can use the Lookup Asset (Insight) object action to retrieve an Assets object from any object schema. Once you have added the Lookup Asset (Insight) object action, you can then reference the attributes of the Assets object in another action using the {{lookupAsset}}
smart value.
Using {{lookupAsset}}
you can retrieve the attribute values, in addition to other important object values. For example:
{{lookupAsset.objectKey}}
{{lookupAsset.id}}
{{lookupAsset.attributes.Name}}
{{lookupAsset.objectType.name}}
Obtaining attributes
If you wish to discover more attributes, you can add Log action to a rule that contains the Lookup Asset (Insight) object action—{{lookupAsset}}
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, you can improve automated comments to include Assets object values to give users a more personalized experience.
Example: Personalize comments using asset object information
In the following example, we want users to receive a personalized message, as a comment, about their computer when they create an issue.
If you wish to use this example, you must make sure an Assets custom field is configured with the name Computer
, or equivalent.
- In Automation for Jira, select Create rule.
- Select Issue created as the trigger.
- Select Save.
- Select New action.
Scroll to Miscellaneous and select Lookup Asset (Insight) object.
Enter a smart value expression to get the Asset key. In this example, we enter
{{issue.Computer.key}}
. If you're using your own Assets custom field, replaceComputer
with the name of your Assets custom field.- Select Save.
- Select New action.
- Under Issue actions, select Comment on issue.
Enter a comment for this issue and use the
{{lookupAsset}}
smart value to reference a value within theComputer
Asset object. In this example, we want to create a comment that includes the serial number and model for their computer, so we enter the following:We're sorry to hear you're having issues with your {{lookupAsset.attributes.Model}} computer (serial number {{lookupAsset.attributes.Serial Number}}). We'll get back to you as soon as possible.
- Optional: Under More options, check the Share with customer option so that the customer will receive an email with the comment.
- Select Save.
Name the automation and select Turn it on. In this example we name the automation
Computer Issue Rule
.You can now test this rule by creating an issue and selecting the
Computer
Assets custom field.If you wish, you can improve your rule further by adding conditions. For example, you may want to add a condition to the rule so it does not execute if the
Computer
Assets custom field has no value.