Displaying Scripted Field Value in JIRA Two Dimentional Gadget

We have a scripted field "Month Created" that takes the month value from the date a JIRA ticket was created.  In the Default Configuration Scheme for this field is:

  1. Searcher:  "Free Text Searcher (stats)"
  2. Template:  Text Field (multi-line)

Code is as follows:

import com.atlassian.core.util.DateUtils;
import java.text.SimpleDateFormat;
return new SimpleDateFormat("MMM").format(new Date(issue.getCreated().getTime())) 

However, when we display this in our Gadget the Month is not "Ordered by Month" correctly (see column highlighted in red).

OrigGadgetDisplay_MonthCreated.png

We updated the Searcher of the field in the Custom Fields page to  "Date and Time Searcher (stats)".  After re-indexing JIRA, the custom field is not even recognized (although in the Filter the Month Created values for all 148 tickets remain visible and correct).

MonthCreatedNotShowing_DateTimeSearchTemplate01.png

 

Could anyone please advise on how to display the value of the scripted field ordered correctly by month?

Thanks!

1 answer

0 votes

I think this is because the gadget is looking for fields that present them selves as properly bounded lists of items.  While you've changed the searcher, that's actually one for doing statistics, not bounded lists, and the output is text, so it simply can't do it.

You really need the field output to be effectively a select list, but I don't think that can be done with a scripted field.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,166 views 13 19
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot