Custom Search

[Top] [All Lists]

Re: Is it possible to change Custom Field Type?

Subject: Re: Is it possible to change Custom Field Type?
Date: Tue, 20 Feb 2007 14:53:34 CST
I think Andreas is talking about the possibility of building this facility into 
Jira in coding terms, where conversion questions will occur - even if you look 
at the standard custom field types distributed with Jira, you've immediately 
got around 20 types (sorry, can't remember the exact number - we've got plugins 
adding more!) which gives you hundreds of possible conversions to have to code 
for, and then what happens when a plugin adds a new type.
Some of the conversions would indeed be very simple (such as your short-text to 
long-text, or date-time to date-only), but deciding how to handle them and then 
coding for it could be a huge task, and it would be very difficult to cater for 
all possibilities.
Having said that, I've done a similar conversion four or five times now, taking 
two different approaches.  In both, I effectively copied the old field.  First, 
you create a new working field called something like temp-new-text.
Then, your options are
1) Directly post values into the database.  You would need to write SQL to 
extract the text from  old-255-field and insert rows into customfieldvalue.  
You also need to worry about the custom field sequence number, and you would 
need to re-index after doing this.  
Actually, I really wouldn't recommend this approach unless you are really 
careful, but it is slightly less work than...
2) Write a workflow post-function that will copy the old-255-field into 
temp-new-text.  Copy existing workflow, and create a transition from each 
status (maybe limited to administrator only) that links back to the same step, 
and invokes the post function.  You can then use bulk-edit to transition your 
issues through it.
This method is safe, but could require quite a lot of work, as well as leaving 
a few tracks in the history.
Either way, after one of those steps, then you can delete the old short field, 
and rename the temporary new one.
There may well be other ways to do what you want, but I can't think of any 
(other than amending the field type in the database, but I tried something like 
that in dev once, and rapidly ended up reaching for the pre-change backups...)
Regards, Nic
Post by broughn2 - online at:
Jira-user mailing list
[email protected]
To unsubscribe or change you options visit this page:
<Prev in Thread] Current Thread [Next in Thread>
Current Sitemap | © 2012 planetjava | Contact | Privacy Policy