When using a date picker within the customer portal, it is possible for a user to enter in an invalid year for the date. The customer portal appears to be setting values for dates in a manner that does not honor the parameters set forth in jira.date.picker.java.format which are used to define how Jira stores dates within the database.
- Within System > General configuration > Advanced settings, check to confirm the current value of the Key jira.date.picker.java.format a default value would typically be d/MMM/yy but in this test, I used d/MMM/yyyy to allow for a four digit year precision
- Add a date picker custom field to a request type within a JSM project
- In this example, I made that custom field marked as required within the request type
- From the customer portal, create a new request on that request type
- Do no use the date picker modal that pops up when you click that field to set a value, instead type in a date using the keyboard and enter a date in the far future, such as 02/02/54321 and then press enter to have that field accept the value
- Submit the request
We expect that because jira.date.picker.java.format is set to store this data using a 4 digit year, that it would not accept any value greater than four digits. We expect that there would be an error in trying to submit this clearly invalid value.
We expect that the field would have a red box around it to indicate an invalid value and generate an error even before being submitted or when trying to submit. This way the end user can be aware of this invalid value before it is saved by the system.
- No error is displayed within customer portal
- the request is created without problem for the end user
- The date value is being saved by Jira, and within the SQL database on the backend that date will show as having a 5 digit year value. In SQL that date is stored as 54321-02-02T00:00:00Z
- To the customer and possibly the agent, the year value can appear to change due to the settings within Looks an Feel that are only currently setup to accommodate a 4 digit year.
- This storage of 5 digit years causes another problem though, particularly when a customer tries to perform a sandbox refresh or a site import or other external data import. That data cannot be imported.
Currently there is no known workaround for this behavior. A workaround will be added here when available