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 to check logged in user company and ticket created user company

User662839
ServiceNow Employee
ServiceNow Employee

Hi All,

I have a requirement. 
if the logged in user is a member of "X" company then he should only be able to see tickets created by"x" company users , that means logged in user  should only have access to tickets created by the same company users.

 I know i can accomplish this by using ACL. i have tried different ways but it's not working.

Can any one assist me with this.

Thanks in Advance.
 

4 REPLIES 4

rad2
Mega Sage

Try adding the javascript:gs.getUserID() in the condition builder at the bottom of the ACL. Please find sample screenshot below

 

 

For more information on how ACLs are evaluated - https://docs.servicenow.com/bundle/madrid-platform-administration/page/administer/contextual-securit...

 

Hope this helps!!

rad2
Mega Sage

Hi,

In the condition builder, you can select the company of the user object with the help of show related fields option ex;

find_real_file.png

 

in the condition to compare with the company, you can use 'javascript:gs.getUser().getCompanyID()'

 

Hope this helps!!

Hi,

If this answer has helped you, kindly mark correct / helpful

Rahul Kumar17
Tera Guru

Hi,

U can write the ACL with the condition.

more information for ACL then go for this link.

https://community.servicenow.com/community?id=community_article&sys_id=81222dbadb762f802e8c2183ca961...

Thanku

If my response helped please mark it correct and close the thread.

Thanks,
Rahul Kumar