Discussion:
Create new custom field options directly into database?
f***@atlassian.com
2010-10-09 01:24:20 UTC
Permalink
Anyone know if there are issues with adding new Custom Field Options directly into the Jira database?

I have a list of about 400 fields I've been requested to add. I would love to just fire off an SQL script to dump them in there, but not sure if they'll work properly afterwards. The Custom Field is a cascading select list, and I was hoping I could just dump them directly into the customfieldoption table. Has anyone done something like this before? Are there other tables I'm going to need to update as well?
--
Post by Turnip12 - online at:
http://forums.atlassian.com/thread.jspa?forumID=46&threadID=48085
f***@atlassian.com
2010-10-09 02:53:26 UTC
Permalink
Yes, That is the only table. Make sure you re-index JIRA after the DB changes.
--
Post by jobinkk - online at:
http://forums.atlassian.com/thread.jspa?forumID=46&threadID=48085
f***@atlassian.com
2010-10-14 16:31:41 UTC
Permalink
Thanks Jobin. The new fields were added, and appear to be working correctly, but when I try to add any new ones, I get a Data Access Exception error. It keeps telling me there's a duplicate ID. It's like the ID field was getting generated somewhere else and was never updated with the ones we dumped directly into the table. Any idea what else I might need to update? Every time I try, the ID is incremented by one according to the error message.

com.atlassian.jira.exception.DataAccessException: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:CustomFieldOption][id,11550][sequence,281][value,CHIM_0_01][customfieldconfig,10465][parentoptionid,null][customfield,10334] (SQL Exception while executing the following:INSERT INTO customfieldoption (ID, CUSTOMFIELD, CUSTOMFIELDCONFIG, PARENTOPTIONID, SEQUENCE, customvalue, optiontype) VALUES (?, ?, ?, ?, ?, ?, ?) (Duplicate entry '11550' for key 1))
--
Post by Turnip12 - online at:
http://forums.atlassian.com/thread.jspa?forumID=46&threadID=48085
f***@atlassian.com
2010-10-14 16:45:51 UTC
Permalink
The id is generated in the sequence_val table. It holds the next id to be generated. So if you are inserting any data into the table , make sure you update the above table with the max(id) + 1
--
Post by jobinkk - online at:
http://forums.atlassian.com/thread.jspa?forumID=46&threadID=48085
f***@atlassian.com
2010-10-26 17:11:03 UTC
Permalink
Sorry for the late reply, but thanks again for your help Jobin. Looks like we're set again.
--
Post by Turnip12 - online at:
http://forums.atlassian.com/thread.jspa?forumID=46&threadID=48085
Loading...