Hi, I'm having an issue with an AQL query in my automation where I have the following setup.
I have an asset of object type "Computer" that has a property which is a list of "Component" assets used in that computer, and both the "Component" and "Computer" assets has a quantity of how much we have in stock of that object.
My issue is that I defined a SMART variable {{quantity}} (using a Create variable action) and in my if condition referencing the computer object, I am trying to have it trigger if any of the components used are under X stock. "object HAVING outboundReferences(Quantity < {{quantity}})" is what I currently have inside an AQL condition if statement, and it works if I replace {{quantity}} with a predefined number. However, in my case scenario, I need this number to be dynamically set, and with the query above, it fails to ever return true.
I was wondering if anyone might have any insight into why this might not be working? Much appreciated!
Hi @William Qi,
Welcome to Atlassian Community!
My guess is that {{quantity}} is empty and that is why your automation is not working.
How do you set {{quantity}}? I would add a log action after you set it to make sure that it has a value.
Hi @Mikael Sandberg! Thanks for the quick response!
I have set {{quantity}} through a Create Variable action. I have added a Log action right after to log {{quantity}} and it reports back 101.0 so I'm not so sure that quantity is empty since the output is what I had entered. (101)
I have attached the workflow if it might be of help. (The first if condition is not triggered, but a latter one not shown)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Oops, I just realized that in the photo above I had included a $, but even without that it still has the same issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Okay, so I think the .0 in the smart value is the issue. The AQL is expecting an integer, not a float. And that is why it works when you replace the smart value with a number in your tests.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Oh shoot, thank you so much! I didn't realize that little bit mattered haha.
I appreciate the help! I've been racking my brain at this for the past few hours.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Welcome to the community. Can you provide further clarification on your ask? Are you asking when the attribute of an object is updated in Assets, then you want your JSM automation rule to be triggered? If so, how is the attribute ties into your JSM issues + what is your automation rule's triggering event?
Here is the SmartValue reference page for Assets objects - https://support.atlassian.com/cloud-automation/docs/jira-smart-values-insight/
Please advise, so we can further to assist you.
Best, Joseph Chung Yin
Jira/JSM Functional Lead, Global Technology Applications Team
Viasat Inc.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Joseph Chung Yin!
Thanks for the welcome! I am asking as to why the AQL if statement fails to be triggered.
For example, my component asset (which is the outbound reference) has a quantity field with the value of 4, but even if my smart value {{quantity}} is assigned the value 5, the AQL query I have mentioned fails to ever return true.
I have attached my workflow below in response to Mikael if it is of any help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.