*Note - this blog applies to Jira Cloud.
For example, say you have customers who need to stay within regulatory compliance. They need to create Jira requests for teams to inspect Assets regularly. When you go to create an automation for this you realize that only 100 records are returned/created using the Lookup objects action. Yikes, there are more than 100 Assets that need to be inspected!
Again we ask! Is Jira Automation for Assets Limited? Well...yes and no....
Atlassian currently has this Suggestion request - https://jira.atlassian.com/browse/JSDCLOUD-11414
“At this time the Lookup objects action in the Automation rules is limited to 100 objects as covered in this article, but for environments with many assets, it would be relevant to have a larger limit of objects that could be queried at the same time.”
So…how do we get around this limitation? Waiting for an update on the Suggestion request is not an option!
We need to use the GET Send web request function to send an API request to Assets, to get the Object Key.
For reference here is the Asset API documentation - https://developer.atlassian.com/cloud/assets/rest/api-group-aql/
First, we need to get the Asset Workspace ID.
The Workspace ID is used in the API query below. Within the URL string is our query to determine which objects should be fetched, NOTE - URL encoding. Also, this example has a limit of 1000 records i.e. resultPerPage=1000.
JUST AN EXAMPLE - https://api.atlassian.com/jsm/assets/workspace/WORKSPLACEID/v1/aql/objects?resultPerPage=1000&qlQuery=objectType%20%3D%20%22Pin%20Pads%22%20AND%20%22status%22%20IN%20%28%22In%20Use%22%2C%22Inventory%22%29
This query part of the URL is the equivalent to the Asset AQL - objectType = "Pin Pads" AND "Status" IN ("In Use", "Inventory")
Next, we use Advanced branching. Note the Variable name below as it’s processing the branch variables individually. Also, custom formatting was needed to "split" the "objectKey" results response from the API.
Now we use the Lookup objects action within the branch with the previous Variable, but currently it's not limited to 100 records! 100 percent working NOT limited to 100 objects!
In our use case, we used the output to create Jira tickets on a schedule to inspect Asset items for regulatory compliance. Smart Values were used to fill out needed information for each request from the corresponding Asset.
This is just one example of what can be done with this method. There are many other scenarios in which this could be useful. I hope you found this helpful!
**A special thanks to Andras and company from Atlassian Premium Support who went out of his way to help with this request when we were in a pinch**