Last active
October 9, 2021 02:00
-
-
Save iaindooley/3a99a495e31bffbeb847ded9190da4d6 to your computer and use it in GitHub Desktop.
updateChecklists
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
var notif = new Notification(notification); | |
var added = notif.addedChecklistItem(); | |
if(!notif.member().notTrellinator())//don't react if the bot added the item | |
throw new InvalidActionException("Don't loop!"); | |
var added_to = added.checklist(); | |
var source_card = added_to.card(); | |
card.board().cards().each(function(card) | |
{ | |
if(card.id() != source_card.id()) | |
{ | |
try | |
{ | |
card.checklist(added_to.name()).addItem(added.name()); | |
} | |
catch(e) | |
{ | |
Notification.expectException(InvalidDataException,e); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment