Skip to content

Instantly share code, notes, and snippets.

Last active Mar 25, 2021
What would you like to do?
function onFormSubmit(e) {
const headers = {
outline: "Outline",
expected: "What's the expected result?",
actual: "What's the actual result?",
howToReproduce: "Steps to reproduce the issue",
details: "Additional details",
email: "Email Address",
const title = e.namedValues[headers.outline][0];
const body = Object.entries(headers).map(([k, v]) => `## ${k}\n${e.namedValues[v][0]}\n`).join("\n");
const token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
const options = {
"method": "POST",
"contentType": "application/json",
"muteHttpExceptions": true,
"headers": {
"Authorization": "token " + token,
"Accept": "application/vnd.github.v3+json"
"payload": JSON.stringify({ title, body })
const url = "";
UrlFetchApp.fetch(url, options);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment