- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2020 02:56 PM
When the state field changes in RITM then, REQ state needs to be changed.
RITM States: REQ States :
Open Pending Approval.
Closed Complete. Approved, Closed Complete
Closed Incomplete Closed Incomplete, Closed Cancelled, Closed Rejected
Closed Skipped Closed Skipped
For Approval the state changes works fine, But not for the rejection alone.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2020 03:06 PM
Is Request and Requested Item always a one-to-one? If not, I think there is a better solution.
If it is a one-to-one your script works with a few tweaks:
Create an After Update Business rule on the Requested Item with following code:
(function executeRule(current, previous /*null when async*/) {
var request = new GlideRecord('sc_request');
request.get(current.request)
if (current.state == '3') {
request.active = false; // set active to false
request.request_state = '3'; // Set state to closed Complete
request.update();
}
else if (current.state == '4') {
request.active = false; // set active to false
request.request_state = '4'; // Set state to closed Incomplete
request.update();
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2020 08:24 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2020 05:45 AM
Hope you are doing well.
Is your question resolved? Or do we need to follow-up on this?
Please mark this answer as correct if it solves your question. This will help others who are looking for a similar solution. Also marking this answer as correct takes the post of the unsolved list.
Thanks.
Kind regards,
Willem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2020 11:47 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2020 11:53 AM
Check for business rules on the sysapproval_approver, sc_req_item and sc_request table that have been altered. Check the business rules for 'update()' in the script. And then see if any of the ones that are left after that, could be the cause.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2020 12:05 PM
Will I be able to avoid BR on Flow Designer while updating Request record.