Business Need: I need to order the issues by sprints, something which JQL (unbelievable!) does not yet support.
Workaround : I want to copy the sprint name into a calculated field. (and hopefully jql will allow me to order by this field) .
Any ideas how to do this in the simplest way possible ? Custom addins like Jira Misc Custom Fields or Script runner ?
Any help with how to configure the syntax will be greatly appreciated!
Solved! Go to Solution.
The formula is actually returning a Sprint object, which is then automatically converted (by Java) into a String by its toString() method.
So if you want just the name, you should call getName() on the object.
Thanks!
I've tried the following:
<!-- @@Formula: issue.get("customfield_10500").getName() -->
The error I'm geting in jira.log:
[innovalog.jmcf.fields.CalculatedTextField] CalculatedTextField: error evaluating formula: Sourced file: inline evaluation of: `` issue.get("customfield_10500").getName() ;'' : Error in method invocation: Method getName() not found in class'java.util.ArrayList'
You first need to get the first version, because fixVersion is a multi-valued field:
issue.get("customfield_10500").iterator().next().getName()
Of course, you should protect this code against errors (such as if issue.get("customfield_10500").isEmpty())
Great! that worked! and to use numerical sorting, I switch to the Calculated Number Field and changed the formula to issue.get("customfield_10500").iterator().next().getId()
and it works, big PM Headache solved, thanks David!
Thank you both for this answer - it is so simple and works!
Recommended Learning For You
Level up your skills with Atlassian learning
Learning Path
Apply agile practices
Transform how you manage your work with agile practices, including kanban and scrum frameworks.
Learning Path
Configure agile boards for Jira projects
Plan, prioritize, and estimate upcoming work by creating and configuring agile Jira boards for company-managed projects.
Learning Path
Registered Scrum Basics™
Manage work more effectively by learning scrum basics from a global leader in agile transformation and training—and get credentialed by Scrum Inc.®