Hello,
This is a little complex so please bare with me while I attempt to describe what I'm trying to do.
I have 3 ObjectTypes in Assets.
Employees
JSM Agent Groups
Services Catalog
These ObjectTypes have the following reference structure:
Employees (Has Outbound reference with cardinality of 1 that goes to) =>
JSM Agent Groups (Has an Inbound reference with cardinality 0 or more from) =>
Services Catalog
These references allow for the mapping of users to applications in the Services Catalog.
The Employees ObjectType also has a reference to a jira user account.
My goal is to write an AQL query that uses currentUser() to produce a list of all the applications from the Services Catalog that are mapped to the currentUser()'s Employees Object.
I was able to create an AQL query to get an Employee's JSM Agent Group:
objectType IN ("JSM Agent Groups") AND object HAVING inboundReferences((objectType = Employees AND "JIRA User" = currentUser()), referenceType IN ("LAN Group"))
I was also able to create an AQL query to get applications from the Services Catalog ObjectType with outbound references to JSM Agent Groups:
objectType IN ("Services Catalog") AND object HAVING outboundReferences(objectType = "JSM Agent Groups", referenceType IN ("Used By"))
Where I'm stuck now is how to combined these these two queries into one in order to get a list of applications from the Services Catalog that are mapped to a specific user.
Any help or guidance would greatly appreciated. I'm hoping to avoid creating redundant references directly between the Employees and "Services Catalog" ObjectTypes if at all possible.
Thanks!