Add Requested for User to the Group after approval and Close RITM REQ after Approval (Script)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi All,
I’m working on a requirement in ServiceNow and would appreciate your guidance.
Requirement:
We have a catalog item for ServiceNow access. It contains:
A variable “Service Required ” (dropdown) → includes Request Access
A variable “Type of Access” (dropdown) → includes View Ticket Access
Expected Behavior:
When:
Catalog item = ServiceNow access
Service Required = Request Access
Type of Access = View Ticket
And the RITM is approved
Then:
The Requested For user should be automatically added to a specific group (CAD group)
The RITM and REQ should be auto-closed (Closed Complete)
Constraint:
We are not allowed to use Flow Designer, so this needs to be handled via scripting (Business Rule or other approach)
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a week ago
If you are unable to use Flow Designer, you could write a business rule that queries the sys_user_grmember table and adds a new record when the RITM meets the desired conditions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a week ago
Hi @VishalSawant ,
You can use an "Insert" Business Rule on the RITM (sc_req_item) table and handle this as follows:
- Validate the conditions — Check if the Catalog Item, Service Required and Type of Access match the expected values.
- Trigger Approval — If conditions are met, call a Sub flow directly from the Business Rule using
sn_fd.FlowAPIwith the "Ask for Approval" action inside the Sub flow - Post Approval — Once approved, add the Requested For user to the CAD group via
sys_user_grmemberand auto-close both the RITM and REQ by setting the state toClosed Complete
If you find this useful, please mark it as Helpful or Accept it as the Solution.
Regards,
Harish
