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

There are no such OOB ACLs which are governing the access to the case records in Portal based on Customer roles. The above script will work for sure with OOB ACLs. As you are receiving the above error which tells me that your organization might have defined new ACLs , please post your screenshot here for list of ACLs

Hi Chani,

Thanks for your help, I implemented this by modifying some ACL and your script.

But case list is not showing Contact column. I given access to customer but still its hidden. I given read access to contact table as well but still the same. Can you help on this one...

find_real_file.png

Add sn_customerservice.customer role as one of the roles in the OOB ACL sn_customerservice_case.contact. This will let the customers also to see the contact column. I verified it and it worked.

 

Please mark all the replies which helped you as 'Helpful' and mark one of them as 'Correct' - This would help others and also me.

If my last reply to update OOB ACL sn_customerservice_case.contact helped you, please mark it 'Helpful'

Hi @Chanakya,

We were also having same requirement, and we have customized this BR and This is working fine as well. 

As I have read that in Quebec Release, CSM Query Rules are getting introduce in ServiceNow.

Just checking with you, Do we have face any issues while customizing this OOO BR Query. 

Thanks,