Hi there,
I am trying to lookup work items with the same value in a custom field as in the same customfield in the triggerIssue of the automation.
I first create a smart value called {{LookupOrder}} which contains {{triggerIssue.customfield_18631.value}}
Then within the branch step I am using this JQL Query:
{{issue.customfield_18631.value}} ~ {{LookupOrder}} AND parent = 'ACMEINC-104'
When I execute the manually triggered rule on the trigger issue I get this error in the audit log:
--------------------------------------------------------------------------------------------------
Branch rule / related work items05/07/2025, 17:08:04
Unable to find related work items. Try to only include work items containing links to related work items in your search:ACMEINC-104: "( ~ AND parent = 'ACMEINC-104') AND (key != ACMEINC-104)"
- Error in the JQL Query: Expecting a field name but got '~'. You must surround '~' in quotation marks to use it as a field name. (line 1, character 3)
--------------------------------------------------------------------------------------------------
What can I do to retrieve the work items with the same value in the specified customfield as in the trigger issue. How can I add some more JQL conditions, like the found work item key should be different than the triggerIssue - work item - key, and the parent should be a specific work item.
In the next steps I want to do some update and comment actions on the looked up issues.
Thank you very much for your insights! 🙏
Hi Ward! Let's see what we can do.
It would seem like the syntax of your JQL is not formatted propperly.
I would rephrase it as
nameOfYourCustomField = {{LookupOrder}} AND Parent = "ACMEINC-104"
What you were doing was comparing the value of a variable (your first smartvalue) to the value of a different variable (the second smartvalue)
With the syntax I suggest you are making a query where "any issue whose nameOfYourCustomField contains {{lookupOrder}}"
As general advide, I would recommend testing your JQLs with dummy values in the "lookup work items" menu to make sure it works as expected.
Give it a try and let me know if that helps!
Hi Jaime,
Thank you for your suggestion.
How do I need to mention the customfield?
Is specified this now in the JQL Branch:
{{issue.customfield_18631}} ~ {{LookupOrder}} AND parent = 'ACMEINC-104'
but I get this error now:
Branch rule / related work items
05/08/2025, 18:10:08
Unable to find related work items. Try to only include work items containing links to related work items in your search:
ACMEINC-104: "(000000500394 ~ 000000500394 AND parent = 'ACMEINC-104') AND (key != ACMEINC-104)" - Field '000000500394' does not exist or you do not have permission to view it.
Thank you for your insights!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No worries! I can see where the confusion is coming from.
{{issue.customfield_18631}} ~ {{LookupOrder}} AND parent = 'ACMEINC-104'
here just write the name of your customfield.
For example if the custom field was "description" the JQL would be:
description = {{LookupOrder}} AND parent = 'ACMEINC-104'
If you notice, "parent" here is one custom field! And you are comparing it with a value. In the same way you want to compare your custom field to the {{lookupOrder}} value :D
Hope that helped!
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.