In a previous post, we covered how to use "calculated custom fields" to display information not available by default in JIRA. See my post about how to Improve JIRA dashboards by showing the last issue comment. I hope you've been exploring all the possibilities offered by wonderful (and free!) Kepler Custom Fields plugin. Today I want to bring forth an important detail when using these custom fields.
You created this awesome scripted custom field that displays the number of business days an issue has been opened. Yet, when you use that field in search, it gives funky results, and the sort order does not work.
The reason behind this behavior is quite simple. All JIRA fields have a Search Template which tells JIRA how it should treat the field during search. When you create "regular" custom fields, the Search template is set by default. In the case of a SIL script field, the output could be pretty much anything: A String, a Number, a User, etc...
We need to tell JIRA which Search Template to use. To do so, simply go in the JIRA Administration, in the Custom Fields section, locate you custom field and click on its Edit link. There you'll be able to choose the proper Search Template:
I leave it up to you to determine which Search Template is appropriate.
Enjoy using scripting fields!