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

Counting reopen times using Automation

Hi everyone,

 

I used this guide: https://confluence.atlassian.com/automationkb/how-to-count-the-number-of-times-an-issue-was-reopened-using-automation-for-jira-1183682960.html

to automate the reopen counter on Jira, and when I checked it, it seems to work only for the first time I reopen a ticket. When I move a ticket from "Done" to "To Do" the second time around, the rule doesn't execute and the number of times don't change to 1. Anyone knows why?

1 answer

0 votes
Kian Stack Mumo Systems
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Sep 21, 2023

@Yael Geffen

Are you re-opening it the same way both times? Or is one of the times using an Automation rule?

Thanks,

Kian

Only the automation rule. I'm moving the tickets from "Done" to "To Do" or to "In Progress". First time it works, second time it doesn't.

Kian Stack Mumo Systems
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Sep 21, 2023

Can you please share a screenshot of your rule configurations?

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.
Sep 21, 2023

Hi @Yael Geffen 

To ask Kian's question another way:

How are issues being re-opened from "Done" to another status?  Is a person always doing that or does another rule sometimes do it?

And showing images of your entire rule and the audit log details showing the rule execution may also explain this symptom.

Kind regards,
Bill

Like Kian Stack Mumo Systems likes this

There isn't another rule that moves issues from Done to To Do or to In Progress, only this automation. Here are the screenshots of the rule configuration.

Reopen count.png

Reopen count 1.png

reopen count 2.png

Hi @Bill Sheboy @Kian Stack Mumo Systems , did my screenshots provide any insight as to why this is not working after the first reopen?

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.
Sep 26, 2023

Thanks for those images!

The most likely cause of this symptom is you have an incorrect smart value for your Reopen Count field.  And so the value in the edit is null + 1 which always yields 1.

Smart values are name, spacing, and case-sensitive; when an invalid one is used, it only returns null rather than showing an error...in most cases.

To correct your rule, please use this how-to article to identify the correct smart value for your field.  Essentially you identify an example issue with your field, call a REST API function with a browser tab, and then search for your field on the page.  Once you have it, update the edit action for your rule.

https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/

Why do you think this is the incorrect rule? I copied it from the guide on how to count the number of times an issue has been reopened and this is the rule they specified.

Also, it's important to note that I'm not a developer, I'm a beginner product manager with no technical background, so I didn't completely understand your answer there :)

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.
Sep 27, 2023

No worries, as we are all learning all the time :^)

I was suggesting that the smart value is incorrect.  The smart value is name of a field the rule uses to access the information.  Every field has a displayed name (on the screen), a smart value, and a custom field id.  And sometimes the displayed name and smart value are different.

And...that guide is incorrect, as it shows two different names for the field, which certainly could lead to confusion.  I will give Atlassian feedback on the article to help them fix it.

 

If you use that how-to article it will help you find the correct smart value to use.  To paraphrase the article...

  • Identify an example issue you have with the field, "Reopen Count"
  • Note the issue key for that example
  • Using a browser tab, enter this URL, substituting in your Jira URL and the issue key
    • https://<yourinstanceurl>/rest/api/2/issue/<issuekey>?expand=names
  • Search on the page for Reopen Count; you can do that using Ctrl-F (or Find... from the browser ... menu)
  • On the page, you will see something like this, with your field.  In this example the field is "Cascade List", but you are looking for "Reopen Count"

Capture.PNG

  • Please note that the field also has a custom field identifier, written as something like customfield_yourNumber.  
  • Now update that edit expression in the rule to use the custom field id instead of the field name.  That will now look like this
{{#=}}{{issue.customfield_yourNumber}} + 1{{/}}
  • Save / publish, and test your rule again

Thank you for your detailed response. However, it looks like it didn't change anything, it counted the first reopen but not the following ones.

Here is the rule after the update:

Reopen count rule automation.png

Here is the history of the test ticket:

reopen count 3.png

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.
Oct 02, 2023

Would you please also post the audit log for the rule, expanding the details for any time the rule was triggered?  That will help to compare that information to what you show in the issue history.

Sure, here it is.Reopen count rule log.png

Looks like I didn't copy the correct value.

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.
Oct 04, 2023

I was asking for the details of the rule's audit log, not from the issue view point.

You may find the details of the audit log by:

  • navigate to the rule list
  • select your rule
  • select audit log at the top of the rule's structure
  • where the log shows the rule executed, select Show more
  • grab and post that image

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