Created
December 10, 2018 15:40
-
-
Save hachi-eiji/db6544f58e68e68663117f56a7ccfa17 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 showStatus(){ | |
var mySheet = SpreadsheetApp.getActiveSheet(); | |
var myCell = mySheet.getActiveCell(); | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
var ss_url = ss.getUrl(); | |
if(myCell.getColumn()==4){ | |
var message = myCell.getValue() + ss_url; | |
slackPost(message); | |
} | |
} | |
function slackPost(message){ | |
var url = 'https://slack.com/api/chat.postMessage'; | |
var token = 'URL'; | |
var channel = 'channel'; | |
var username = 'タスク更新通知BOT'; | |
var parse = 'full'; | |
var icon_emoji = ':tada:'; | |
var method = 'post'; | |
var payload = { | |
'token' : token, | |
'channel' : channel, | |
'text' : message + ' @mention', | |
'username' : username, | |
'parse' : parse, | |
'icon_emoji' : icon_emoji | |
}; | |
var params = { | |
'method' : method, | |
'payload' : payload | |
}; | |
var response = UrlFetchApp.fetch(url, params); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment