How can we find the unused workflow, workflow schemes and screens, Screen schemes etc and delete it?

Please let me know if we have any way to find the workflows/screens etc that are not used in any projects so that those can be deleted. I know the manual way to achieve this. However, since we have many schemes which cannot be done manually, can you please let me know if this can be achieved via some script(Groovy/script lisetner, etc)

Script to find the Unused Workflows, Workflow schemes, Screens, Screen schemes, issue type screen schemes

Script to delete the Unused Workflows, Workflow schemes, Screens, Screen schemes, issue type screen schemes.

Current Jira version is 7.2.9

Your help is highly appreciated!

Thanks in advance.

Deepa

2 answers

This widget could not be displayed.

>since we have many schemes which cannot be done manually

All schemes can be done "manually".  I don't understand what you mean here.

Thanks for your relpy Nic..
Manually deleting 500+ workflows and screens that are unused is a very tedius process. I wanted to know the other options to achieve this.

Can you please help with this.

 

-Deepa

This widget could not be displayed.

For inactive workflow you can use  below script

Line commented will delete the inactive workflow, please uncomment if you want to delete

Workflow deletion

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

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

112 views 2 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