Advertisement
Guest User

Untitled

a guest
Jul 5th, 2017
560
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.69 KB | None | 0 0
  1. function ck() {
  2.  
  3. //assigning variables
  4.  
  5. var ss = SpreadsheetApp.getActiveSpreadsheet();
  6. var sheet = ss.getActiveSheet();
  7. var lastrow = ss.getLastRow();
  8. var valsr7 = sheet.getRange(lastrow, 3).getValue();
  9. var valsr30 = sheet.getRange(lastrow, 4).getValue();
  10. var valsrn = sheet.getRange(lastrow, 5).getValue();
  11. var valINC7 = sheet.getRange(lastrow, 6).getValue();
  12. var valINC30 = sheet.getRange(lastrow, 7).getValue();
  13. var valINCn = sheet.getRange(lastrow, 8).getValue();
  14. var service = sheet.getRange(lastrow, 2).getValue();
  15. var now = new Date();
  16. var wk = now.getWeek();
  17.  
  18. //now assigning values to variable
  19. var A = valsr7;
  20. var B = valsr30;
  21. var C = valsrn;
  22. var D = valINC7;
  23. var E = valINC30;
  24. var F = valINCn;
  25. var AB = AB;
  26.  
  27. if (service == 'Global-Servicenow-Support-T2' && A ==0 && B == 0 ){
  28. MailApp.sendEmail({
  29. to: "prathamesh.padosakar.ext@lafargeholcim.com",
  30. subject : "Open Tickets Global-C&k-T2 - Week-"+wk+"",
  31. htmlBody: "Dear ABC, "+
  32.  
  33.  
  34. "<p>Not assigned to any one = "+C+""+
  35.  
  36.  
  37. "<P>&emsp;&emsp;&emsp;"+" "+
  38.  
  39. "<p>Not updated more than 7 Days = "+D+" "+
  40. "<p>Not Updated more than 30 Days = "+E+""+
  41. "<p>Not assigned to any one = "+F+""+
  42.  
  43.  
  44.  
  45. "<p>&emsp;&emsp;&emsp;"+" "+
  46. "<p>Best Regards,"+
  47. "<br>Global Service Desk "+,
  48. cc: "techno.pratham94@gmail.com"})
  49. }
  50.  
  51. if(service == 'Global-Servicenow-Support-T2' && A == 0){
  52.  
  53. MailApp.sendEmail({
  54. to: "prathamesh.padosakar.ext@lafargeholcim.com",
  55. subject : "Open Tickets Global-C&k-T2 - Week-"+wk+"",
  56. htmlBody: "Dear ABC, "+
  57.  
  58.  
  59. "<p>Not Updated more than 30 Days = "+B+""+
  60. "<p>Not assigned to any one = "+C+""+
  61.  
  62. "<P>&emsp;&emsp;&emsp;"+" "+
  63.  
  64. "<p>Not updated more than 7 Days = "+D+" "+
  65. "<p>Not Updated more than 30 Days = "+E+""+
  66. "<p>Not assigned to any one = "+F+""+
  67.  
  68.  
  69. "<p>&emsp;&emsp;&emsp;"+" "+
  70. "<p>Best Regards,"+
  71. "<br>Global Service Desk "+,
  72. cc: "techno.pratham94@gmail.com"
  73. });
  74.  
  75.  
  76. }
  77. else {
  78.  
  79. }
  80. if(service == 'Global-Servicenow-Support-T2' && B == 0){
  81. MailApp.sendEmail({
  82. to: "prathamesh.padosakar.ext@lafargeholcim.com",
  83. subject : "Open Tickets Global-C&k-T2 - Week-"+wk+"",
  84. htmlBody: "Dear ABC, "+
  85.  
  86. "<p>Not updated more than 7 Days = "+A+" "+
  87.  
  88. "<p>Not assigned to any one = "+C+""+
  89.  
  90. "<P>&emsp;&emsp;&emsp;"+" "+
  91.  
  92. "<p>Not updated more than 7 Days = "+D+" "+
  93. "<p>Not Updated more than 30 Days = "+E+""+
  94. "<p>Not assigned to any one = "+F+""+
  95.  
  96.  
  97. "<p>&emsp;&emsp;&emsp;"+" "+
  98. "<p>Best Regards,"+
  99. "<br>Global Service Desk "+,
  100.  
  101. cc: "techno.pratham94@gmail.com"
  102. });
  103.  
  104.  
  105. }
  106.  
  107.  
  108. enter code here
  109.  
  110. else {
  111.  
  112. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement