diff --git a/src/webhook.js b/src/webhook.js new file mode 100644 index 0000000..57ea498 --- /dev/null +++ b/src/webhook.js @@ -0,0 +1,23 @@ +// Handle only webhook events +export const handler = async (event, context) => { + console.log("Event: ", event); + console.log("Context: ", context); + const { changelog } = event; + console.log("Changelog: ", changelog); + + if (event.type === "avi:jira:created:issue") { + return handleIssueCreated(event); + } + + if (event.type === "avi:jira:updated:issue") { + return handleIssueUpdated(event); + } +}; + +const handleIssueCreated = async (event) => { + console.log("Issue created"); +}; + +const handleIssueUpdated = async (event) => { + console.log("Issue updated"); +};