<?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 HR task state change in HRSD forum</title>
    <link>https://www.servicenow.com/community/hrsd-forum/hr-task-state-change/m-p/1295503#M5766</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;We have a workflow in HR lifecycle events application scope, in which we are generating multiple HR tasks at a time under a HR case. One of the task, say task A, is set to be in a "pending" state when generated. This is configured in the workflow in the "create task" activity. This task is dependent on another task, say task B. When task B changes state to "closed complete", then task A should change state to "ready". We are trying to achieve this from the workflow using a "run script" activity after task B is closed. However, it is not working as required when we tested as impersonating the task assignee and closing task B. Task A continues to be in the "pending" state even after task B is closed when done like this. However, if we as system administrator closes the task B directly from the "state" field dropdown, then task A is getting updated to ready state. We are not sure why it is not happening if we impersonate as task assignee and closes task B.&lt;/P&gt;
&lt;P&gt;We also tried to achieve this using business rule in HR lifecycle events application, it is behaving the same way as when done via workflow.&lt;/P&gt;
&lt;P&gt;We also tried the same business rule in HR core application scope. However, it didn't work then as well.&lt;/P&gt;
&lt;P&gt;Could someone please suggest what could be the possible issue and solution?&lt;/P&gt;
&lt;P&gt;Thanks in advance,&lt;/P&gt;
&lt;P&gt;Anu&lt;/P&gt;</description>
    <pubDate>Fri, 24 Jan 2020 08:32:40 GMT</pubDate>
    <dc:creator>anusarma</dc:creator>
    <dc:date>2020-01-24T08:32:40Z</dc:date>
    <item>
      <title>HR task state change</title>
      <link>https://www.servicenow.com/community/hrsd-forum/hr-task-state-change/m-p/1295503#M5766</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;We have a workflow in HR lifecycle events application scope, in which we are generating multiple HR tasks at a time under a HR case. One of the task, say task A, is set to be in a "pending" state when generated. This is configured in the workflow in the "create task" activity. This task is dependent on another task, say task B. When task B changes state to "closed complete", then task A should change state to "ready". We are trying to achieve this from the workflow using a "run script" activity after task B is closed. However, it is not working as required when we tested as impersonating the task assignee and closing task B. Task A continues to be in the "pending" state even after task B is closed when done like this. However, if we as system administrator closes the task B directly from the "state" field dropdown, then task A is getting updated to ready state. We are not sure why it is not happening if we impersonate as task assignee and closes task B.&lt;/P&gt;
&lt;P&gt;We also tried to achieve this using business rule in HR lifecycle events application, it is behaving the same way as when done via workflow.&lt;/P&gt;
&lt;P&gt;We also tried the same business rule in HR core application scope. However, it didn't work then as well.&lt;/P&gt;
&lt;P&gt;Could someone please suggest what could be the possible issue and solution?&lt;/P&gt;
&lt;P&gt;Thanks in advance,&lt;/P&gt;
&lt;P&gt;Anu&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2020 08:32:40 GMT</pubDate>
      <guid>https://www.servicenow.com/community/hrsd-forum/hr-task-state-change/m-p/1295503#M5766</guid>
      <dc:creator>anusarma</dc:creator>
      <dc:date>2020-01-24T08:32:40Z</dc:date>
    </item>
    <item>
      <title>Re: HR task state change</title>
      <link>https://www.servicenow.com/community/hrsd-forum/hr-task-state-change/m-p/1295504#M5767</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Could you please share the Business rule ocnditions and scripts for better understanding.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Munender&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2020 08:47:31 GMT</pubDate>
      <guid>https://www.servicenow.com/community/hrsd-forum/hr-task-state-change/m-p/1295504#M5767</guid>
      <dc:creator>Munender Singh</dc:creator>
      <dc:date>2020-01-24T08:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: HR task state change</title>
      <link>https://www.servicenow.com/community/hrsd-forum/hr-task-state-change/m-p/1295505#M5768</link>
      <description>&lt;P&gt;Table: sn_hr_core_task&lt;/P&gt;
