How to restrict specific groups or categories of incidents to only its group members
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2023 03:31 AM
Hello All,
I want to restrict the HR group from everyone as it will contain confidential data.
I need guidance with it.
i have refered to the knowledge artile here:
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0790987
but not sure what wrong i am doing .
I have attached the image below for more info.
Thanks in Advance,
Regards,
Renu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2023 11:56 PM
Hello @Renu4 ,
Can you try the solution given below.
Create a before query business rule on incident table.
Check the advanced check box and put " !gs.getUser().isMemberOf('<name of the group to be restricted>') " in the condition field under advanced tab.
Put the script given below in the script field.
(function executeRule(current, previous /*null when async*/ ) {
current.addEncodedQuery('assignment_group!=<sys_id of the group to be restricted>');
})(current, previous);
Just change the values as per your requirements.
NOTE: Put group name in the condition field and group sys_id in the script field.
Please mark my answer helpful and correct if it resolves your requirement.
Shivam Jaiswal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2023 02:27 AM
Hello @Renu4,
Any updates on this one?
Did you get a chance to implement the solution I've given above?
Kindly mark my answer helpful and correct if it helps resolving your issue.
Shivam Jaiswal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2023 02:37 AM
Hello Shivam,
This works but it hides the tickets from the creater also.Say i create the ticket now then i dont get to view the ticket once it is submitted.
this should not be the case.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-11-2023 01:35 AM
Hello @Renu4,
Thank you for the update. You can add one more condition inside the encoded query:
current.addEncodedQuery('assignment_group!=<sys_id of the group to be restricted> || sys_created_by==current.getUserName()');
Please let me know if it resolves your requirement.
Shivam Jaiswal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2023 06:09 AM
Hello @Renu4 ,
Did you get chance to try this one?,
Kindly mark my answers helpful & correct i it helps resolving your query.
Shivam Jaiswal