Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×We have several JIRA projects buitl out and as changes were made backup were also made, now there is a large number of inactive workflows that need to be removed. I am hoping someone knows a way to bulk delete those inactive workflows, rather than removing them one by one...
Hello Robert,
You can use the add-on Script Runner and run the following Script to delete all inactive workflows (Except the default):
import com.atlassian.jira.component.ComponentAccessor def workflowManager = ComponentAccessor.workflowManager def schemeManager = ComponentAccessor.workflowSchemeManager def sb = new StringBuffer()
workflowManager.workflows.each {
if(!it.systemWorkflow) {
def schemes = schemeManager.getSchemesForWorkflow(it)
if (schemes.size() == 0) {
sb.append("Deleting workflow: ${it.name}\n")
workflowManager.deleteWorkflow(it)
}
}
}
return sb.toString()
P.S: System default workflow should be assigned to some scheme, otherwise script won't work.
For more information about it, please check the question below:
Getting the following when trying to run the above from Script Console.
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script1.groovy: 1: unable to resolve class com.atlassian.jira.compnent.ComponentAccessor @ line 1, column 1. import com.atlassian.jira.compnent.ComponentAccessor
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.