Hi,
How do i update resolution at DB level, using sql scripting.
there are some resolutions - lets say - A, B, C , D and i want all of them to be changed to resolution "closed", so i wrote this query -
update jiraissue set resolution = 7 where resolution in (select id from resolution where pname in ('A', 'B', 'C', 'D'));
7 is the resolution id of closed. But this query seems to have done something wrong as on my dashboard now i can't see the project list anymore.
Please share your opinion.
Thanks
You could well have damaged your database, but, to try to rescue this case, restart Jira and then run a full re-index
If you change data in a Jira database, then there are three basic rules
In the long term, if you need to do this again, then:
yes i know about jira.editable wrokflow status property, but the change was reuiqred across multiple projects thus I didn't want to make changes in diff. workflows or use global transitions that loop back on the same status just for the sake of updating workflow but I guess as the KB article suggests it's one of the few workarounds available.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I know it's not simple.
Have you restarted your Jira and re-indexed it? You need to do that if you don't want to lose any data.
Your SQL looks ok to me, but you really do need Jira offline and re-indexed to stand any chance of this working.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yes after reindexing also the project list didn't appear. it's a test instance thus i am reverting back to the older stable state and will try the groovy script plugin instead of directly manipulating the db
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The SQL you ran on it's own shouldn't have broken the project list. But if you had Jira up while it was done, it sounds like it has done something horrid and unpredictable :-(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yes after reindexing also the project list didn't appear. it's a test instance thus i am reverting back to the older stable state and will try the groovy script plugin instead of directly manipulating the db
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
directly updating DB is not suggestable, always first try to update through jira api in case it is not feasible then you have to look into update directly on DB,
one way, you can update resoulution by using bulk edit
another way, check the following document to bulk edit resolutions
https://confluence.atlassian.com/display/JIRAKB/HowTo%3A+Bulk+Edit+Resolution
some one already raised an issue with atlassian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Using bulk edit isn't the best possible approach as the final workflow state is non-editable, ofcourse we can make it editable but the thing is that this change needs to be implementated across multiple projects. Thus updating each and every workflow isn't a great idea.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Modifying each workflow is a pain, you're right but once you get the time here's sth. I did with all my workflows:
I replaced the jira.issue.editable property with the following:
jira.permission.edit.group = jira-administrators
That way the issues aren't editable for any users but I can do whatever I want and I have to do bulk-edits A LOT.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My opinion is to avoid messing with the DB directly! I would use Jamie's script runner plugin which has a built-in script to bilk-edit resolution...
https://jamieechlin.atlassian.net/wiki/display/GRV/Built-In+Scripts
Cheers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.