<?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 set / script an assignment group on sctask based on Catalog Item variable in ITSM forum</title>
    <link>https://www.servicenow.com/community/itsm-forum/how-to-set-script-an-assignment-group-on-sctask-based-on-catalog/m-p/891095#M460510</link>
    <description>&lt;P&gt;Coleton thanks for the reply!!&lt;/P&gt;
&lt;P&gt;That sounds really cool - any articles on how to do that?&lt;/P&gt;</description>
    <pubDate>Thu, 09 Aug 2018 21:17:57 GMT</pubDate>
    <dc:creator>jmonnette</dc:creator>
    <dc:date>2018-08-09T21:17:57Z</dc:date>
    <item>
      <title>How to set / script an assignment group on sctask based on Catalog Item variable</title>
      <link>https://www.servicenow.com/community/itsm-forum/how-to-set-script-an-assignment-group-on-sctask-based-on-catalog/m-p/891088#M460503</link>
      <description>&lt;P&gt;We have a "New Hire Request" catalog item.&lt;/P&gt;
&lt;P&gt;We have multiple help desk groups.&lt;/P&gt;
&lt;P&gt;We would like to assign a specific help desk group based on the location variable in the catalog item.&lt;/P&gt;
&lt;P&gt;Any help on this would be awesome!&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 19:24:00 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/how-to-set-script-an-assignment-group-on-sctask-based-on-catalog/m-p/891088#M460503</guid>
      <dc:creator>jmonnette</dc:creator>
      <dc:date>2018-08-08T19:24:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to set / script an assignment group on sctask based on Catalog Item variable</title>
      <link>https://www.servicenow.com/community/itsm-forum/how-to-set-script-an-assignment-group-on-sctask-based-on-catalog/m-p/891089#M460504</link>
      <description>&lt;P&gt;You can add a&amp;nbsp;business rule&amp;nbsp;on task&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;current.assignment_group = current.request_item.variables.location.group_field_name;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 19:28:34 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/how-to-set-script-an-assignment-group-on-sctask-based-on-catalog/m-p/891089#M460504</guid>
      <dc:creator>SanjivMeher</dc:creator>
      <dc:date>2018-08-08T19:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to set / script an assignment group on sctask based on Catalog Item variable</title>
      <link>https://www.servicenow.com/community/itsm-forum/how-to-set-script-an-assignment-group-on-sctask-based-on-catalog/m-p/891090#M460505</link>
      <description>&lt;P&gt;If your sctask created from workflow, in script section you can check the location and specify the required assignment group&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;For example:&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;if (current.variables.location == 'sys_id_location1') {
task.assignment_group = 'sys_id_group1';
} else if (current.variables.location == 'sys_id_location2') {
task.assignment_group = 'sys_id_group2';
}&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 19:34:22 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/how-to-set-script-an-assignment-group-on-sctask-based-on-catalog/m-p/891090#M460505</guid>
      <dc:creator>bardakov</dc:creator>
      <dc:date>2018-08-08T19:34:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to set / script an assignment group on sctask based on Catalog Item variable</title>
      <link>https://www.servicenow.com/community/itsm-forum/how-to-set-script-an-assignment-group-on-sctask-based-on-catalog/m-p/891091#M460506</link>
      <description>&lt;P&gt;Viktor - thanks for replying. Apprecaite your help!!&lt;/P&gt;
