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
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()
Is there any script to do the same with unused Field Configuration Schemes, Field Configurations and Fields?
Also, with Unused Issue Types Schemes and Issue Types.
Thanks in advance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you very much.
Is there any script to delete unused Field Configuration Schemes, Field Configurations and Fields?
Also, Unused Issue Types Schemes and Issue Types.
Thanks in advance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Inactive IssueType Screen Schemes Deletion scripts:
import com.atlassian.jira.component.ComponentAccessor
def schemeManager = ComponentAccessor.issueTypeScreenSchemeManager
def sb = new StringBuffer()
sb.append("Deleted issue type screen schemes with no associated projects:<br/><br/>\n")
schemeManager.issueTypeScreenSchemes.each {
try{
if(it.projects.size() == 0) {
sb.append("${it.name}\n")
//schemeManager.removeIssueTypeScreenScheme(it);
}
}
catch(Exception e) {
//noop
sb.append("Error: " + e + "\n");
}
}
return sb.toString()
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Inactive Screen Schemes Deletion scripts:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.fields.screen.FieldScreenSchemeManager
def fssm = ComponentAccessor.getComponent(FieldScreenSchemeManager.class)
def itssm = ComponentAccessor.issueTypeScreenSchemeManager
def sb = new StringBuffer()
sb.append("Deleted screen schemes with no associated issue type screen schemes:<br/><br/>\n")
fssm.fieldScreenSchemes.each {
try{
if(itssm.getIssueTypeScreenSchemes(it).size() == 0) {
// fssm.removeFieldScreenScheme(it);
sb.append("${it.name}\n");
}
}
catch(Exception e) {
//noop
//sb.append("Error: " + e + "\n");
}
}
return sb.toString()
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Ahsan Please you can enhance the above script.
Dont forgot to vote if you like it
You can also try Jira Cleaner plugin we are using now which tell us about all the entities not in used , I can say this plugin is very handy for cleanup
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>since we have many schemes which cannot be done manually
All schemes can be done "manually". I don't understand what you mean here.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.
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.