Incorrectly persisted Jira change history

Brendon Abbott
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 8, 2018

Relating to this bug: https://jira.atlassian.com/browse/JRASERVER-59681

It discusses about Version Picker data being wrong.

What is the correct format, in general, for the OLDVALUE and NEWVALUE columns in the database?  The corrective SQL seems to suggest that these values should never be surrounded in square brackets.  However, there seems to be a lot of cases within our database of this happenning.

Ultimately, I am asking - should I definitely strip the square brackets from all changeitem's xVALUES?

1 answer

0 votes
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 9, 2018

You are correct that these oldvalue and newvalue fields in that specific table, for that kind of custom field should just be the id values without [ or ] in them.

If you are not planning on performing an XML backup of this data soon, I would not bother with modifying this data.  Jira itself does not appear to have a problem with the data values here when functioning by itself.  

This can be a problem if you're planning to migrate data out of this system into another Jira site.

I tested this out using the work-around posted by Sacchetto Marco of:

update changeitem set oldvalue = trim(leading '[' from oldvalue), newvalue = trim(leading '[' from newvalue)  where field = 'versionPick';
update changeitem set oldvalue = trim(trailing ']' from oldvalue), newvalue = trim(trailing ']' from newvalue)  where field = 'versionPick';

This worked for my postgres instance to remove those characters from changeitems on my field called 'versionPick'.   If you do this, I would suggest that you create a backup of your data first, stop Jira, then perform the SQL changes to that table.  And then start Jira.  This way you can be sure that Jira is clearing any caches that might exist.  From that point you will likely want to immediately create an XML backup, because presumably you're doing this to migrate your data, and because this bug has not be fixed yet, it is still possible that if any users make any changes to that field on an issue, your data will continue to have entries that have these [ ] characters.

Suggest an answer

Log in or Sign up to answer