以下サイトを参考に、Spreadsheetを更新した際にSlackのIncoming Webhooksで投稿するというものを作っています。
https://businesschatmaster.com/slack/spreadsheet-change-notification
以下のpostText内のテキストを送信する際に「/remind」などのスラッシュコマンドを使用するにはどのように記述したらよいのでしょうか。
GAS
1/* 2** Slackに返す文字列を生成 3*/ 4function createSendMessage(){ 5var time = new Date(); 6var month = time.getMonth() + 1; 7var day = time.getDate(); 8var today = month + “月” + day + “日” 9var postText; 10 11var notifySheet = SpreadsheetApp.getActiveSpreadsheet(); 12 13//アクティブセルを取得する 14var myCell = notifySheet.getActiveCell(); 15//アクティブセルがD列の場合(仕事の進捗)のみ通知する 16if(myCell.getColumn() == 4){ 17var rowNum = myCell.getRow(); 18this.postText = 19“(” + today + “)ステータスの変更がありました\n” + 20“仕事名 :” + notifySheet.getRange(“B” + rowNum).getValue() + “\n” + 21“仕事量 :” + notifySheet.getRange(“C” + rowNum).getValue() + “\n” + 22“仕事の進捗:” + notifySheet.getRange(“D” + rowNum).getValue() + “\n” + 23“作業者 :” + notifySheet.getRange(“E” + rowNum).getValue() + “\n”; 24} 25}
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/04/17 09:49