The interface & docs for this feature are woefully under-developed.
It's not clear how to do simple things.
The "Lookup issues" action says you can:
Search for up to 100 issues using JQL and include the results list in other actions by using the {{lookupIssues}} smart value.
If I follow that with a For Each branch step the obvious thing is that I want to loop over the issues I just looked up and perform an action on each of them.
But so far I can't work out how to do this and neither the interface nor the docs give any help.
I tried an "Advanced branching" step with {{lookupIssues}} as the "Smart value".
But when I try to save my automation I get an error:
This component may be incompatible
One of the following needs to be produced earlier in the rule by the trigger or with a 'for each' branch for this component to work:
Issue
In the "Advanced branching" step I had set the "Variable name" to "Issue"... so I don't know what is the problem here.
Hi @anentropic,
Welcome to Atlassian Community!
The lookup issues can only be used as part of a list, you cannot use it in a For each loop. Instead you should use the JQL branch instead if you need to iterate over the returned result.
Hi @anentropic -- Welcome to the Atlassian Community!
Adding to Mikael's answer...
The Lookup Issues action is the bulk-handling feature for work items selected by a JQL expression. Its purpose is to sum / average / etc. values or to support bulk output, such as in a message or email. The lookup results contain work item data, and so cannot be used with the work item actions, such as Edit Issue Fields, as they expect work item objects
To individually process a list of work items meeting some JQL criteria, either use the Scheduled trigger with JQL or a Branch on related items with JQL. The one undocumented feature of the second type (Branch on JQL) is when the rule trigger provides an issue, that will be automatically excluded by the branch to prevent an endless loop / runway rule triggering.
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, the validator let me save it with that change so it seems to have worked.
Has anyone at Jira put any thought into how users are supposed to discover the 'right way' vs these limitations?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
First thing, this is a community of product users, and not Atlassian Support, and I am just another customer participating in the community (i.e., not an employee of Atlassian). If you have specific questions / concerns for Atlassian, paid license customers may contact them here or anyone may use the ? > Give feedback about Jira link in the products.
In my opinion...for many scenarios using automation rules, there are often multiple ways to solve a need, rather than a "right" or "wrong" way. Instead, there are better or worse approaches, subject to the context.
Successfully using automation rules requires continual learning and experimentation. As the product continues to evolve, there is no one-source-of-truth for all features. Indeed, reading community posts and documentation, one will find new actions added every week!
My recommendation would be to create a test site / project and try things to experiment, and to regularly read the following to look for updates / issues:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To add here even a little more.
While the JQL approach is the far superior one you should also be able to do it using the lookup Issues action.
Normally that would return a smart value {{lookupIssues}}, using that you could do a branch on a smartvalue, mainly "Advanced Branching"
https://support.atlassian.com/cloud-automation/docs/jira-automation-branches/
So both solutions would work while you probably have less hassle using a JQL.
An advantage of using a lookup Issues action might be that you can do it outside of a branch and then validate against the smartvalue if you should even jump in to the branch and if not provide a proper action as well.
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.