Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Using a Date Picker as scripted field in ScriptRunner

Mark Hellegers April 9, 2015

I installed ScriptRunner to be able to use the release date of a fix version as a column (to be able to sort on it) and it works fine using a Date Time Picker, but it adds the time to the value of the column (which is always set to 12:00 AM). When I add a regular custom field I can choose between Date Picker and Date Time Picker and it seems that Date Picker has the format that I want. Is there a way to get that type of picker for my scripted field as well?

Something else odd that I noticed is that the time is shown as 12:00 AM, while I have set the time to a 24 hour format in the look and feel section of JIRA. Is there a way to at least show it as a 24 hour format? Every issue now uses two lines in the dashboard, because the text AM does not fit.

2 answers

1 accepted

0 votes
Answer accepted
Kristian Walker _Adaptavist_
Community Champion
April 26, 2016

Hi Mark,

You may consider looking at formatting the value returned using Java Simple Date Format.

I have an example of how to format the date value returned by a scripted field here.

I hope this helps.

Thanks

Kristian

Mark Hellegers April 28, 2016

Thanks Kristian,

that will work well enough. I formatted it as YYYY-MM-dd, so sorting on the column will work properly.

Kind regards,

Mark

Kristian Walker _Adaptavist_
Community Champion
April 28, 2016

Hi Mark,

I am glad I was able to help.

Thanks

Kristian

0 votes
Mark McCormack (Adaptavist)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 7, 2016

Hi Mark,

This question is a year old! Sorry but we must have missed it. Before we go ahead an answer it - is it still a valid question?

regards,

Mark.

Mark Hellegers April 7, 2016

Hello Mark,

I forgot about it, but yes it is still a valid question. I thought I had created an issue for it in the scriptrunner issue tracker, but I'm not sure I can still access that issue tracker, so I can't check.

Kind regards,

Mark

Mark McCormack (Adaptavist)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 7, 2016

Hi Mark,

If needs be you can use our new Product Support Service Desk portal but we'll try and help you here just the same.

Can I start by asking what version of JIRA and ScriptRunner you are using so we can check what you are referring to?

Mark Hellegers April 13, 2016

Hello Mark,

we are using JIRA 6.4.1 with ScriptRunner 3.1.4

Suggest an answer

Log in or Sign up to answer