0

1)我正在尝试创建一个完整的脚本,该脚本将从谷歌表单/谷歌表中获取输入数据,并将第一行用作 Freshdesk 票证的字段名称,同时将最后一行(最新)作为要输入的数据门票数据..

2)我已经对 onFormSubmit 部分进行了编码,因此它创建了一般票证,但是我会将来自后端的数据用作某些字段数据

function onFormSubmit(e) {
    if ((typeof GasFreshdesk)==='undefined') {
        eval(UrlFetchApp.fetch('https://raw.githubusercontent.com/zixia/gas-freshdesk/master/src/gas-freshdesk-lib.js').getContentText())
    }
    var MyFreshdesk = new GasFreshdesk('https://***.freshdesk.com', 'API KEY'); // REPLACE redacted with real key

    // Custom fields passed in. Use this for now - to test (then replace later with other valid values).
   var customFields = {"email": "firstnamelastname@org.org",
                        "room": "IT",
                        "building": "**",
                        "devicesystem": "Device",
                        "problem": "problem"

    };

    var ticket = new MyFreshdesk.Ticket({description: "We have provided you with a loaner",
                                                       subject: "** - Device - Problem- " + "FullName", email: "firstnamelastname@org.org",
                                                               type: "Support Request", custom_fields: customFields});
                                                             }

我正在寻找的是一种获取最后一行数据中的值的方法,因为该数据需要输入到票证中。

  function LastRow() {
   var ss= SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Form Responses 1");
  var lr = getLastRow();


  Logger.log(lr);
}
4

0 回答 0