Script Chef continues: Let's Cleanse our Teams

Hello, culinary code connoisseurs!

Welcome back to the kitchen for another session of ‘Script Chef’. Today, in part 2 of our series, we’re whipping up a new recipe designed to help you declutter and streamline your team management within your organization. So, get ready to cleanse your pallets with Clean UP.


  • A dash of resource management
  • A sprinkle of team coordination
  • A handful of project organization
  • A touch of Python scripting


  1. Gather Your Ingredients: Just as every great dish starts with the finest ingredients, we begin by assessing our resources, teams, and projects. Over time, clutter can accumulate, much like a pantry in need of a thorough clean-out.
  2. Start with a Clean Slate: Within our Treanisfex organizations, some projects have reached their flavorful conclusion and can be archived or deleted. Likewise, teams without active projects are akin to expired spices – it’s time to remove them from our lists.
  3. Clean and Organize: Just as a chef meticulously organizes their kitchen, we must tidy our workspace. Archive completed projects and remove any idle teams to maintain a streamlined and efficient environment.
  4. Automate the Mundane: Automation is our sous-chef, handling repetitive tasks with precision and efficiency. By harnessing the power of Python scripting, we can automate processes that would otherwise require manual effort, saving time and ensuring consistency.
  5. Enjoy the Results: With everything in its place and unnecessary clutter removed, our workspace is now neat, “pretty”, and ready for continued productivity and creativity.

What does the script do?

In simple steps :

  1. Authentication: It authenticates the user by setting up an API token.
  2. Retrieve Organization: It retrieves the organization using the organization’s slug.
  3. Identify Non-Empty Teams: It identifies teams that have at least one project by collecting their IDs.
  4. Delete Empty Teams: It iterates through all teams in the organization and deletes those that do not have any associated projects to them.

Why do you need this?

When we use a tool, we all have been in that spot were we are searching for something, and we go over a list with endless entries. We scroll and we scroll and the list goes on. And let’s face it. None of us wants to go over 100 teams or entries, check if they have any projects assigned and then delete them one by one. That is why we automated this for you.

If you are a manager or admin and you are handling too many projects and teams, this is a must-have tool.

Taste and Test: As with any new dish, we encourage you to take a taste! Try out this script and let us savor your feedback.

Season to Your Liking: Feel free to tweak the recipe, adding your own flair or suggesting enhancements. Your input helps us perfect our culinary creations.

Join the Culinary Conversation: Help us elevate our craft by joining the discussions in our community. Share your ideas, insights, and inspirations. Together, we can create a menu of features and improvements that delight and satisfy.

Bon Appétit! Let’s cook up something extraordinary, together.

1 Like