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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,554,909
Community Members
 
Community Events
184
Community Groups

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

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

4 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.
Apr 04, 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."

@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

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.
Apr 05, 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.

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