Hi all,
I am trying to retrieve a list of all objects associated with an employee through AQL.
Employee is an object in my object schema which has multiple properties such as Name and User (object).
Statement below works and retrieves all the objects
object HAVING outboundReferences(objectType = "Employees" and Name = "John Doe")
I have tried several options to make this generic but none of them seem to work
object HAVING outboundReferences(objectType = "Employees" and Name = ${reporter.displayName})
object HAVING outboundReferences(objectType = "Employees" and User = currentReporter())
What am I doing wrong? Any suggestions?
Thank you!
Welcome to the community.
With AQL you are referencing Assets in a scheme, this relates to the information in the scheme.
Within in AQL you can't use JQL (If I remember correct).
There are options to use user references in JQL, but the object used in AQL needs to have a attribute in the object of the type user.
See also AQL documentation
Hi Marc,
As you can see I have an attribute of type user in my schema but when I use currentReporter(), which can be used in AQL the query still doesn't return any objects.
Regards,
Hielko
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What is the value set to the attribute in the object?
To use current user, you have to specified in the object as the user.
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.
I get this, but is there one account mentioned, is this yours or another account.
This function will only work when an issue is selected, and refers to the reporter that appears in the current issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The use case is "Offboarding employee". When an issue is created where request type is "Offboard employee" I want to create tickets for HR, IT etc in order to revoke access to IT systems, return assets such as laptops.
I am trying to get it working by referencing the Reporter of the issue but that somehow doesn't work.
I also tried to ad a custom field Employee and tried to reference that field through $object HAVING outboundReferences(objectType = "Employees" and Name = ${customField_10211.name})
Does this make sense?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think you need to get Automation in the loop.
Where you need to probably create a variable that stores the name of the reporter or use the custom field you created
Then see if you can make a lookup action to find the right employee based on the variable created or the custom field that you have created
Would that be something to investigate
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.
@Marc - Devoteam issue solved! In the end it was extremely simple.
Not working
object HAVING outboundReferences(objectType = "Employees" and Name = {{Employee.Name}})
Working
object HAVING outboundReferences(objectType = "Employees" and Name = "{{Employee.Name}}")
The property should be surrounded by double quotes. The thing that throws you off is that if you use this syntax the Validate syntax button isn't enabled so you think the syntax is not correct.
Thanks for the help,
Hielko
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.