&lt;P&gt;You are correct this variable is from a catalog item that references the location.&lt;BR /&gt;The variable name is: nh_location&lt;/P&gt;
&lt;P&gt;The use case is:&lt;BR /&gt;We have a New Hire Request Catalog item that runs a worflow that create sctasks.&lt;BR /&gt;We have 96 Locations and 13 Help Desk Assignment Groups.&lt;BR /&gt;We need to associate a location with a help desk group for certain tasks.&lt;/P&gt;
&lt;P&gt;So would this be the correct script?&lt;/P&gt;
&lt;P&gt;if (current.variables.nh_location.getDisplayValue() == 'sys_id_location1') {&lt;BR /&gt;task.assignment_group = 'sys_id_group1';&lt;BR /&gt;if (current.variables.nh_location.getDisplayValue() == 'sys_id_location1') {&lt;BR /&gt;task.assignment_group = 'sys_id_group2';&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;or would it be this?&lt;/P&gt;
&lt;P&gt;if (current.variables.nh_location == 'sys_id_location1') {&lt;BR /&gt;task.assignment_group = 'sys_id_group1';&lt;BR /&gt;} else if (current.variables.nh_location == 'sys_id_location2') {&lt;BR /&gt;task.assignment_group = 'sys_id_group2';&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Also how can I write this script so that if multiple locations equal a certain helpdesk&lt;/P&gt;</description>
      <pubDate>Thu, 09 Aug 2018 00:44:58 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/how-to-set-script-an-assignment-group-on-sctask-based-on-catalog/m-p/891091#M460506</guid>
      <dc:creator>jmonnette</dc:creator>
      <dc:date>2018-08-09T00:44:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to set / script an assignment group on sctask based on Catalog Item variable</title>
      <link>https://www.servicenow.com/community/itsm-forum/how-to-set-script-an-assignment-group-on-sctask-based-on-catalog/m-p/891092#M460507</link>
      <description>&lt;P&gt;If these groups aren't changing, you could create a custom table to hold two specified fields: Assignment Group, Location. Then, based off whatever the user picks in the dropdown, query that table and grab the location correlated with that group.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Aug 2018 02:03:13 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/how-to-set-script-an-assignment-group-on-sctask-based-on-catalog/m-p/891092#M460507</guid>
      <dc:creator>Coleton</dc:creator>
      <dc:date>2018-08-09T02:03:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to set / script an assignment group on sctask based on Catalog Item variable</title>
      <link>https://www.servicenow.com/community/itsm-forum/how-to-set-script-an-assignment-group-on-sctask-based-on-catalog/m-p/891093#M460508</link>
      <description>&lt;P&gt;&lt;SPAN class="ng-scope"&gt;If these groups aren't changing, you could create a custom table to hold two specified fields: Assignment Group, Location. Then, based off whatever the user picks in the dropdown, query that table and grab the assignment group based off the location chosen.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Aug 2018 02:03:34 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/how-to-set-script-an-assignment-group-on-sctask-based-on-catalog/m-p/891093#M460508</guid>
      <dc:creator>Coleton</dc:creator>
      <dc:date>2018-08-09T02:03:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to set / script an assignment group on sctask based on Catalog Item variable</title>
      <link>https://www.servicenow.com/community/itsm-forum/how-to-set-script-an-assignment-group-on-sctask-based-on-catalog/m-p/891094#M460509</link>
      <description>&lt;P&gt;If you use "&lt;STRONG&gt;getDisplayValue()&lt;/STRONG&gt;", the correct&amp;nbsp;script will be:&lt;BR /&gt;&lt;BR /&gt;if (current.variables.nh_location.getDisplayValue() == '&lt;STRONG&gt;name_location1&lt;/STRONG&gt;') {&lt;BR /&gt;task.assignment_group = 'sys_id_group1';&lt;BR /&gt;if (current.variables.nh_location.getDisplayValue() == '&lt;STRONG&gt;name_location1&lt;/STRONG&gt;') {&lt;BR /&gt;task.assignment_group = 'sys_id_group2';&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If without&amp;nbsp;"&lt;STRONG&gt;getDisplayValue()&lt;/STRONG&gt;", correct&amp;nbsp; script:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;if (current.variables.nh_location == '&lt;STRONG&gt;sys_id_location1&lt;/STRONG&gt;') {&lt;BR /&gt;task.assignment_group = 'sys_id_group1';&lt;BR /&gt;} else if (current.variables.nh_location == '&lt;STRONG&gt;sys_id_location2&lt;/STRONG&gt;') {&lt;BR /&gt;task.assignment_group = 'sys_id_group2';&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;if multiple locations equal a certain helpdesk, your can be used&amp;nbsp;operator "&lt;STRONG&gt;OR&lt;/STRONG&gt;" -||&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Example:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;if (current.variables.nh_location == 'sys_id_location1' &lt;STRONG&gt;||&lt;/STRONG&gt; current.variables.nh_location == 'sys_id_location2') {&lt;BR /&gt;task.assignment_group = 'sys_id_group1';&lt;BR /&gt;} else if (current.variables.nh_location == 'sys_id_location3' &lt;STRONG&gt;||&lt;/STRONG&gt; current.variables.nh_location == 'sys_id_location4' &lt;STRONG&gt;||&lt;/STRONG&gt; current.variables.nh_location == 'sys_id_location5') {&lt;BR /&gt;task.assignment_group = 'sys_id_group2';&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Or there are many combinations, use &lt;A title="switch case" href="https://www.w3schools.com/js/js_switch.asp" target="_blank" rel="nofollow"&gt;switch case&lt;/A&gt; or&amp;nbsp;create a table of group and location mappings, and select the required group when accessing this table by location&lt;/P&gt;</description>
      <pubDate>Thu, 09 Aug 2018 02:28:23 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/how-to-set-script-an-assignment-group-on-sctask-based-on-catalog/m-p/891094#M460509</guid>
      <dc:creator>bardakov</dc:creator>
      <dc:date>2018-08-09T02:28:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to set / script an assignment group on sctask based on Catalog Item variable</title>
      <link>https://www.servicenow.com/community/itsm-forum/how-to-set-script-an-assignment-group-on-sctask-based-on-catalog/m-p/891095#M460510</link>
      <description>&lt;P&gt;Coleton thanks for the reply!!&lt;/P&gt;
&lt;P&gt;That sounds really cool - any articles on how to do that?&lt;/P&gt;</description>
      <pubDate>Thu, 09 Aug 2018 21:17:57 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/how-to-set-script-an-assignment-group-on-sctask-based-on-catalog/m-p/891095#M460510</guid>
      <dc:creator>jmonnette</dc:creator>
      <dc:date>2018-08-09T21:17:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to set / script an assignment group on sctask based on Catalog Item variable</title>
      <link>https://www.servicenow.com/community/itsm-forum/how-to-set-script-an-assignment-group-on-sctask-based-on-catalog/m-p/891096#M460511</link>
      <description>&lt;P&gt;Viktor that worked perfectly on the worflow sctasks!! Thank you!!!! quick question would it be better to create a business rule for each catalog item or better to write in the script in the workflow sctasks?&lt;/P&gt;</description>
      <pubDate>Thu, 09 Aug 2018 21:21:09 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/how-to-set-script-an-assignment-group-on-sctask-based-on-catalog/m-p/891096#M460511</guid>
      <dc:creator>jmonnette</dc:creator>
      <dc:date>2018-08-09T21:21:09Z</dc:date>
    </item>
  </channel>
</rss>

