Given an issue, can I write a JQL query that will return the number of times an issues has been rejected?
I'd appreciate it.
Thanks,
Chris Mazzochi
Hello @Chris Mazzochi
Form your query it seems "Rejected" is a status. Basically JQL is used to fetch issues but it can't run aggregation/analytics on the data. You can query issue history using "WAS" / "During" / Changed keywords but it won't retrieve you the exact count.
You will need add-ons to achieve this.
If you have script runner then you can have a scripted field which returns this value.
import com.atlassian.jira.component.ComponentAccessor
def theStatus = 'Rejected'
def changeItems = ComponentAccessor.changeHistoryManager.getAllChangeItems(issue)
def transitionsCount = changeItems?.findAll{it.field == 'status' && it.getTos().values().contains(theStatus)}.size()
return transitionsCount as Double
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
It is not possible. JQL queries can return only issues, they can not return number of times.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How about the number of rejections per user for a given time period?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
JQL finds issues. It does not report on them.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can create a scripted field as @Tarun Sapra suggested. You would need an additional add-on for it and do some coding but it is not connected to JQL. JQL just finds issues but you can provide information about the issues in custom fields.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you guys. I will try the add-on/scripted field route.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I forgot to mention that I am running these queries from Klipfolio. So the add on solution doesn't apply. I think the add on is for JIRA.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 NowOnline 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.