Skip to content

Instantly share code, notes, and snippets.

@iaindooley
Last active May 5, 2020 06:08
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/d5764a26468977f58c394be4fcf2f6ae to your computer and use it in GitHub Desktop.
Save iaindooley/d5764a26468977f58c394be4fcf2f6ae to your computer and use it in GitHub Desktop.
Create Trello ticket from Webhook
function createTrelloTicketFromWebhook(notification)
{
var ret = false;
try
{
//the "notification" here is the Google Apps Script event object:
//https://developers.google.com/apps-script/guides/web
var msg = JSON.parse(notification.postData.contents);
//DO WHATEVER YOU WANT WITH YOUR CODE HERE
Card.create(new Trellinator().board("My Jira Synch").findOrCreateList("Inbox from Jira"),msg.name)
.setDescription(redactSensitiveContent(msg.description));
}
catch(e)
{
Trellinator.log("Not for us");
}
//RETURN TRUE IF WE PROCESSED THIS, FALSE IF WE DIDN'T
//MEANING SOMETHING ELSE SHOULD PROCESS IT
return ret;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment