Is it possible to revert issue statuses back from a schema change

I applied a schema change to multiple projects, I can get a rough idea of the number of issues impacted but would like a compact way to restore issues to their previous states. audit_item and audit_log don't seem to have the necessary information for a roleback. I am using postgres 9.3 btw.

3 answers

0 votes

What do you mean by "schema change"?  

If you mean you changed schemes, then most of the time, all you do is re-apply the old one

I was able to the projects back to the original schema and all is well there from a functionality side. However the schema that I moved the projects to had different resolution states and when I moved them back a large (>100) number of issues moved back in to the open or reopened state because there wasn't a comparable status in the schema they were migrated from.

For instance there are entries like this in audit_log:

 

11016 |                | 2015-06-29 13:51:20.985-07 | admin        | Workflow scheme removed from project   | workflows        | PROJECT           | 10301                                          | aderem                                                  |                  |                                         |           1 |                   | admin local administrator workflow scheme removed from project workflows aderem classic                                                                                                                                                                       |
 11017 |                | 2015-06-29 13:51:21.031-07 | admin        | Workflow scheme added to project       | workflows        | PROJECT           | 10301                                          | aderem                                                  |                  |                                         |           1 |                   | admin local administrator workflow scheme added to project workflows aderem copy of classic

 

And the corresponding

11098 |                | 2015-06-30 11:32:53.987-07 | admin        | Workflow scheme removed from project   | workflows        | PROJECT           | 10301                                          | aderem                                                  |                  |                                         |           1 |                   | admin local administrator workflow scheme removed from project workflows aderem classic                                                                                                                                                                       |
 11099 |                | 2015-06-30 11:32:54.011-07 | admin        | Workflow scheme added to project       | workflows        | PROJECT           | 10301                                          | aderem                                                  |                  |                                         |           1 |                   | admin local administrator workflow scheme added to project workflows aderem copy of classic

 

After I re-applied the schema on 6-30. The problem is that there issues in that project that have a jiraissue.issuestatus different than they did before application of the new schema on 6/29. I am probably tilting at window mills here but I would like to get the issues in these projects restored to their pre update states.

 

 

I came up with the following query that seems to return about the right number of issues. I know the syntax is messy, any suggestions on cleanup?

select CONCAT (project.pkey, '-', jiraissue.issuenum) , changeitem.newstring  FROM  jiraissue JOIN changegroup ON changegroup.issueid = jiraissue.id JOIN changeitem on changegroup.id = changeitem.id JOIN project ON jiraissue.project = project.id WHERE changegroup.author = 'admin' AND date_trunc('day', changegroup.created) =  '2015-06-29 00:00:00-07'  AND lower(changeitem.newstring) LIKE '%open%' ORDER by changeitem.newstring;

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,803 views 11 18
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot