I need to change the resolution field for some issues so i choose JIRASOAPSERVICE for doing this. Since it is not possible to update the resolution for us on UI, I need some way to update the resolution field with "Fixed". The below code is exactly getting all the issues based on the given criteria. Initially i tried to update for 10 issues and it was success. But when the check the UI, it is found as not updated. I executed the code again and checked the remainig issues but the issues count is not changed which means my previous update was not committed. How to store the udpated values? Do I have to reindex?
String jql = "issuetype=\"Release Notes Subtask\" AND status=Closed AND resolution=Unresolved"; System.out.println("JQL : "+jql); RemoteIssue[] remoteIssues = jiraSoapService.getIssuesFromJqlSearch(authToken, jql, 500); System.out.println("Remote Issues Count : "+remoteIssues.length); for(RemoteIssue issue : remoteIssues){ //issue.setResolution("1"); System.out.println(issue.getKey() + " - " + issue.getStatus() + " - " + issue.getResolution() ); }
Community moderators have prevented the ability to post new answers.
> Since it is not possible to update the resolution for us on UI
Er, that's probably the problem. As a general rule, SOAP won't let you do things you can't do in the UI.
I'd start by trying to use SOAP to set the resolution on an issue that you can set the resolution on in the UI and take the testing from there.
Hi Nic, Could you please advise on how to update the resolution for issues that are not allowed to update from UI?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think you've missed the point of my answer.
My understanding is that you can NOT use SOAP to do things the UI will not let you.
If you want to let SOAP update the resolution, then you need to set it up so you can do it in the UI as well.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Re-open the issue (CLI progressIssue) and then close the issue (another CLI progressIssue) setting the resolution field to fixed at the same time.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The problem is that the workflow for that issue type is not allowed to reopen.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nic, I understood the point about using SOAP. SOAP cannot do things that are not allowed from UI. I am not aware of that point and so i treid with SOAP. So my question now is since SOAP is not allowed, is there any other way to update the Resolution field. As I already mentioned that our workflow is not allowed to reopen the issue and also that Issue type is obsolete now.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You will need to either change the workflow to allow the change, write a plugin/script that can bypass it, or hack the database. Option 1 is by far the easiest.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Nic!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nic,
I checked the database and found that jiraissue table is having the information. So i am planning to execute the below script followed by indexing after executing the script.
update jiraissue set resolution=(select id from resolution where pname like '%Fixed%') where issuetype='6' and issuestatus='6' and resolution is null
Could you please confirm if there are any other tables that need to update?
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That looks like the right SQL, there's no other table you need to amend.
Don't forget that you need to stop Jira, take a database backup (and ideally, prove it's good) before you attempt this. It is not safe to run SQL against an active Jira.
I don't understand why you are persuing this when there's a simple, safe, repeatable way to do it without any downtime.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nic, I stopped JIRA and then I updated the db. I am actually working on dev instance. This issue is arised because the workflow associated with the issue type and the type of issue are obsolete and no loger in use now. Hence I cannot change the workflow.
I got a doubt after executing this script. In the jiraissue table i found a column called "workflow_id". Is there any significace of this column pertaining to my data change? I am afraid now that i havent thought about that before started indexing.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No, the resolution is not related to the workflow.
It's utterly irrelevant whether your workflow is "obsolete", the most simple and safe solution is a minor tweak to it.
I do not understand why you are wasting your time with risky and time-intensive database edits and downtime when you could fix this in 5 minutes in the UI.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks for your reply. Can you let me know the steps required for updating thruogh UI? Actually I am not much aware of handling workflows. Please let me know if you need any further information about our environment.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Go to the project in question and look at the admin screens, looking for the "workflow scheme". That will tell you what workflow (or workflows) you need to edit.
Next, go to admin -> workflows and find the workflow(s) to edit. Create a "draft" (as you can't edit an active workflow)
You need to add a simple transition from closed, going back to closed. I'd recommend creating a new screen specifically for it (it needs the resolution on it), and adding "conditions" to the transition to prevent other users using it (e.g. project-admins only would be a good one)
Publish the draft, and you'll find you can then use it on the bulk-edit screens, to edit the resolution. Without downtime, backups or any fuss.
See https://confluence.atlassian.com/display/JIRA/Configuring+Workflow for more on the workflow editor.
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.