Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

question about JIRASOAPSERVICE - RemoteIssue.setResolution() method

srinivasp
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.
October 18, 2012

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() );
			}

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
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.
October 19, 2012

> 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.

srinivasp
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.
October 19, 2012

Hi Nic, Could you please advise on how to update the resolution for issues that are not allowed to update from UI?

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.
October 19, 2012

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.

Bob Swift OSS (Bob Swift Atlassian Apps)
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.
October 19, 2012

Re-open the issue (CLI progressIssue) and then close the issue (another CLI progressIssue) setting the resolution field to fixed at the same time.

srinivasp
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.
October 19, 2012

The problem is that the workflow for that issue type is not allowed to reopen.

srinivasp
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.
October 19, 2012

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.

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.
October 19, 2012

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.

srinivasp
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.
October 19, 2012

Thanks Nic!

srinivasp
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.
October 24, 2012

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

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.
October 24, 2012

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.

srinivasp
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.
October 24, 2012

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.

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.
October 24, 2012

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.

srinivasp
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.
October 25, 2012

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.

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.
October 25, 2012

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.

TAGS
AUG Leaders

Atlassian Community Events