I need to get a count DRs was rejected. We track this using a customfield singularlist that when the user selects the Failed Verification Transition the customfield is automatically set to "rejected". I need to get a count for each individual DR how many times the DR was rejected and a total count of how many of our DRs failed Verification.
Is there a way to count how many times an issue was in a specific transition. When the DR is failed the "Failed Verification" transitions to "In Progress". So the only way we can tell if the DR was rejected is by the customfield field that automatically updates to "rejected" if the transition "failed Verification" is selected
Is there a way I can get this info using Script Runner Scripted Fields?
Hi @Nannette Mori - There's two parts to this:
I'll defer to the community if you prefer scriptrunner, but here's how you can do it with native tools/Jira Automation
Tracking on an individual issue
You could simply look at the history for the issue and see how many times the issue has transitioned to the Failed Verification status. If you need something for reporting like a gadget on a dashboard to say, show all issues where they transitioned more than n times, you would need to do something like this:
{{#=}}{{issue.your custom numeric field}}+1{{/}}
From here, you'll be able to do whatever reporting you want to use against the new custom field.
Tracking total issues
You could use this JQL as the base for your dashboard gadgets which will bring in any issues that were ever in Failed Verification:
status changed to "Failed Verification"
Thank You for this information I will try this, however I need to get an historical count on for all the DR Records. Setting up what you gave me will track the count for any DRs that fail verification but not historical data....correct?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Correct - You would need to script something to update historically.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ne solution could be you have to create a number field and then add a post-function in that particular transition or Automation to increment the particular customfield (+1) but only works in new issues.
If you need this count in past issues, with scriptedfield you must review ChangeHistoryManager Class
In this example, they obtain the time, you must change the code and obtain only number times.
https://library.adaptavist.com/entity/count-the-time-an-issue-was-in-a-particular-status
I hope this help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I did create a scripted field
Below is my code
def theStatus = "Rejected"
def changeItems = ComponentAccessor.changeHistoryManager.getAllChangeItems(issue)
def changItemsCount = changeItems?.findAll().{it.field == 'DR Verivication Decision' && it.getTos().values().contains(theStatus)}.size()
return changeItemsCount.toInteger()
However this script seems to only report the data when there is a update to the record. I need to get historical count for each of the existing DRs records on how many times the DR was rejected without having the DR Record modified. How do I get that data. Also I would prefer to get the transition instead of using the customfield I am using above. I don't want to use state because when a DR is failed it transitions back to In progress and there are other transitions that transition back to In progress so to ensure I get an accurate I would need to get the transition = "Failed Verification
Is this possible to do?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.