I am looking for a SQL query in order to update the data from custom field to jira issue field

Ganga_Selvarajah August 23, 2011

Hi,

I am looking for a SQL query in order to update the data from custom field to jira issue field.

I have a custom field call “Issue Description” and the Field Type = Free Text Field (unlimited text).

I wanted to update all the issue Description data to Description field for a particular project.

I am not sure, what are the tables I have to join in order to update field.

My question:

It might cause any issue in terms of data integrity stand point?

Database MS SQL 2008

JIRA version 4.4

GH 5.7

Thanks

Ganga S

1 answer

1 accepted

1 vote
Answer accepted
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 23, 2011

You'll need to copy data from customfieldvalue to jiraissue - you'll find customfieldvalue has several columns but you're interested only in issue (this is the column ID in Jiraissue), customfield (this is the id of the customfield, you can get that in several ways - hovering the cursor over the "edit" next to the custom field in the full list of fields for example) and textvalue. Iterate through the customfieldvalue table, and copy the textvalue to jiraissue.description

Bear in mind a flat copy will replace any existing Description on the issues.

For data integrity, you don't need to worry too much, as the structure is quite simple, but you absolutely must

  1. Have a proven backup
  2. Have Jira offline while you amend the database - it is not an option to do this while it is running
  3. Re-index when you have finished
J Thomas
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 23, 2011

@Nic Brough - just curious - why 2? I sometimes make changes in the database while JIRA's running so maybe I shouldn't be? Is this a problem for all tables or just for changes to the issue table?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events