<?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 Using RITM variables in workflow in ITSM forum</title>
    <link>https://www.servicenow.com/community/itsm-forum/using-ritm-variables-in-workflow/m-p/700772#M272551</link>
    <description>&lt;P&gt;I have an catalog item with various variables.&lt;/P&gt;
&lt;P&gt;Two of them are pulldowns of people in specific user groups.&lt;/P&gt;
&lt;P&gt;Let's call the first pulldown variable:&amp;nbsp; user1&amp;nbsp; &amp;nbsp;(user1 is in a group called "FirstGroup")&lt;/P&gt;
&lt;P&gt;Let's call the second pulldown variable user2.&amp;nbsp; (user2 is in a group called "SecondGroup")&lt;/P&gt;
&lt;P&gt;I want to make "user1" my approver in the workflow.&lt;/P&gt;
&lt;P&gt;After the approval step, I want to create an SCTASK and assign it to Group "SecondGroup" and also specifically to "user2".&lt;/P&gt;
&lt;P&gt;What's the best way to do this in my workflow?&lt;/P&gt;</description>
    <pubDate>Mon, 19 Oct 2020 19:08:30 GMT</pubDate>
    <dc:creator>Joe Taylor</dc:creator>
    <dc:date>2020-10-19T19:08:30Z</dc:date>
    <item>
      <title>Using RITM variables in workflow</title>
      <link>https://www.servicenow.com/community/itsm-forum/using-ritm-variables-in-workflow/m-p/700772#M272551</link>
      <description>&lt;P&gt;I have an catalog item with various variables.&lt;/P&gt;
&lt;P&gt;Two of them are pulldowns of people in specific user groups.&lt;/P&gt;
&lt;P&gt;Let's call the first pulldown variable:&amp;nbsp; user1&amp;nbsp; &amp;nbsp;(user1 is in a group called "FirstGroup")&lt;/P&gt;
&lt;P&gt;Let's call the second pulldown variable user2.&amp;nbsp; (user2 is in a group called "SecondGroup")&lt;/P&gt;
&lt;P&gt;I want to make "user1" my approver in the workflow.&lt;/P&gt;
&lt;P&gt;After the approval step, I want to create an SCTASK and assign it to Group "SecondGroup" and also specifically to "user2".&lt;/P&gt;
&lt;P&gt;What's the best way to do this in my workflow?&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2020 19:08:30 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/using-ritm-variables-in-workflow/m-p/700772#M272551</guid>
      <dc:creator>Joe Taylor</dc:creator>
      <dc:date>2020-10-19T19:08:30Z</dc:date>
    </item>
    <item>
      <title>Re: Using RITM variables in workflow</title>
      <link>https://www.servicenow.com/community/itsm-forum/using-ritm-variables-in-workflow/m-p/700773#M272552</link>
      <description>&lt;P&gt;In the Approval-User activity in workflow, use answer = current.variables.user1.&lt;/P&gt;
&lt;P&gt;To set assignment in Task, Use a Create Catalog Task activity and use following script&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;var grp = new GlideRecord('sys_user_group');&lt;/P&gt;
&lt;P&gt;grp.addQuery('user',current.variables.user2);&lt;/P&gt;
&lt;P&gt;grp.query();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if (grp.next())&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;task.assignment_group = grp.group;&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2020 19:13:55 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/using-ritm-variables-in-workflow/m-p/700773#M272552</guid>
      <dc:creator>SanjivMeher</dc:creator>
      <dc:date>2020-10-19T19:13:55Z</dc:date>
    </item>
    <item>
      <title>Re: Using RITM variables in workflow</title>
      <link>https://www.servicenow.com/community/itsm-forum/using-ritm-variables-in-workflow/m-p/700774#M272553</link>
      <description>&lt;P&gt;You can use "current.variables.FirstGroup" in the approval group activity&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/40407i912998510AD4ED8B/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Wwhich will trigger the approval likewise for the task&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/40408i7754F8334DE9E4EF/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2020 19:14:38 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/using-ritm-variables-in-workflow/m-p/700774#M272553</guid>
      <dc:creator>Subhanand</dc:creator>
      <dc:date>2020-10-19T19:14:38Z</dc:date>
    </item>
    <item>
      <title>Re: Using RITM variables in workflow</title>
      <link>https://www.servicenow.com/community/itsm-forum/using-ritm-variables-in-workflow/m-p/700775#M272554</link>
      <description>&lt;P&gt;Hi Sanjiv,&lt;/P&gt;
