Edit object field based on multiselect field and object references

indrek_orrin
Contributor
October 15, 2024

Hello community,

I have a use case that I just can't seem to find the correct AQL to use in Jira automation. I have a multiselect field and I have an object type that has some inbound references from other objects.

What I've done so far.
1) I have set up a variable and object field update based on this great guide ( https://confluence.atlassian.com/jirakb/how-to-copy-values-between-assets-object-field-and-multi-select-custom-field-using-automation-1141504943.html ) and it works fine. Objects from the multi-select field are added to object field.

Variable name: parentfield
Smart value: {{#issue.parent.someparentfield}}"{{value}}"{{^last}},{{/}}{{/}}

And in the edit field: Name IN ({{parentfield}})

2) I have verified that using the below AQL testing for object references also works as expected. Objects are returned and added to the field.

object HAVING inR(objectId IN (${customfield_xxxxx${0}}))

However, when I try to combine the two into one AQL in different ways, I can't even get the syntax to validate correctly.

I've tried:
Name IN ({{parentfield}}) AND object HAVING inR(objectId IN (${customfield_xxxxx${0}}))
object HAVING inR(Name IN ({{parentfield}}) AND objectId IN (${customfield_xxxxx${0}}))

I've been trying to find help articles or people in a similar situation but it doesn't seem to be a common problem.

I hope someone can either spot the error or confirm what I'm trying to do can't be accomplished in such a way.

Thanks,
Indrek

 

1 answer

1 accepted

3 votes
Answer accepted
indrek_orrin
Contributor
October 15, 2024

Upon futher investigation it seems that Jira is not able to validate variables, which makes sense because it doesn't know what the values might be.

However, I was able to fix my query using the below syntax:

object HAVING inR(Key IN ({{customfield_XXXXX.key}})) AND Name IN ({{parentfield}})

For some reason that is beyond me the combined AQL does not work with placeholder while it works as a separate AQL.

Hope this helps the next person.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events