Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira Automation - Lookup outbound referenced objects

Andy Thelen April 10, 2025

Hello,

I am trying to update our decommission user automation to look up asset objects where the user being decommissioned is referenced, then adding the name of the asset they are being referenced in a subtask. On the issue, the Affected user custom field is updated with the user being decommissioned (linked to Employee_Data objects in Assets). The rule will check if the Affected User is listed in certain attributes in assets, then create a subtask. If it doesn't exist, the subtask is not created.

Our Schemas in Assets are structured as:

  • Object Type: Employee_Data
    • Attributes:
      • Name
  • Object Type: Vendor
    • Attributes:
      • Relationship Manager: (outbound reference to Employee_Data.Name)
  • Object Type: Applications
    • Attributes:
      • Product Owner: (outbound reference to Employee_Data.Name)
      • SME: (outbound reference type to Employee_Data.Name)
      • Primary IT Owner: (outbound reference to Employee_Data.Name)
      • Budget Responsible: (outbound reference to Employee_Data.Name)

Here is a sample of the rule:

 

image.pngimage.png

image.png

{{#debug}}objectType = "Vendors" AND "Current Status" IN "Active" AND "Relationship Manager" IN "{{issue.Affected User.Name}}"{{/}}

I am getting an "Assets field condition failed" error in the AQL Condition. I am not sure what I am doing wrong and have tried many different AQL queries. Any insight or recommendations pointing me in the right direction would be greatly appreciated. 

1 answer

2 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 10, 2025

Hi @Andy Thelen -- Welcome to the Atlassian Community!

Disclaimer: I am not currently using Assets or AQL, and so cannot test my suggestions.  With that out of the way...

I believe there should be parentheses surrounding the values when using the IN operator:

{{#debug}}objectType = "Vendors" AND "Current Status" IN ("Active") AND "Relationship Manager" IN ("{{issue.Affected User.Name}}"){{/}}

 

Kind regards,
Bill

Andy Thelen April 11, 2025

Hi @Bill Sheboy  

Thank you for the response. Adding in the parentheses unfortunately did not produce any results.

image.png

I try the Advanced AQL editor in Assets with and with out the parentheses and still would produce the results I expect, but for some reason is not working in the automation rule.

image.png

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 11, 2025

Again, I am guessing here...

If you expand the branch area in the audit log to look at the issue keys, is the one you show with that standalone AQL query the same for the specific Affected User field: VEND-14390?  Or did it not match for the specific issue the rule branched over?

Andy Thelen April 11, 2025

From the audit log screenshot I posted before, the branch rule was fully expanded so I can't see the keys. The branch trigger is set for the current issue, which is where the Affected User field is set. It looks like the condition did not find the match, but it should find VEND-14390. 

Some information I left out was that each object type is in a different schema. Affected User is in the Accounts Schema (Employee_Data Object Type), while the Vendor Object Type is in the Vendor Schema. I thought defining the object schema in the AQL condition would help but that also didn't work.image.pngimage.png

 

I do have another branch in the automation that uses the same Affected User field to look up attributes in the Accounts schema. That is working. The problem seems to be when trying to query in a different schema.

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 11, 2025

Sorry, I am out of ideas to suggest for this one.

You could wait to see if another community member has suggestions or work with your Site Admin to submit a ticket to Atlassian Support to ask them:

https://support.atlassian.com/contact/#/

 

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