Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Bulk delete attachments

Deleted user February 7, 2019

I used the Teamgantt plugin to create a roadmap from Trello. I've been trying to disable and reset the plugin but it's left disconnected attachments in Trello on my cards.

Anyone know of a way to bulk delete them? Otherwise I've got to manually delete from more than 150 cards to reset Teamgantt :-(

 

1 answer

0 votes
Iain Dooley
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 7, 2019

@[deleted] Hi Jamie, you'd need to do this using the API. In Trellinator, the code would look like this:

function removeAllAttachments()

{

  new Trellinator().boards("My Board").cards().each(function(card)

  {

    card.attachments().each(function(att)

    {

        att.remove();

    });

  });

}

You can see how to install and run this code using the Trellinator setup guide:

https://community.atlassian.com/t5/Marketplace-Apps-articles/Introducing-Trellinator-Automate-Trello-with-Google-Apps-Script/ba-p/925271

Whether or not figuring this out will be faster than manually deleting the attachments will depend on how many attachments you have, but the plus side would be that you'd be able to take advantage of simpler API automations in future too :)

Deleted user February 11, 2019

Thanks dude. I'll give that a go. Need to figure out how to pass a specific type of attachment to the function so it doesn't delete literally every attachment.

I'll check the docs.

Iain Dooley
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 12, 2019

@[deleted] you'd need to do something like:

if(/.*pattern.*/.test(att.name())

    att.remove();

 

where .*pattern.* is some regular expression matching attachments you want to delete. They all show up as links in the Trello API, but with the original file names so for example you could delete all PDF files with:

.*\.pdf

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events