Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 21:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Calculated Field not sorting

Sara Wortman
Contributor
November 12, 2020

I created a Calculated (scripted) Number Field using JMCF called "Parent WSJF". We are using it for Features to get their parent Epic's WSJF score.

 

The Groovy formula is:

 

double parentWSJF = issue.portfolioParent.get("customfield_10234")

return parentWSJF

 

The field appears to be working properly. It is accurate in getting the WSJF score of the parent Epic.

However, in filters/searches, when trying to sort by that field, it does not show the numbers in order (asc or dec). Also, if I search for issues where "parentWSJF is EMPTY", issues that have a value for that field are displayed. 

I've toggled the Search template between Number range searcher and number range searcher (statistics-compatible), but that did not work.

 

Any ideas are appreciated!!

1 answer

0 votes
David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 12, 2020

First of all, for searching and sorting to work, you need to re-index Jira, as Jira itself recommends in a message box whenever you edit a custom field.

Then, because your custom field is showing the value of a field from a different issue (here the Parent issue in the Advanced Roadmap hierarchy), you also need to configure Auto-indexing to force child issues (in the Advanced Roadmap hierarchy) to be re-indexed whenever an issue is modified. Otherwise, if the parent issue's WSJF score is modified, the index for child issues won't be updated because Jira will only update the index of the modified issue (the parent).

Sara Wortman
Contributor
November 12, 2020

Thank you for your answer, @David Fischer . I have re-indexed multiple times. As well as I have set up auto-indexing as described. I still cannot seem to get the field to sort.

David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 12, 2020

One reason might be that you changed between the two "search templates" - when you do that, you will need to run a foreground re-index, because Jira doesn't support changing the index field format on the fly.

Sara Wortman
Contributor
November 12, 2020

I've done full re-indexes each time I changed the search template or the groovy formula. I may try updating the Plug in?

David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 12, 2020

You probably have the latest version if you were able to configure auto-indexing. Odd.

I would recommend you open a support request here: https://innovalog.atlassian.net/servicedesk/customer/portal/9

Sara Wortman
Contributor
November 16, 2020

ok I've submitted a support request. Thank you for your help! @David Fischer 

Suggest an answer

Log in or Sign up to answer