Created
April 30, 2019 23:43
-
-
Save iaindooley/741872516f9ff3ab376701488a0c8e89 to your computer and use it in GitHub Desktop.
Remove trello attachments
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function removeTrelloAttachments(notification) | |
{ | |
new Notification(notification) | |
.addedCard() | |
.attachments(/https:\/\/trello-attachments.s3.amazonaws.com\/.*/) | |
.each(function(att) | |
{ | |
att.remove(); | |
}); | |
} |
Hi there, you can check out the full documentation for Trellinator here:
The above function will remove all file attachments from any card when it is added to any list. You could pass a list name (or regex) into the addedCard method to only trigger when cards are moved to certain lists.
You could also do something like:
if(notif.boardBefore().id() != notif.board().id())
meaning you can take the action only when a card is moved to this board from another board, rather than being moved between two lists in the same board.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hello I really liked your code, and I need to archive the list where the function is being performed after moving the card to another list.
A problem happens that I can't solve.
If I move a letter or chart (which contains important attachments) unintentionally back to the list containing automation these are all deleted.
Can you help me?
Sorry for my bad english, I'm learning.