Skip to content

Instantly share code, notes, and snippets.

@iaindooley
Last active September 7, 2019 02:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save iaindooley/531239aac98711c8b56b75fd86fa7593 to your computer and use it in GitHub Desktop.
Save iaindooley/531239aac98711c8b56b75fd86fa7593 to your computer and use it in GitHub Desktop.
Full audit trail
function fullAuditTrail(notification)
{
var notif = new Notification(notification);
var card = notif.card();
try
{
var sheet = SpreadsheetApp.openByUrl(card.attachment("Full Audit Trail").link()).getSheetByName("Actions Log");
}
catch(e)
{
Notification.expectException(InvalidDataException,e);
var file = SpreadsheetApp.create("Full Audit Trail "+card.id());
card.attachLink({link: file.getUrl(),name: "Full Audit Trail"});
var sheet = file.insertSheet("Actions Log");
}
sheet.appendRow([Trellinator.now(),notif.member().name(),notif.notification.action.display.translationKey,JSON.stringify(notif.notification.action.display.entities)]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment