Forums

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

Determine number of linked issues in certain status

Almuth Boehme
Contributor
July 18, 2025

My goal is to determine the number of outward linked issues of the current issue that are not in status "Declined".

From my research it seems lookupIssues is my best bet, however I'm not sure if I'm trying to do too much at once.

I currently have:

automation1.png

However, there is no output due to this error:

error1.png

10152 is field "status" - so far so good. But I'm trying to understand the cause for the error.

The scope of the automation does not make a difference - the error is the same with a global scope.

Thanks!

1 answer

1 vote
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.
July 18, 2025

Hi @Almuth Boehme 

The Lookup Work Items action requires valid JQL, and the expression you show is comparing a list of field values (e.g., Declined, Declined, To Do) on the left side of an operator to a single value.  JQL requires a field, not a value, on the left.

Next, why test the outwardIssue ones specifically?  Could you instead test by the link types using the JQL function linkedIssues()?

 

If you actually need only the outwardIssue ones, please try this JQL for the lookup:

key IN ( {{issue.issuelinks.outwardIssue.key}} ) AND status != Declined

Please note well: the rule scope in the details at the top will determine what this JQL finds in the rule.  When you expect the linked work items to be in multiple projects, the scope will need to be multiple-project or global.  Your Jira Site Admin will need to help change the rule scope.

 

If you only need the count and do not want to change the rule scope, this would work:

{{#=}}0{{#issue.issuelinks.outwardIssue.fields.status}}{{#if(not(equals(name, "Declined")))}}+1{{/}}{{/}}{{/}}

How that works:

 

Kind regards,
Bill

Suggest an answer

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

Atlassian Community Events