<?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: Set RITM to Pending if any linked SCTask is set to Pending in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/set-ritm-to-pending-if-any-linked-sctask-is-set-to-pending/m-p/2827743#M1083973</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please paste both the scripts here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
    <pubDate>Thu, 15 Feb 2024 05:00:45 GMT</pubDate>
    <dc:creator>Lavanya Marella</dc:creator>
    <dc:date>2024-02-15T05:00:45Z</dc:date>
    <item>
      <title>Set RITM to Pending if any linked SCTask is set to Pending</title>
      <link>https://www.servicenow.com/community/developer-forum/set-ritm-to-pending-if-any-linked-sctask-is-set-to-pending/m-p/2483555#M968612</link>
      <description>&lt;P&gt;I need for the linked RITM to be set to 'Pending' when any of the associated SCTasks are set to 'Pending'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When none of the associated SCTasks are pending, the RITM needs to move back to 'Work in Progress'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone help please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2023 16:37:33 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/set-ritm-to-pending-if-any-linked-sctask-is-set-to-pending/m-p/2483555#M968612</guid>
      <dc:creator>steveturley</dc:creator>
      <dc:date>2023-02-20T16:37:33Z</dc:date>
    </item>
    <item>
      <title>Re: Set RITM to Pending if any linked SCTask is set to Pending</title>
      <link>https://www.servicenow.com/community/developer-forum/set-ritm-to-pending-if-any-linked-sctask-is-set-to-pending/m-p/2483582#M968615</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/103576"&gt;@steveturley&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Scenaro -1 :&lt;/P&gt;&lt;P&gt;you can write After business rule on SCTask table&lt;/P&gt;&lt;P&gt;conditions&amp;nbsp;&lt;/P&gt;&lt;P&gt;SCTask state changes to pending and&lt;/P&gt;&lt;P&gt;request_item. state is not pending&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;on insert and update&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in advanced script&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var gr = new GlideRecord('sc_req_item');&lt;/P&gt;&lt;P&gt;gr.get(current.request_item);&lt;/P&gt;&lt;P&gt;gr.state = 'pending';// replace back end value mostly it will be numeric value&lt;/P&gt;&lt;P&gt;gr.update();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Scenario 2:&lt;/P&gt;&lt;P&gt;After BR on SCTask table&amp;nbsp;&lt;/P&gt;&lt;P&gt;Conditions&lt;/P&gt;&lt;P&gt;State changes from pending&lt;/P&gt;&lt;P&gt;and request_item.state is not WIP&lt;/P&gt;&lt;P&gt;On insert and update&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in advance Script&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var task = new GlideRecord('sc_task');&lt;/P&gt;&lt;P&gt;task.addQuery('request_item',current.request_item);&lt;/P&gt;&lt;P&gt;task.addQuery('state','!=','pending');// replace back end value mostly it will be numeric value&lt;/P&gt;&lt;P&gt;task.query();&lt;/P&gt;&lt;P&gt;if(task.next()){&lt;/P&gt;&lt;P&gt;//do nothing&lt;/P&gt;&lt;P&gt;}else{&lt;/P&gt;&lt;P&gt;var gr = new GlideRecord('sc_req_item');&lt;/P&gt;&lt;P&gt;gr.get(current.request_item);&lt;/P&gt;&lt;P&gt;gr.state = 'WIP';// replace back end value mostly it will be numeric value&lt;/P&gt;&lt;P&gt;gr.update();&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2023 16:58:48 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/set-ritm-to-pending-if-any-linked-sctask-is-set-to-pending/m-p/2483582#M968615</guid>
      <dc:creator>BharathChintala</dc:creator>
      <dc:date>2023-02-20T16:58:48Z</dc:date>
    </item>
    <item>
      <title>Re: Set RITM to Pending if any linked SCTask is set to Pending</title>
      <link>https://www.servicenow.com/community/developer-forum/set-ritm-to-pending-if-any-linked-sctask-is-set-to-pending/m-p/2484324#M968924</link>
      <description>&lt;P&gt;Hi, thanks for the reply&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Scenario 1 works perfectly - thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Scenario 2 doesn't work at the moment. I change the sc_task state from 'pending' but the RITM state doesn't change.&lt;/P&gt;&lt;P&gt;I amended the values for 'pending' &amp;amp; 'WIP'. Screenshot attached&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2023 10:38:54 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/set-ritm-to-pending-if-any-linked-sctask-is-set-to-pending/m-p/2484324#M968924</guid>
      <dc:creator>steveturley</dc:creator>
      <dc:date>2023-02-21T10:38:54Z</dc:date>
    </item>
    <item>
      <title>Re: Set RITM to Pending if any linked SCTask is set to Pending</title>
      <link>https://www.servicenow.com/community/developer-forum/set-ritm-to-pending-if-any-linked-sctask-is-set-to-pending/m-p/2484471#M968992</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/103576"&gt;@steveturley&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After BR on SCTask table&amp;nbsp;&lt;/P&gt;&lt;P&gt;Conditions&lt;/P&gt;&lt;P&gt;State changes from pending&lt;/P&gt;&lt;P&gt;and request_item.state is not WIP&lt;/P&gt;&lt;P&gt;On insert and update&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in advance Script&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var task = new GlideRecord('sc_task');&lt;/P&gt;&lt;P&gt;task.addQuery('request_item',current.request_item);&lt;/P&gt;&lt;P&gt;task.addQuery('state','-5');// replace back end value mostly it will be numeric value&lt;/P&gt;&lt;P&gt;task.query();&lt;/P&gt;&lt;P&gt;if(task.next()){&lt;/P&gt;&lt;P&gt;//do nothing&lt;/P&gt;&lt;P&gt;}else{&lt;/P&gt;&lt;P&gt;var gr = new GlideRecord('sc_req_item');&lt;/P&gt;&lt;P&gt;gr.get(current.request_item);&lt;/P&gt;&lt;P&gt;gr.state = 'WIP';// replace back end value mostly it will be numeric value&lt;/P&gt;&lt;P&gt;gr.update();&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My bad that should be not != just pending try above code&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2023 12:03:45 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/set-ritm-to-pending-if-any-linked-sctask-is-set-to-pending/m-p/2484471#M968992</guid>
      <dc:creator>BharathChintala</dc:creator>
      <dc:date>2023-02-21T12:03:45Z</dc:date>
    </item>
    <item>
      <title>Re: Set RITM to Pending if any linked SCTask is set to Pending</title>
      <link>https://www.servicenow.com/community/developer-forum/set-ritm-to-pending-if-any-linked-sctask-is-set-to-pending/m-p/2484698#M969083</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/347255"&gt;@BharathChintala&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I replaced the code but it doesn't work unfortunately. The RITM remains in state 'pending'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2023 14:14:51 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/set-ritm-to-pending-if-any-linked-sctask-is-set-to-pending/m-p/2484698#M969083</guid>
      <dc:creator>steveturley</dc:creator>
      <dc:date>2023-02-21T14:14:51Z</dc:date>
    </item>
    <item>
      <title>Re: Set RITM to Pending if any linked SCTask is set to Pending</title>
      <link>https://www.servicenow.com/community/developer-forum/set-ritm-to-pending-if-any-linked-sctask-is-set-to-pending/m-p/2484739#M969099</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/347255"&gt;@BharathChintala&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Apologies!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I replaced your code but didn't change the 'WIP' value. I have done so now and it works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks! Really appreciate your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2023 14:48:11 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/set-ritm-to-pending-if-any-linked-sctask-is-set-to-pending/m-p/2484739#M969099</guid>
      <dc:creator>steveturley</dc:creator>
      <dc:date>2023-02-21T14:48:11Z</dc:date>
    </item>
    <item>
      <title>Re: Set RITM to Pending if any linked SCTask is set to Pending</title>
      <link>https://www.servicenow.com/community/developer-forum/set-ritm-to-pending-if-any-linked-sctask-is-set-to-pending/m-p/2827743#M1083973</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please paste both the scripts here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2024 05:00:45 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/set-ritm-to-pending-if-any-linked-sctask-is-set-to-pending/m-p/2827743#M1083973</guid>
      <dc:creator>Lavanya Marella</dc:creator>
      <dc:date>2024-02-15T05:00:45Z</dc:date>
    </item>
  </channel>
</rss>

