Script Field - Date Time Picker always returns $datePickerFormatter.format($value)

code I have tried

def last_test_date = Date.parse("yyyy-MM-dd hh:mm:ss", "2014-04-03 1:23:45")

return last_test_date 

 

return "12-13-2017"

return "13-12-2017"

return "12/13/2017"

return "12/Dec/2017"

 

Nothing seems to work.

1 answer

1 accepted

Hi Mahek,

Which searcher are you using for this script field? Your first example (where you return a Date object) should work correctly, so long as you make sure that the searcher is set to 'Date Time Range picker'.

Yours,

Jake

I don't get "Date Time Range Picker" as an option.

I am using "Date Time Picker" - Same result

Hi Mahek,

'Date Time Picker' is one of the available templates for a script field, but you also need to select the right searcher, which in this case is 'Date Time Range picker'. You can select the searcher as follows:

  1. Go to the Script Fields tab, where all of your script fields are listed.
  2. Locate the field you want to configure. In the left-hand column are listed the configuration scheme, the searcher, and the template (see first image below for an example).
  3. Click on the name of the searcher, and you will be taken to a page where you can edit the field's details (see second image).
  4. Select 'Date Time Range picker' from the 'Search Template' drop-down and submit the form.

Image 1

Screen Shot 2017-12-22 at 11.21.02.png

Image 2

Screen Shot 2017-12-22 at 11.18.43.png

Perfect!

That is the issue, the problem is fixed.

Thanks Jake. Appreciate the effort.

Hi Mahek,

I'm glad to hear that the problem is resolved. If you find this answer to be useful, please consider accepting it so that other users of Community who may be having the same issue as you will be able to see that there is a solution available.

Many thanks,

Jake

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 30, 2018 in Marketplace Apps

Three tips for boosting your board's efficiency with Story Maps

Trello is one of the most effective tools for driving your sprints. It's customizable for every Agile team and product owners and Scrum masters (SM) love it. However, Agile teams often struggle with:...

818 views 2 9
Read article

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