Created
November 6, 2015 20:15
-
-
Save vdavez/79e33b23b48d354130c2 to your computer and use it in GitHub Desktop.
Micro-purchase Google Apps Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function githubPost() { | |
var ss = SpreadsheetApp.openById(ssID) // replace the ssID with the Spreadsheet ID | |
var sheet = ss.getSheetByName("Form Responses 1"); | |
var formResponses = FormApp.getActiveForm().getResponses(); | |
var res = formResponses[formResponses.length-1].getItemResponses(); | |
var amt = res[0].getResponse(); | |
var title = "Load Schedule 70 data into CALC. >>> Current bid: " + amt + " <<<" | |
var payload = { | |
"title": title | |
} | |
var url = "https://api.github.com/repos/18f/calc/issues/255?access_token=" + ACCESS_TOKEN // Add the Github Access Token | |
var resp = UrlFetchApp.fetch(url, {method: "patch", payload: JSON.stringify(payload)}); | |
var bidItem = FormApp.getActiveForm().getItems()[0].setHelpText("Your bid may not exceed the lowest bid amount. Currently, the >>> lowest bid amount is $" + amt + "<<<.") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment