How to modify issue history ?

Leonard Pooch September 26, 2019

Hi, I need to edit the date/time when an issue was added to a sprint.

Can I edit the history and if yes how, do I need to edit the database, can i use the rest api ?

 

Please help me figure out how to do that.

Thanks, Leonard

2 answers

0 votes
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.
September 26, 2019

Yes, you do need to hack the database to destroy historical data.  You can't do it with REST, only via plugin code or changing the database.

Leonard Pooch September 26, 2019

Thanks Nic for confirming my thoughts.

Can you give me some hints on how to do that ? I was digging into the db and i come to the conclusion that it has something to do with the 'changeitem' and 'changegroup' tables, am i right ?

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.
September 26, 2019

Partly.  Those two tables are the history of an issue, but I think you will also want to look in the AO tables related to Jira Software - I have a feeling the date things are moved into (and out of) a sprint is recorded in one of them as well.

Dharma Ramos
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.
September 26, 2019

@Nic Brough -Adaptavist- wouldn't you say it is not recommended to edit the Jira DB? I believe you have advised against it in the past.

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.
September 26, 2019

You are absolutely right, I will always advise against it.  It is so easy to get it wrong, and you have to have the system completely offline, and usually re-index afterwards.

In this case, if it is only the history date, then it is safe, as there's nowhere it links to, all you're doing is lying about a historical action.  But I think the sprint date is not held there, and there's another table involved, and I don't know the effects of messing with that.

Leonard Pooch September 27, 2019

That's it, after some database diggin and some tests, I've manage to figure out how to achieve my needs.

First of all, I needed to note the issues ids. They are retrievables from the url that appear at the bottom left of your screen when you put you mouse over the `Edit` button in your issue page.

Then, I just turned off Jira and opened my db admin page. I recovered the changes made to my issues with this

select * from changegroup where issueid = <id>

I noted the values contained in the `ID` column then I used this

select * from changeitem where field = 'Sprint' and newstring = '<sprint name>'

to recover the customs fields changes related to my sprint.

And I saw that one of the values contained in the groupid column of the result of this second query was the same as one of the ID column from the result of the first query.

So I decided to change the date from the column CREATED associated with the ID I just get. I modified this value to a date when the sprint was not started.

Then I started Jira and I reindexed my Jira.

After that, I could notice that the history was modified accordingly.

This procedure allows me to fix my original problem that was some kind of trouble which resulted from the imports of my tickets and the reconstruction of old sprints.

I leave this here, maybe it could help others that faces the same problem.

0 votes
PVS
Banned
September 26, 2019

Suggest an answer

Log in or Sign up to answer