Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iaindooley/39fc9e9b0812ab42ceb976e704fa968e to your computer and use it in GitHub Desktop.
Save iaindooley/39fc9e9b0812ab42ceb976e704fa968e to your computer and use it in GitHub Desktop.
Invite member and add to cards
function inviteMemberAndAddToCards(notification)
{
var changed = new Notification(notification).changedCustomFieldValue();
if(changed.card().currentList().name() == "Role Cards")
{
var member = new Member({username: changed.value()});
changed.card().board().addMember(member);
changed.card().board().cards().each(function(card)
{
try
{
card.label(changed.name());
card.addMember(member);
}
catch(e)
{
Notification.expectException(InvalidDataException,e);
}
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment