Forums

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

Counting of linked issues results in an incorrect value

Matt Noe
Contributor
March 15, 2023 edited

I created an automation in a project that is a manually triggered rule (for now).

In the automation, I do a lookup with the following query: "issue in linkedissues({{issue.key}}) and type = bug "

When I run the same query in ScriptRunner, I get 11 results for the target issue, so I believe this is correct:

Scriptrunner results automation.png

In the automation, I then edit the issue using {{lookupissues.size}}.  When I run to automation, the field is set to zero, and not the expected 11.

What am I doing wrong here? 

automation setup.png

I did try changing the edit value from "{{lookupIssues.size}}" to "={{lookupIssues.size}}" and then got the following error in the audit log:

Action details:
MANUAL TRIGGER
The user Matthew Noe triggered the rule
LOOKUP ISSUES
A search during custom value definition found no issues.
EDIT ISSUE
Could not convert the field value to a number. Please ensure the value is a number, math expression or smart-value that can be converted into a number.
Bug Count: =0
No fields or field values to edit for issues (could be due to some field values not existing in a given project):
CBE-16626

1 answer

1 accepted

1 vote
Answer accepted
Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 15, 2023

Hi @Matt Noe 

Works fine here:

bugrule.png

Is the field you are trying to edit available on the specific project?

Matt Noe
Contributor
March 15, 2023

The field is available on the project.  The only thing that I can think of is that the linked issues is a part of a separate project?  Does my automation have to be moved to global because of it?

Project being run against is CBE-XXXXX Linked issues  are BUG-XXXXX

Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 15, 2023

Prior of changing the rule to global, try the following query on your lookup component:

issue in linkedIssues(CBE-16626) and issuetype = bug

Click validate query and see how many issue it will return 

Matt Noe
Contributor
March 15, 2023

Thanks @Alex Koxaras _Relational_ .  I tried it on both the project specific automation and the global.  Project specific returns 0 and global returns 11.  Looks like that is my problem.  

Thank you for your help!

Like 2 people like this

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, atlassian government cloud, fedramp, webinar, register for webinar, atlassian cloud webinar, fedramp moderate offering, work faster with cloud

Unlocking the future with Atlassian Government Cloud ☁️

Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.

Register Now
AUG Leaders

Atlassian Community Events