Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How can I count the number of open issues and comment that on a newly created issue?

Will Fieldsend April 4, 2023

I want to count the number of open issues and then add that to a comment telling people where they are in the queue. 

So far in my automation I have 


Trigger - Manually triggered (this is just for testing I will change it to "Issue created" later)

Then: Lookup issues. Search for issues using JQL "resolution = Unresolved AND Status != Pending".
(I have clicked "Validate issues" and it correctly says "9 issues found")

And: Create variable. Variable name "OpenIssueNumber". Smart value "{{OpenIssueNumber.count}}"

And: add comment to issue: "Hi, there are {{OpenIssueNumber}} open requests ahead of yours."



I would expect this to add a comment saying "Hi, there are 9 open requests ahead of yours." But instead it is saying "Hi, there are  open requests ahead of yours."

Where am I going wrong?

1 answer

1 accepted

5 votes
Answer accepted
Paul Wiggers
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 4, 2023

Hello @Will Fieldsend 

It looks like you are using the wrong smart value. You can access your results with {{lookupIssues}} and the incorrect count option. You need to use size to get the number of items in the result.

There is no need to create a separate variable here but if you want you need to change the smart value to {{lookupIssues.size}}

Otherwise, just add a comment with: "Hi, there are {{lookupIssues.size}} open requests ahead of yours."

Will Fieldsend April 5, 2023

@Paul Wiggers YOU LEGEND!

I can't tell you how annoyed I was yesterday at not being able to solve this. I even tried asking ChatGPT which was next to useless. I should have come here in the first place. Thank you so much, this is why I love communities. 

Thank
Will

Like Akbar likes this
Paul Wiggers
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 5, 2023

@Will Fieldsend 

Good to hear it helped. 

And yes, the community is great. It brought me a lot!

Enjoy the rest of your day.

Like Akbar likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events