Restriction for one assignment group for Request , RITM , TASK and Incident
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2024 12:29 AM
I have a requirement to restrict Request , RITM , Task ,incidents assigned to group "Security" members. Security group members should access only those Record other than Security group remaining Record should be Visible
I tried Query business Rule ,Can someone let me know what I am doing wrong because when I impersonate security member that data visibility party is working as expected , i am able to create record , but it associated Work Flow is not getting triggered , can some please Help me to achieve this Thank you in Advance
I tried the Below Query Business Rule in TASK[task] table which is parent table, It is working but while at the time of record creation its related workflow is not getting triggered
Thanks,
Manoj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2024 12:56 AM
Hi @Manoj50, You can try with the before query business rule on the required tables.
Condition:
gs.getUser().isMemberOf('Security')
Script:
(function executeRule(current, previous /*null when async*/ ) {
var grpQuery = 'assignment_group=2e959678939335104b7733ddfaba1084';
current.addEncodedQuery(grpQuery);
})(current, previous);
Regards,
Sunil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2024 02:20 AM
In my requirement Request , RITM , Task , Incident all the records belongs to that group needs to be visible to that group only for other group it should not visible the data since i tried this script it is working but when we raise a request its following workflow is not getting triggered
Thanks,
Manoj
var grpQuery = 'assignment_group=2e959678939335104b7733ddfaba1084'; current.addEncodedQuery(grpQuery);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2024 01:08 AM
Can we use sys id instead of group name?
gs.getUser().isMemberOf('Security')
I am not coder, but if we put group name that is not a good practice. or My understating is wrong
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2024 01:28 AM - edited 02-07-2024 01:29 AM
Hi @Dr Atul G- LNG, Thanks for raising this point. I have just tested it by passing the group sys_id instead of name and it works as expected.
@Manoj50, As a good practice, you can create a system property with the value as group sysid and call the systemtem property in the script.
gs.getUser().isMemberOf(gs.getProperty('security.group.sysid'))
Regards,
Sunil