<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: How to use Assignment Rules with Schedules in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/how-to-use-assignment-rules-with-schedules/m-p/1390500#M47426</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Sorry for late answer.&lt;/P&gt;
&lt;P&gt;I tried something as below with due date for testing. you can change it to creation date.&lt;/P&gt;
&lt;P&gt;var date = new GlideDateTime(current.due_date);&lt;BR /&gt;var schedule = new GlideSchedule("08fcd0830a0a0b2600079f56b1adb9ae");&lt;BR /&gt;var flag = schedule.isInSchedule(date);&lt;BR /&gt;gs.log(flag,'ScheduleCheck');&lt;BR /&gt;if(flag == true){&lt;BR /&gt;current.assignment_group.setDisplayValue("Hardware"); &lt;BR /&gt;}else{&lt;BR /&gt;var date = new GlideDateTime(current.due_date);&lt;BR /&gt;var schedule = new GlideSchedule("7b2af55ddbe814108844e1bb4b961953");&lt;BR /&gt;var flagNew = schedule.isInSchedule(date);&lt;BR /&gt;gs.log(flagNew ,'ScheduleCheck');&lt;BR /&gt;if(flagNew == true){&lt;BR /&gt;current.assignment_group.setDisplayValue("Software"); &lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This are my schedule sys id and groups name please change those.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Ashutosh&lt;/P&gt;</description>
    <pubDate>Sat, 02 May 2020 10:00:34 GMT</pubDate>
    <dc:creator>Ashutosh Munot1</dc:creator>
    <dc:date>2020-05-02T10:00:34Z</dc:date>
    <item>
      <title>How to use Assignment Rules with Schedules</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-use-assignment-rules-with-schedules/m-p/1390496#M47422</link>
      <description>&lt;P&gt;I have two assignment rules set up that control the group assignment of certain incidents based on the conditions of business and non-business hours.&amp;nbsp; Assignment rule A has conditions to assign the incident to Team A during business hours.&amp;nbsp; Assignment rule B has conditions to assign the incident to Team B during non-business hours.&amp;nbsp; I would take this a step further and incorporate our holiday schedule in ServiceNow into these assignment rules so if an incident comes in during business hours that is also a holiday, the incident is assigned to Team B rather than Team A.&amp;nbsp; ServiceNow HI says this is not possible in OOB assignment rules.&amp;nbsp; So I’m reaching out to the Community to see if anyone has come up with a solution for this.&amp;nbsp;&amp;nbsp; Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 18:15:14 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-use-assignment-rules-with-schedules/m-p/1390496#M47422</guid>
      <dc:creator>chrish5</dc:creator>
      <dc:date>2020-04-30T18:15:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Assignment Rules with Schedules</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-use-assignment-rules-with-schedules/m-p/1390497#M47423</link>
      <description>&lt;P&gt;Hi Chrish,&lt;/P&gt;
&lt;P&gt;I think on-call scheduling will fit into this requirement, can you below link:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.servicenow.com/bundle/madrid-release-notes/page/release-notes/it-service-management/on-call-scheduling-rn.html" rel="nofollow"&gt;https://docs.servicenow.com/bundle/madrid-release-notes/page/release-notes/it-service-management/on-call-scheduling-rn.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 18:50:15 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-use-assignment-rules-with-schedules/m-p/1390497#M47423</guid>
      <dc:creator>Gowrisankar Sat</dc:creator>
      <dc:date>2020-04-30T18:50:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Assignment Rules with Schedules</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-use-assignment-rules-with-schedules/m-p/1390498#M47424</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;We have to script in script field of the Assignment rule for this. Do you have a schedule created for this? like 8*5 weekdays and including holidays.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Ashutosh&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 19:18:52 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-use-assignment-rules-with-schedules/m-p/1390498#M47424</guid>
      <dc:creator>Ashutosh Munot1</dc:creator>
      <dc:date>2020-04-30T19:18:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Assignment Rules with Schedules</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-use-assignment-rules-with-schedules/m-p/1390499#M47425</link>
      <description>&lt;P&gt;Hi Ashutosh,&lt;/P&gt;
&lt;P&gt;Yes, we have a schedule.&amp;nbsp; Can you provide an example of the script you use for this?&amp;nbsp; That would be very helpful.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Chris&lt;/P&gt;
&lt;H5&gt;&amp;nbsp;&lt;/H5&gt;</description>
      <pubDate>Thu, 30 Apr 2020 23:38:53 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-use-assignment-rules-with-schedules/m-p/1390499#M47425</guid>
      <dc:creator>chrish5</dc:creator>
      <dc:date>2020-04-30T23:38:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Assignment Rules with Schedules</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-use-assignment-rules-with-schedules/m-p/1390500#M47426</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Sorry for late answer.&lt;/P&gt;
&lt;P&gt;I tried something as below with due date for testing. you can change it to creation date.&lt;/P&gt;
&lt;P&gt;var date = new GlideDateTime(current.due_date);&lt;BR /&gt;var schedule = new GlideSchedule("08fcd0830a0a0b2600079f56b1adb9ae");&lt;BR /&gt;var flag = schedule.isInSchedule(date);&lt;BR /&gt;gs.log(flag,'ScheduleCheck');&lt;BR /&gt;if(flag == true){&lt;BR /&gt;current.assignment_group.setDisplayValue("Hardware"); &lt;BR /&gt;}else{&lt;BR /&gt;var date = new GlideDateTime(current.due_date);&lt;BR /&gt;var schedule = new GlideSchedule("7b2af55ddbe814108844e1bb4b961953");&lt;BR /&gt;var flagNew = schedule.isInSchedule(date);&lt;BR /&gt;gs.log(flagNew ,'ScheduleCheck');&lt;BR /&gt;if(flagNew == true){&lt;BR /&gt;current.assignment_group.setDisplayValue("Software"); &lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This are my schedule sys id and groups name please change those.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Ashutosh&lt;/P&gt;</description>
      <pubDate>Sat, 02 May 2020 10:00:34 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-use-assignment-rules-with-schedules/m-p/1390500#M47426</guid>
      <dc:creator>Ashutosh Munot1</dc:creator>
      <dc:date>2020-05-02T10:00:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Assignment Rules with Schedules</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-use-assignment-rules-with-schedules/m-p/1390501#M47427</link>
      <description>&lt;P&gt;Ashutosh,&lt;/P&gt;
&lt;P&gt;With just a little change to the code, I was able to use this and it works great.&lt;/P&gt;
&lt;P&gt;I appreciate your assistance!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2020 12:42:26 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-use-assignment-rules-with-schedules/m-p/1390501#M47427</guid>
      <dc:creator>chrish5</dc:creator>
      <dc:date>2020-05-13T12:42:26Z</dc:date>
    </item>
  </channel>
</rss>

