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

Automation loops with Assets (Objects)

david.leonhardt
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 10, 2023

I am trying to build an automation that will once every 2 weeks create a JSM issue. This issue will be populated with a list of objects that are 'due for calibration.'

I have been having a hard time figuring out how to utilize the AQL so that it will actually let me set the asset object field on issue creation. 

My current implementation uses a FOR AQL loop to fetch a list of objects matching my AQL criteria (due for calibration in the next 60 days) and then my action is to create an issue and set the Internal Assets (custom object field) to the exact same AQL. 

The result is I end up with as many issues created as objects are found, and each issue is identical with all assets linked in the issue. 

I am trying to create only 1 issue with all matching assets (due for calibration). I have not been able to figure out how to break the loop, or use a condition and action, rather than the 'for each AQL loop'.

asset calibration auto ticket.png

1 answer

1 accepted

1 vote
Answer accepted
david.leonhardt
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 19, 2023

I figured it out finally. The problem is that when I was setting the value of the assets field I was not following the proper syntax. I needed to structure it as a proper AQL search with the smart values injected. Here was the magic line that fixed it for me:

"Asset Attribute" = ({{object.Asset Attribute}})

Asset attribute being the name of my attribute I am matching. You can test your AQL query in the filter function in Assets. (Don't get confused by the search at the top, you literally need to click on a tiny filter button)

The smart value {{object}} matches each object in your for each loop.

Markus Pöhler November 11, 2023

Hi David,

I am also tryaing to start a loop through Asset objects. But I can't figure out how. I found the "For AQL" object in your post. But I can't find this in my automation config dialogues.

Can you please point out where this can be found?

Thanks , MArkus 

Sam Iva
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 30, 2023

@Markus Pöhler For AQL is only allowed within Global Automations , not Project Automations. Maybe check that first.

Edward Moxley January 20, 2024

I'm looking in Global Automations and still don't see the "For AQL". Does that require specific advanced permissions?

Rajvir Kaur
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 19, 2024

Hey @Edward Moxley ,
were you able to find "for AQL"?
i want to loop into the {{lookupobjects}} and hit web request for each assets. 
not able to do it . can you please help me

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events