Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Delete all Organizations in a project via scriptrunner

Harald Mayer November 11, 2022

Hello all,

 

i messed up and created to many org in a project via jira extension for servicedesk.

Is it possible to delete all organizations without selecting all >250 and press delete? 

 

We got script runner in our system, but i am not an groovy expert. 

 

br

Harald

1 answer

1 accepted

1 vote
Answer accepted
Jamie Echlin _ScriptRunner - The Adaptavist Group_
Atlassian Partner
November 11, 2022

You can, do you want to remove them from a Service Desk, or permanently delete all organizations across all service desks?

Code is a bit complex though.

Assuming the former, you can use this: https://gist.github.com/jechlin-adaptavist/cf7c1d3aa67ec35fa6f985e5983d18ff

Paste that into Script Console and it will ask you which project to delete them from, and then Run.

It will delete ALL organizations. 

Harald Mayer November 14, 2022

Hey,

awesome - it works!

But it only deletes ~100 each run, but i dont care. 

 

thx!

Harald

Jamie Echlin _ScriptRunner - The Adaptavist Group_
Atlassian Partner
November 16, 2022

oh yeah, duh... basically it will delete about half the total number each run, until the total is less than 50, and then it will delete them all.

I'll fix it at some point. 

Suggest an answer

Log in or Sign up to answer