Skip to content

Instantly share code, notes, and snippets.

@iaindooley
Created April 19, 2019 08:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iaindooley/6f770088101f269bc33f35c97aea73ce to your computer and use it in GitHub Desktop.
Save iaindooley/6f770088101f269bc33f35c97aea73ce to your computer and use it in GitHub Desktop.
Notify with attachments
function notifyWithAttachments(notification)
{
var card = new Notification(notification).addedCard("Internal review");
try
{
card.postComment("@board ready for review. Here are the attachments\n\n"+card.attachments().find(function(att)
{
return att.link();
}).asArray().join("\n"));
}
catch(e)
{
Notification.expectException(InvalidDataException,e);
card.postComment("@board card ready for review, no attachments present!");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment