I am using Assets to set my custom field "assignment group." How I plan on making this work is by leveraging Automation Rules to trigger once an issue is transitioned to a specific status.
An important fact to point out is that the Description field is templated to include text called CO AG:, where the name of the assignment group will appear. For example in the description it will say CO AG: Service Desk.
1st attempt
1. I had an "Edit Issue Field" Action which was written as follows, and got an error saying data was not an array.
{
"fields": { "customfield_16604": { "name": "{{issue.description.match("\#1st AG:\s+(.*)")}}" }
}}
2nd attempt
1. I added "Lookup Asset objects from AQL" action with the following query
Name = "{{issue.description.match("\#CO AG:\s+(.*)")}}"
2. Add Log Action
Lookup result: {{lookupObjects.Name}}
3. Add Edit Issue action to fix array issue
{
"fields": { "customfield_16604": [{ "key": "{{lookupObjects.Key}}" }]
}}
4. Result shows "Success" but the field is not being updated, and the log is showing no value either.
I've tried name and asset key and neither worked. If someone could help with this it would be immensely appreciated. Thank you!
For a question like this, context is important for the community to help. Please post the following:
Until we see those...
Have you tried writing the results of the match() functions to the audit log to confirm they return what you expected?
Have you checked if the Lookup Objects action found any results?
Kind regards,
Bill
The automation rule is triggered as follows and am expecting to update the custom asset field "Assignment Group" by first looking up the asset (image1) based on what is specified in the ticket (image2).
image1
image2
once identified the following edit issue action is meant to update the field with the asset object with the same name mentioned in the description. In this case an object named Service Desk exists.
log shows the rule ran successfully but the field still remains empty and I believe it is because the rule is unable to retrieve the correct object.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As you certain that is the log for the rule shown as the steps do not match? For example, the log shows a write to the audit log but that action is not in the rule shown.
The Issue Created trigger can fire so quickly that the issue data may not yet be available to the rule, causing errors and weird symptoms. I recommend adding the Re-fetch Issue immediately after that trigger to slow the rule down a bit and reloading the data before it proceeds.
Have you checked if the Lookup Objects action found any results?
Have you consider consolidating those different Edit Issue actions to prevent collisions and improve rule performance?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bill,
I've tweaked the automation rule including your suggestion to add in a re-fetch action at the beginning. Here's what I am seeing so far...
I first wanted to confirm the rule was recognizing the text that is being inserted in the description field. It is grabbing that. This is important since the AQL will need that data for the query.(in red)
When I manually insert the query in Assets, it returns the object I am trying to use to populate the custom field.
The log in the blue box however is not returning any values and consequently the final edit issue field doesn't populate since no value is found.
I tried retrieving the key but no luck either.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When using lookup actions like Lookup Assets, I recommend adding a write to the audit log (or a condition) to confirm it returns results:
records returned: {{lookupObjects.size}}
If hardcoding the value for the AQL works and the value from the match() of the Description does not, that indicates some possibilities we can test, all by using a Created Variable action:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.