&lt;P&gt;Neither of these scripts worked for me.&lt;/P&gt;
&lt;P&gt;My actual user1 variable name is "hrbp".&lt;/P&gt;
&lt;P&gt;First of all, the approval is for a single user, not a group.&lt;/P&gt;
&lt;P&gt;So I&amp;nbsp; tried answer.push(current.variables.hrbp);&lt;/P&gt;
&lt;P&gt;This didn't work, so I tried an experiment to explictly assign this to someone:&lt;/P&gt;
&lt;P&gt;answer.push('b8fab8231ba60810afa40dc8cd4bcbdd');&lt;/P&gt;
&lt;P&gt;This didn't work either.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the task, my actual Group name is "HRD Group" and the user variable is "hrd".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;task.assignment_group = 'HRD Group';&lt;BR /&gt;task.assigned_to = 'current.variables.hrd';&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This didn't assign the task to the group nor the user.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2020 20:08:51 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/using-ritm-variables-in-workflow/m-p/700775#M272554</guid>
      <dc:creator>Joe Taylor</dc:creator>
      <dc:date>2020-10-19T20:08:51Z</dc:date>
    </item>
    <item>
      <title>Re: Using RITM variables in workflow</title>
      <link>https://www.servicenow.com/community/itsm-forum/using-ritm-variables-in-workflow/m-p/700776#M272555</link>
      <description>&lt;DIV class="hoverCardContainer lb-width ng-isolate-scope"&gt;
&lt;DIV class="userName username-width"&gt;&lt;SPAN class="ng-binding"&gt;Subhanand&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried both of your scripts as well and neither worked for me.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2020 20:10:04 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/using-ritm-variables-in-workflow/m-p/700776#M272555</guid>
      <dc:creator>Joe Taylor</dc:creator>
      <dc:date>2020-10-19T20:10:04Z</dc:date>
    </item>
    <item>
      <title>Re: Using RITM variables in workflow</title>
      <link>https://www.servicenow.com/community/itsm-forum/using-ritm-variables-in-workflow/m-p/700777#M272556</link>
      <description>&lt;P style="background: white;"&gt;&lt;SPAN style="font-family: 'Helvetica',sans-serif; color: #424e5b;"&gt;Sanjiv,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="background: white;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="background: white;"&gt;&lt;SPAN style="font-family: 'Helvetica',sans-serif; color: #424e5b;"&gt;I also tried these.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="background: white;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="background: white;"&gt;&lt;SPAN style="font-family: 'Helvetica',sans-serif; color: #424e5b;"&gt;var grp = new GlideRecord('sys_user_group');&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="background: white;"&gt;&lt;SPAN style="font-family: 'Helvetica',sans-serif; color: #424e5b;"&gt;grp.addQuery('user',current.variables.hrd);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="background: white;"&gt;&lt;SPAN style="font-family: 'Helvetica',sans-serif; color: #424e5b;"&gt;grp.query();&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="background: white;"&gt;&lt;SPAN style="font-family: 'Helvetica',sans-serif; color: #424e5b;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="background: white;"&gt;&lt;SPAN style="font-family: 'Helvetica',sans-serif; color: #424e5b;"&gt;if (grp.next())&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="background: white;"&gt;&lt;SPAN style="font-family: 'Helvetica',sans-serif; color: #424e5b;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="background: white;"&gt;&lt;SPAN style="font-family: 'Helvetica',sans-serif; color: #424e5b;"&gt;task.assignment_group = 'HRD Group';&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="background: white;"&gt;&lt;SPAN style="font-family: 'Helvetica',sans-serif; color: #424e5b;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2020 20:15:11 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/using-ritm-variables-in-workflow/m-p/700777#M272556</guid>
      <dc:creator>Joe Taylor</dc:creator>
      <dc:date>2020-10-19T20:15:11Z</dc:date>
    </item>
    <item>
      <title>Re: Using RITM variables in workflow</title>
      <link>https://www.servicenow.com/community/itsm-forum/using-ritm-variables-in-workflow/m-p/700778#M272557</link>
      <description>&lt;P&gt;If you want to add user as approver then you need to add below in script section of approval user activity.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;answer = [];
