Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Average Issue Rating based on JQL search

Michaella December 20, 2018

Hi!

I was wondering if it is possible to get the average issue rating based on a JQL query for FREE? Say for example, I wanna know what issue rating I usually get for a project as well as other people in my team?

We use this https://marketplace.atlassian.com/apps/1210973/rating-customfield?hosting=server&tab=overview add-on.

Dashboard

I have tried the dashboard tool for Issue Statistics (but only the issue count not average :() but they end up looking like this:

Screen Shot 2018-12-21 at 9.35.21 AM.png

XAxis was Issue Rating

YAxis was Assignee

 

but as you can see, there are no labels on it and also if I check one by one they are not in order either. I've tried it with other gadgets as well.

 

Scripted Field

I also had an idea to create a scripted field that is based on the Issue Rating field to help solve the issue mentioned previously, this was the script:

 

import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.ComponentManager;
import com.atlassian.jira.issue.CustomFieldManager;
import com.atlassian.jira.issue.fields.CustomField;
import com.atlassian.jira.issue.IssueManager;
import com.atlassian.jira.issue.Issue;

def issueManager = ComponentAccessor.getIssueManager()
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def cField = customFieldManager.getCustomFieldObject("customfield_11730")
def cFieldValue = issue.getCustomFieldValue(cField)
String issueRate = (cFieldValue);
int rateValue;
switch(issueRate) {
default : rateValue = 0; break;
case 'Worst': rateValue = 1; break;
case 'Bad': rateValue = 2; break;
case 'Okay': rateValue = 3; break;
case 'Good': rateValue = 4; break;
case 'Best': rateValue = 5; break;

}
rateValue;

 
Whilst the script was doing its job, Jira (v.6.1.4) kept having errors and I was forced to delete it. But even if it did work, the Dashboard gadgets wouldn't process it :(

Aggregating 

I cannot aggregate in JQL cause the values of the Issue Rating field are not numeric.

 

Soooo I am not exactly sure how to go about this. Came here to ask if you guys know of any other way to go about this? I'd appreciate any input I can get! Thanks in advance.

 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events