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.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.