When the task is closed cancelled, then the RITM stage should be "request cancelled"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2022 12:09 AM
When the task is closed cancelled, then the RITM stage should be "request cancelled" and the RITM state should be "closed cancelled" and cancelled notification should be sent out to the user.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2022 12:12 AM - edited 12-01-2022 12:14 AM
Hello @sunil kumar11 ,
You can do this by using an 'if' activity after task to check if the task state is closed cancelled if so then create a new activity to set the values of the RITM and end the workflow.
Let me know if you require more details or script to use in if activity.
Please mark correct.
BR,
Nayan
Best Regards,
Nayan Dhamane
ServiceNow Community Rising Star 2023.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2022 12:18 AM
Please can you help me with any business rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2022 12:39 AM
Hello @sunil kumar11 ,
You can use business rule as well use the below script in business rule:
On after update business rule on 'sc_task' table
condition ; state changes to close cancelled
var elep = new GlideRecord('sc_req_item');
elep.addQuery('sys_id',current.request_item);
elep.query();
if (elep.next())
{
elep.state=‘2’; //put your state values
elep.stage=‘2’;
elep.setWorkflow(false);
elep.autoSysFields(false);
elep.update();
}
Note : If you want to cancel workflow use this line before update 'new Workflow().cancel(current)';
Please mark as correct.
BR,
Nayan.
Best Regards,
Nayan Dhamane
ServiceNow Community Rising Star 2023.