How do I default to current date on date custom field

Ganga_Selvarajah August 23, 2011

Hi,

How do I default to current date on date custom field?

I have created custom date field and configured in my screen.

If the user open that screen for any update, I wanted to show the current date on that field instated of user to select a date from calendar.

is it possible? if so how to set up?

I need your help

Thanks
Ganga S

4 answers

1 accepted

6 votes
Answer accepted
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 23, 2011

Admin -> Custom Fields -> Configure (link is on the right, next to your date custom field) -> Edit Default Value -> Tick "Use current date as the default"

Ganga_Selvarajah August 28, 2011

Hi Nic,

Firstly: I am really sorry, It took bit more time to respond to your answer.

I can able to set the default date in the datebox field by enabling the default date option.

Thanks

Ganga S

Eva
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.
February 6, 2012

Nic - what if you only want to default the value in certain screens or transition? Or is there a "set it to current date" like "assign to me" for assignee?

Ganga_Selvarajah February 8, 2012

HI Nic,

I haven't tried.

I don't think so, it is possible in JIRA?

If it possible, please give me some tips...

Thanks

Ganga S

Ganga_Selvarajah February 8, 2012

ability to default the current date to certain screens?

Ganga_Selvarajah February 8, 2012

please let me know the plugin, so I can try...

thx

ganga s

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 8, 2012

Haven't tried what?

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 8, 2012

No, it's a flat default when you first use the field. You can't control it by screen or transitions.

Of course, there's always a spot of javascript, and I know there's at least one plugin providing a post-function to set date to "now"

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 8, 2012

Ahh, I see, it's the broken threading in Answers - you'd used "answer" instead of "comment" to reply to one of my comments. I've converted it, so the thread makes a bit more sense.

For the "default on screens", I just replied to Eva about that. I can't remember which plugin off the top of my head, pretty sure there's several in the plugin library, but I should emphasise that it is a post-function which will set the date to "now",and NOT a method to default it. The user won't get any choice - if the post-function is used, the date will be set to now, no matter what the user puts in the field.

tiago.santos June 29, 2018

@Eva8 you can create different contexts for your custom field, assigning different default values to different contexts.

 

Contexts can be "assigned" to IssueType and/or Projects.

 

If you wish to have different default values for different screens on different projects this would solve your issue.

Madhu Vanam June 6, 2019

thanks Nic. This solution worked for me.

Ahmed_Bilal July 29, 2020

Worked like a charm.

0 votes
Maggie Zhou March 18, 2014

Hi Nic,

Sorry for the disturbance and it works well now. I used previous data to show the default value of the custom date field, it didn't work. While if I create a new bug and then resolve, the date field will be filled with current date as the default value. In short, it works well now, and thank you for your answer.

Best regards,

Maggie

0 votes
Maggie Zhou March 18, 2014

Hi Nic,

This is Maggie and I am also using the Jira system. I also created a custom date field and wanted to show the current date on that field instated of user to select a date from calendar like Ganga. I followed what you said to set "Use current date as the default", but it didn't work. When I resolved an issue, the date field was blank, without any value there. Do I need to restart the Jira? Or do you kown what caused the problem? Thank you in advance.

Best regards,

Maggie

0 votes
Ganga_Selvarajah February 8, 2012

thanks for fixing the broken thread.

You're right, defaulting the current date in the post-function is not a good idea.

Ganga S

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 8, 2012

Well, it's a good idea in some cases, where you don't want the users entering it :-) But, no, I don't think it's right for what you want to do.

Suggest an answer

Log in or Sign up to answer