Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function ck() {
- //assigning variables
- var ss = SpreadsheetApp.getActiveSpreadsheet();
- var sheet = ss.getActiveSheet();
- var lastrow = ss.getLastRow();
- var valsr7 = sheet.getRange(lastrow, 3).getValue();
- var valsr30 = sheet.getRange(lastrow, 4).getValue();
- var valsrn = sheet.getRange(lastrow, 5).getValue();
- var valINC7 = sheet.getRange(lastrow, 6).getValue();
- var valINC30 = sheet.getRange(lastrow, 7).getValue();
- var valINCn = sheet.getRange(lastrow, 8).getValue();
- var service = sheet.getRange(lastrow, 2).getValue();
- var now = new Date();
- var wk = now.getWeek();
- //now assigning values to variable
- var A = valsr7;
- var B = valsr30;
- var C = valsrn;
- var D = valINC7;
- var E = valINC30;
- var F = valINCn;
- var AB = AB;
- if (service == 'Global-Servicenow-Support-T2' && A ==0 && B == 0 ){
- MailApp.sendEmail({
- to: "prathamesh.padosakar.ext@lafargeholcim.com",
- subject : "Open Tickets Global-C&k-T2 - Week-"+wk+"",
- htmlBody: "Dear ABC, "+
- "<p>Not assigned to any one = "+C+""+
- "<P>   "+" "+
- "<p>Not updated more than 7 Days = "+D+" "+
- "<p>Not Updated more than 30 Days = "+E+""+
- "<p>Not assigned to any one = "+F+""+
- "<p>   "+" "+
- "<p>Best Regards,"+
- "<br>Global Service Desk "+,
- cc: "techno.pratham94@gmail.com"})
- }
- if(service == 'Global-Servicenow-Support-T2' && A == 0){
- MailApp.sendEmail({
- to: "prathamesh.padosakar.ext@lafargeholcim.com",
- subject : "Open Tickets Global-C&k-T2 - Week-"+wk+"",
- htmlBody: "Dear ABC, "+
- "<p>Not Updated more than 30 Days = "+B+""+
- "<p>Not assigned to any one = "+C+""+
- "<P>   "+" "+
- "<p>Not updated more than 7 Days = "+D+" "+
- "<p>Not Updated more than 30 Days = "+E+""+
- "<p>Not assigned to any one = "+F+""+
- "<p>   "+" "+
- "<p>Best Regards,"+
- "<br>Global Service Desk "+,
- cc: "techno.pratham94@gmail.com"
- });
- }
- else {
- }
- if(service == 'Global-Servicenow-Support-T2' && B == 0){
- MailApp.sendEmail({
- to: "prathamesh.padosakar.ext@lafargeholcim.com",
- subject : "Open Tickets Global-C&k-T2 - Week-"+wk+"",
- htmlBody: "Dear ABC, "+
- "<p>Not updated more than 7 Days = "+A+" "+
- "<p>Not assigned to any one = "+C+""+
- "<P>   "+" "+
- "<p>Not updated more than 7 Days = "+D+" "+
- "<p>Not Updated more than 30 Days = "+E+""+
- "<p>Not assigned to any one = "+F+""+
- "<p>   "+" "+
- "<p>Best Regards,"+
- "<br>Global Service Desk "+,
- cc: "techno.pratham94@gmail.com"
- });
- }
- enter code here
- else {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement