Hi Team,
Is it possible to change a field's type from "Date Picker" to "Date Time Picker" using Scriptrunner without deleting the existing fields?
You can, but only by direct database editing. Code can't do it directly.
With code, you could create a new screen, and write a script that can copy the date in the old field over into the new.
Date and date-time fields are the same thing in the database, and have very similar code. In the database, the columns are the same time - date/time stamps. If you looked at a date field, it does have a time attached, but you'll see that the time is always midnight (00:00:00).
So you would not need to change the data, all you need to do is stop the Jira, take a database backup, change the type of field in the custom field header, restart Jira, go edit the custom field, changing its searcher to the best one for you (in fact, make sure you change it to something else, and save the field, then go back in and change it to the one you actually want.
Finally, do a full re-index, and it'll all work.
Going from date/time to just date is the same, but you can run into problems with it in some places if you have data that you don't remove the time from them.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.