Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

ACL for CI Ownership Groups

Community Alums
Not applicable

Hi,

I have a scenario where I have to give access to the ownership groups in CI through ACL. Kindly help.

 

This is what I have done currently. I completed for the single users. The group names below are not in the group name as is, so I can't find them. The first group is servicenow_admin, so we hardcoded it.

 

if (gs.getUser().isMemberOf('ad53348b874a0510b2bab996cebb35b5') || gs.getUserID()==current.u_it_manager || gs.getUserID()==current.	
u_test_lead || gs.getUserID() == current.owned_by)
{
    answer = true;
} else {
    answer = false;
}

 

form.png

 

ci owner.pngsupport group.pngbusiness owner.png

 

Regards

Suman P.

7 REPLIES 7

Hi @Community Alums ,

 

If it is not there in group table then  first you have to create it and add code for those group as well.

gs.getUser().isMemberOf(group1) || gs.getUser().isMemberOf(group2) || gs.getUser().isMemberOf(group3);

 

-------------------------------------------------------------------------

If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.


Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay

-------------------------------------------------------------------------

You may use sysproperty to get the sys_if of group

Community Alums
Not applicable

Hi @Runjay Patel,

 

This is what has worked.

 

var servicenow_admin_sys_id = 'ad53348b874b2bab996cebb35b5';
if (
     gs.getUser().isMemberOf(servicenow_admin_sys_id) ||
    gs.getUserID() == current.u_it_manager ||
    gs.getUserID() == current.u_test_lead ||
    gs.getUserID() == current.owned_by ||
    gs.getUser().isMemberOf(current.u_business_owners_group) ||
     gs.getUser().isMemberOf(current.change_control) ||
     gs.getUser().isMemberOf(current.support_group)
) {
    answer = true;
} else {
    answer = false;
}

 

Regards

Suman P.

HI @Community Alums ,

 

Cool, This what i had suggested you.

 

-------------------------------------------------------------------------

If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.


Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay

-------------------------------------------------------------------------