- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-30-2016 10:20 PM
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();
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-30-2016 11:08 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-31-2016 03:27 AM
I don't find this option anywhere.. Could you attach a screenshot??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-31-2016 03:32 AM
Hi dan.bruhn , could you please help the user in marking the answer as correct.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-31-2016 08:30 AM
Hi Srikanth,
I've updated the discussion.
Thanks,
Dan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-31-2016 08:33 AM
Thanks Dan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2016 02:38 AM
Is "glide.schedules.repeat_nth " property works for this script you have mentioned above?? Day or week?? Does this relate while executing this script??