answer.push('b8fab8231ba60810afa40dc8cd4bcbdd');&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;to assign task, you need to do below&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;task.setDisplayValue('assignment_group', 'HRD Group');
task.assigned_to = current.variables.hrd;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 19 Oct 2020 20:19:38 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/using-ritm-variables-in-workflow/m-p/700778#M272557</guid>
      <dc:creator>Mike Patel</dc:creator>
      <dc:date>2020-10-19T20:19:38Z</dc:date>
    </item>
    <item>
      <title>Re: Using RITM variables in workflow</title>
      <link>https://www.servicenow.com/community/itsm-forum/using-ritm-variables-in-workflow/m-p/700779#M272558</link>
      <description>&lt;P&gt;If nothing works, can you try&lt;/P&gt;
&lt;P&gt;answer=current.variables.hrbp+'';&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and in task script&lt;/P&gt;
&lt;P&gt;task.assignment_group.setDisplayValue('HRD Group');&lt;BR /&gt;task.assigned_to = current.variables.hrd+'';&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2020 20:30:47 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/using-ritm-variables-in-workflow/m-p/700779#M272558</guid>
      <dc:creator>SanjivMeher</dc:creator>
      <dc:date>2020-10-19T20:30:47Z</dc:date>
    </item>
    <item>
      <title>Re: Using RITM variables in workflow</title>
      <link>https://www.servicenow.com/community/itsm-forum/using-ritm-variables-in-workflow/m-p/700780#M272559</link>
      <description>&lt;P&gt;Mike,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;I think you're on the right track here.&lt;/P&gt;
&lt;P&gt;Your script sucessfully assigned to the approval task to a specific person using their sys_id.&lt;/P&gt;
&lt;P&gt;Now I want to dynamically assign this approval to the RITM variable:&amp;nbsp; hrbp.&lt;/P&gt;
&lt;P&gt;(This is the name of a person in a group used in the pulldown.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Task Scrip also succesfully assigned to the group group, but did not assign to any user.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2020 20:48:19 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/using-ritm-variables-in-workflow/m-p/700780#M272559</guid>
      <dc:creator>Joe Taylor</dc:creator>
      <dc:date>2020-10-19T20:48:19Z</dc:date>
    </item>
    <item>
      <title>Re: Using RITM variables in workflow</title>
      <link>https://www.servicenow.com/community/itsm-forum/using-ritm-variables-in-workflow/m-p/700781#M272560</link>
      <description>&lt;P&gt;Sanjiv,&lt;/P&gt;
&lt;P&gt;This syntax is not being accepted.&lt;/P&gt;
&lt;P&gt;Are you sure you want me to put in the characters:&amp;nbsp; +"; at the end?&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2020 20:49:28 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/using-ritm-variables-in-workflow/m-p/700781#M272560</guid>
      <dc:creator>Joe Taylor</dc:creator>
      <dc:date>2020-10-19T20:49:28Z</dc:date>
    </item>
    <item>
      <title>Re: Using RITM variables in workflow</title>
      <link>https://www.servicenow.com/community/itsm-forum/using-ritm-variables-in-workflow/m-p/700782#M272561</link>
      <description>&lt;P&gt;use below for dynamic&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;answer = [];
answer.push(current.variables.hrbp.toString());&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;For task&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is your hrbp variables a reference field ? can you share screenshot?&lt;/P&gt;
&lt;P&gt;aslo try&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;task.setDisplayValue('assignment_group', 'HRD Group');
task.assigned_to = current.variables.hrd.toString();&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 19 Oct 2020 20:53:00 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/using-ritm-variables-in-workflow/m-p/700782#M272561</guid>
      <dc:creator>Mike Patel</dc:creator>
      <dc:date>2020-10-19T20:53:00Z</dc:date>
    </item>
    <item>
      <title>Re: Using RITM variables in workflow</title>
      <link>https://www.servicenow.com/community/itsm-forum/using-ritm-variables-in-workflow/m-p/700783#M272562</link>
      <description>&lt;P&gt;That worked great!&lt;/P&gt;
&lt;P&gt;Thanks so much for your help Mike.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2020 23:24:30 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/using-ritm-variables-in-workflow/m-p/700783#M272562</guid>
      <dc:creator>Joe Taylor</dc:creator>
      <dc:date>2020-10-19T23:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: Using RITM variables in workflow</title>
      <link>https://www.servicenow.com/community/itsm-forum/using-ritm-variables-in-workflow/m-p/700784#M272563</link>
      <description>&lt;P&gt;Adding a '' convert the value to string. But good that you got a solution.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2020 00:49:51 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/using-ritm-variables-in-workflow/m-p/700784#M272563</guid>
      <dc:creator>SanjivMeher</dc:creator>
      <dc:date>2020-10-20T00:49:51Z</dc:date>
    </item>
  </channel>
</rss>

