How to schedule incident every Third Tuesday of each month??? I tried doing it by "Scheduler" and Trigger Type - "Week in month" but it's next action always gives a Monday date .

Sjoshi2
Mega Contributor

Do I have to check "glide.schedules.repeat_nth" property and set it to Day??

I also wrote this script:

var now = New DateTime();

var day = now.getDay();

gs.log("Day is :" + " " +day);

if( day == 3)

{

var rec1 = new GlideRecord("incident");

rec1.initialize();

rec1.applyTemplate("Test");

rec1.insert();

}

1 ACCEPTED SOLUTION

ghsrikanth
Tera Guru

Hi Shreya,



Please find the script to be written in conditional, this should work -



function checkThirdTuesday(workDay){


      var ordinals = ["", "1", "2", "3", "4", "5"];


      var date = String(new Date());


      var tokens = date.split(" ");




      var floatNumber = ordinals[Math.ceil(tokens[2]/7)];


      var weekDay = tokens[0];


     


      if(floatNumber == "3" && weekDay == workDay)


                    result = true;


      else


                    result = false;


      return result;


}



checkThirdTuesday('Tue');




Hopefully it helps


View solution in original post

18 REPLIES 18

I don't find this option anywhere.. Could you attach a screenshot??


Hi dan.bruhn , could you please help the user in marking the answer as correct.


Hi Srikanth,



I've updated the discussion.



Thanks,



Dan


Thanks Dan


Is "glide.schedules.repeat_nth " property works for this script you have mentioned above?? Day or week?? Does this relate while executing this script??