JIRA Modifying Closed Tickets

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

4 answers

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.

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

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

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.

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

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.

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.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Oct 09, 2018 in Jira Core

How to manage many similar workflows?

I have multiple projects that use variations of the same base workflow. The variations depend on the requirements of the project or issue type. The variations mostly come in the form of new statuses ...

247 views 6 0
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