&lt;P&gt;When to run: before 100, on update&lt;/P&gt;
&lt;P&gt;Filter condition: task short description is "..." AND state changes to "closed complete"&lt;/P&gt;
&lt;P&gt;Script:&lt;/P&gt;
&lt;P&gt;var gr_tsk = new GlideRecord("sn_hr_core_task");&lt;BR /&gt; gr_tsk.addQuery('parent', current.parent.sys_id);&lt;BR /&gt; gr_tsk.addQuery('assignment_group','&amp;lt;sys_id of the required assign group&amp;gt;'); //to get the task for which state needs to be updated to ready&lt;BR /&gt;gr_tsk.query();&lt;/P&gt;
&lt;P&gt;if(gr_tsk.next())&lt;BR /&gt; {&lt;BR /&gt; gr_tsk.state = 10; //state = ready&lt;BR /&gt; gr_tsk.work_notes = "This task is now ready to be worked on.";&lt;BR /&gt; gr_tsk.update();&lt;BR /&gt; }&lt;/P&gt;
&lt;P&gt;----------------------------------------------------------------------&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2020 09:59:02 GMT</pubDate>
      <guid>https://www.servicenow.com/community/hrsd-forum/hr-task-state-change/m-p/1295505#M5768</guid>
      <dc:creator>anusarma</dc:creator>
      <dc:date>2020-01-24T09:59:02Z</dc:date>
    </item>
    <item>
      <title>Re: HR task state change</title>
      <link>https://www.servicenow.com/community/hrsd-forum/hr-task-state-change/m-p/1295506#M5769</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Can you please check if the business rule is on scoped application or global aplication.?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Munender&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2020 10:27:24 GMT</pubDate>
      <guid>https://www.servicenow.com/community/hrsd-forum/hr-task-state-change/m-p/1295506#M5769</guid>
      <dc:creator>Munender Singh</dc:creator>
      <dc:date>2020-01-24T10:27:24Z</dc:date>
    </item>
    <item>
      <title>Re: HR task state change</title>
      <link>https://www.servicenow.com/community/hrsd-forum/hr-task-state-change/m-p/1295507#M5770</link>
      <description>&lt;P&gt;Business rule is on HR Lifecycle Events scoped application.&lt;/P&gt;
&lt;P&gt;With this configuration, the state of task A is getting updated&amp;nbsp;upon closing task B if tested from admin perspective. It is not working when impersonating as the task assignee and then closing task B.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2020 10:44:27 GMT</pubDate>
      <guid>https://www.servicenow.com/community/hrsd-forum/hr-task-state-change/m-p/1295507#M5770</guid>
      <dc:creator>anusarma</dc:creator>
      <dc:date>2020-01-24T10:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: HR task state change</title>
      <link>https://www.servicenow.com/community/hrsd-forum/hr-task-state-change/m-p/1295508#M5771</link>
      <description>&lt;P&gt;This looks ot be an ACL issue maybe the users don't have access to change the state but the admins can,hence BR is running for admins only.Kindly check the ACL on the field/table to edit.&lt;/P&gt;
&lt;P&gt;OR,&lt;/P&gt;
&lt;P&gt;replace if(gr_tsk.next()) with while(gr_nxt()) maybe that helps.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Munender&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2020 11:18:01 GMT</pubDate>
      <guid>https://www.servicenow.com/community/hrsd-forum/hr-task-state-change/m-p/1295508#M5771</guid>
      <dc:creator>Munender Singh</dc:creator>
      <dc:date>2020-01-24T11:18:01Z</dc:date>
    </item>
    <item>
      <title>Re: HR task state change</title>
      <link>https://www.servicenow.com/community/hrsd-forum/hr-task-state-change/m-p/1295509#M5772</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have checked&amp;nbsp; ACLs, and have added the required group's roles to these ACLs. From the instance view, they are now directly able to edit the state field from the HR task form. However, the auto-updation is not still happening when impersonating as these users and testing.&lt;/P&gt;
&lt;P&gt;if/while is not causing this issue..&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Anu&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2020 09:43:09 GMT</pubDate>
      <guid>https://www.servicenow.com/community/hrsd-forum/hr-task-state-change/m-p/1295509#M5772</guid>
      <dc:creator>anusarma</dc:creator>
      <dc:date>2020-01-27T09:43:09Z</dc:date>
    </item>
    <item>
      <title>Re: HR task state change</title>
      <link>https://www.servicenow.com/community/hrsd-forum/hr-task-state-change/m-p/1295510#M5773</link>
      <description>&lt;P&gt;We were finally able to fix this issue, by adding a timer activity for 3s before the run script activity. It was found that when user tries to close the task and at the same time, system tries to update the state of another task, it would take the lowest access level and tries to update the task based on that, due to which it was not working for those users, but only for admins. When a timer activity was included, then system will update the state of the other task without any issues.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2020 06:21:38 GMT</pubDate>
      <guid>https://www.servicenow.com/community/hrsd-forum/hr-task-state-change/m-p/1295510#M5773</guid>
      <dc:creator>anusarma</dc:creator>
      <dc:date>2020-02-03T06:21:38Z</dc:date>
    </item>
    <item>
      <title>Re: HR task state change</title>
      <link>https://www.servicenow.com/community/hrsd-forum/hr-task-state-change/m-p/1295511#M5774</link>
      <description>&lt;P&gt;Thanks a lot for all your time and help. We were finally able to fix the issue. Have posted&amp;nbsp;it in the thread.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2020 06:23:04 GMT</pubDate>
      <guid>https://www.servicenow.com/community/hrsd-forum/hr-task-state-change/m-p/1295511#M5774</guid>
      <dc:creator>anusarma</dc:creator>
      <dc:date>2020-02-03T06:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: HR task state change</title>
      <link>https://www.servicenow.com/community/hrsd-forum/hr-task-state-change/m-p/1295512#M5775</link>
      <description>&lt;P&gt;Glad to hear that Anu!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Munender&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2020 06:29:56 GMT</pubDate>
      <guid>https://www.servicenow.com/community/hrsd-forum/hr-task-state-change/m-p/1295512#M5775</guid>
      <dc:creator>Munender Singh</dc:creator>
      <dc:date>2020-02-03T06:29:56Z</dc:date>
    </item>
  </channel>
</rss>

