Before query business rule to hide records for certain catalog item is impacting Approvals
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2025 11:17 AM - edited 03-16-2025 11:18 AM
Have created a business rule on Catalog Item and Task to restrict the visibility of catalog items to certain users of the group.Approvals are not being created when users outside the group are submitting the request.Business rule donot have any customizations related to Approvals.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2025 03:23 AM
following script may assist you to achieve your requirement.
var userGroup = 'your_group_sys_id';
var requestedFor = current.requested_for;
var isMember = false;
var gr = new GlideRecord('sys_user_grmember');
gr.addQuery('user', requestedFor);
gr.addQuery('group', userGroup);
gr.query();
if (gr.next()) {
isMember = true;
}
return isMember;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2025 07:09 AM
your query business rule already has interactive session check so ideally it should not run
Did you try adding log and see if this BR is running and causing this issue?
How are you creating the approvals workflow or flow?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2025 07:27 AM
Hi Ankur !
The Approvals are being triggered through Flow. I am adding the approvals in Catalog item section.
I tried deactivating the business rule and I see approvals are triggering.
is there any way to make the approvals with business rule on. I would need approvals to fire with catalog item visibility restriction in place