JIRA Modifying Closed Tickets

kanchana wijerathna January 17, 2016

Is there any SQL queries to update Closed tickets ? i want to update only the priority.

4 answers

1 vote
Phill Fox
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 17, 2016

Further to the answers from @Tibor Hegyi [META-INF] and Vasiliy Zverev I would suggest you amend the workflow to allow you to edit closed issues (you can and probably should revert this once you have made your change). Then use the bulk edit feature to select the issues you want to update the priority on and make that change. Again this may require you to adjust your permission settings.

1 vote
Tibor Hegyi _META-INF_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
January 17, 2016

Is there any specific reasony you want to updated tickets in the database?

Don't you want to enabled editing closed issues? This way you can edit the issues normally.

Or you can add a transition to the Closed status. The transition could have a screen with the Priority field on it or you can add a post function to this transition to set the priority.

kanchana wijerathna January 17, 2016

How do we enable editing closed tickets ? is there any other way we can enable globally without modifying the workflows ?

Tibor Hegyi _META-INF_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
January 17, 2016

I don't think there is. You must remove the step property from the workflow to enable editing of the Closed issues.

0 votes
Midori
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.
January 18, 2016

Do this with the JIRA Automation Plugin. You can intercept issue updated events, and update the priority field with zero programming.

As a general rule of thumb, never update the database if there's another way to solve your problem. Updating the database directly will lead to a plethora of problems (out of date caches, broken indexes, etc.) unless you know what you are doing.

0 votes
Vasiliy Zverev
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.
January 17, 2016

I strongle reccomend DO NOT make any updates via SQL. reasons:

  1. You could make respective record into change log
  2. You could create some errors

Instead SQL try this code example (you could run it via SCriptRunner)

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.event.type.EventDispatchOption
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.MutableIssue

MutableIssue issue = ComponentAccessor.getIssueManager().getIssueObject("ZV2-1");
issue.setPriorityId("1"); //1 is for blocking priority
ComponentAccessor.getIssueManager().updateIssue(ComponentAccessor.getJiraAuthenticationContext().getUser().getDirectoryUser(), issue, EventDispatchOption.ISSUE_UPDATED, false);
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.
January 17, 2016

You also MUST stop JIRA if you run SQL, back up the database before hand, and in most cases, re-index from scratch.  What you mistakenly think is a "simple" SQL update can cost you hours of down-time.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events