All Case from same account

Sandeep Bharate
Tera Contributor

HI all,

We have requirement where,

All cases created for same accounts are currently accessible by sn_customerservice.customer_admin (Customer Admin) role.

But customer want users with sn_customerservice.customer (Customer User) role also have access to all cases created for his account. (at least read level). 

How can i achieve this...

 

Thanks in advance.

 

1 ACCEPTED SOLUTION

ChanakyaMekala
Kilo Guru

On Case table we have a before query business rule called "Case query for Customer" which will be governing the cases that have to be accessed and presented to the CSM users. If you want the users with role sn_customerservice_customer should also able to access the cases of their account, then update this BRule as below

 

(function executeRule(current, previous /*null when async*/) {
if(gs.hasRole('sn_customerservice.customer')&&!gs.hasRole('sn_customerservice.customer_admin')&&!gs.hasRole('sn_customerservice.partner')&&!gs.hasRole('sn_customerservice.partner_admin'))

current.addQuery("account",gs.getUser().getCompanyID());

else

new global.CSQueryBRUtil().addCaseQueryBR(current);
})(current, previous);

 

This will definitely work.

 

Please mark 'Correct' or 'Helpful' if it is so

View solution in original post

13 REPLIES 13

parag-mone
ServiceNow Employee
ServiceNow Employee

Hi,

There is a new role introduced in London called "Customer Case Manager" (sn_customerservice.customer_case_manager). Customer (user) with this role can perform following activities through Portal -

  • Create a case on behalf of another contact in the account
  • View a list of cases belonging to the account
  • Edit cases belonging to the account.

Please take a look at the product documentation for additional details.

Thanks,

Parag Mone

Thanks Parag, But we are using Kingston Release.

ChanakyaMekala
Kilo Guru

On Case table we have a before query business rule called "Case query for Customer" which will be governing the cases that have to be accessed and presented to the CSM users. If you want the users with role sn_customerservice_customer should also able to access the cases of their account, then update this BRule as below

 

(function executeRule(current, previous /*null when async*/) {
if(gs.hasRole('sn_customerservice.customer')&&!gs.hasRole('sn_customerservice.customer_admin')&&!gs.hasRole('sn_customerservice.partner')&&!gs.hasRole('sn_customerservice.partner_admin'))

current.addQuery("account",gs.getUser().getCompanyID());

else

new global.CSQueryBRUtil().addCaseQueryBR(current);
})(current, previous);

 

This will definitely work.

 

Please mark 'Correct' or 'Helpful' if it is so

HI Chani,

 

Thanks for script,

I tried this script now its showing a message in bottom as "5 rows removed by security constraints"

Can you tell me which ACL are blocking those records.