Count Number of FixVersion

Carl-Marcus Scheffler April 9, 2019

Hi,
I would like to count by the number of FixVersion certain Stories have.

For example I have a project Foo and want to see how many FixVersions a Story in the current Sprint has. According to the howTos this should work something like this:

project = FOO and Sprint in openSprints() AND issueFunction in aggregateExpression("Count of FixVersions","fixVersion.count()")

But this does not work. Any ideas? 

1 answer

0 votes
fjodors
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.
April 11, 2019

Hi

Looks like "FixVersion" type is not suitable for count function.

issueFunction in aggregateExpression("count FixVersion/s") returns error "Field s not found or not a Number, Date, or Duration custom field.",

so I assume it will not work for any other types.


I think you can write scriptrunner code, that returns issues from specified JQL and then you can handle FixVersions per each issue.

Try something like this:

 

def jqlS = "<your JQL>";
def query = jqlQueryParser.parseQuery(jqlS);
def resultIssues = searchProvider.search(query, user, PagerFilter.getUnlimitedFilter())
def issList=resultIssues.getIssues();

if(issList.size()!=0){
/*review each issue*/
issList.each{iss ->
Collection<Version> issVerCol = iss.getFixVersions();
/*do something with versions*/
...

}
}

 

Suggest an answer

Log in or Sign up to answer