JIRA: how to mask date fields

I'd like to mask date fields, in order to restrict dates values and avoid inputs like 01/01/20016 (which would be accepted by JIRA but it would make the indexing fail).

Is there any javascript available that would do it?

Thanks in advance,

1 answer

1 accepted

0 vote
David Currie Atlassian Team Oct 08, 2015

What kind of Custom Field are you using? If you use a Date Picker Custom Field it will already restrict the date input appropriately, using the Day/Month/Year Format as defined in https://confluence.atlassian.com/display/JIRA/Customizing+the+Look+and+Feel

Jira will let me input 01/01/20016: https://casari-asoc.mangoapps.com/sf/Njc1NTRfMTU1MTc5OQ The format is defined as dd/MM/YYYY in the Admin/Look and Feel This caused me once a failed reindexing. I need to avoid this and also would like to restrict future dates, say duedates no later that 01/01/2018. Thanks.

David Currie Atlassian Team Oct 08, 2015

That's odd, JIRA is supposed to validate input with JS in the client. I imagine you may be able to workaround that by populating the field with the Update Issue Post-Function, or another similar function. Was the data added through the edit field normally, or another way?

It's added in the Create Issue screen, you can try and reproduce it. This is JIRA 6.1.5

David Currie Atlassian Team Oct 13, 2015

What are you look & feel settings for the Day/Month/Year format? https://confluence.atlassian.com/display/JIRA061/Customizing+the+Look+and+Feel If you have this set to something like dd/MMM/yyyyy it could cause the problem..

The format is defined as dd/MM/YYYY in the Admin/Look and Feel.

David Currie Atlassian Team Oct 14, 2015

Ah, right you are. I tested and verified and raised a bug for this under https://jira.atlassian.com/browse/JRA-45776. Perhaps someone else can offer suggestions on validating it with JS.

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
Posted Wednesday in Jira

Join our webinar: How 1B+ feature flag events helped us build the new Jira

Every time you release software, there's a bit of risk – that there's a bug, that something breaks, or that the feature doesn't resonate with customers. Feature flagging helps make high stakes s...

134 views 0 3
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