Sentiment Analysis not working on Updated Cases

Richa2
Tera Contributor

Hi,

We have recently configured Sentiment Analysis for one of our customers and it is working when a new Case is created, but the Sentiments does not gets updated when Comments are added on Cases.

Do you have any tips what could be missing?

Regards

Richa

3 REPLIES 3

Daniel R2
Kilo Sage

Hi @Richa2, we were facing the same issue. 

The issue was within the 'Task Intelligence Sentiment Case Update' flow.

On line 3 it completes a check if user has role Consumer/Customer, and this flow variable can be found on line 1 within the script it checks if the user has the consumer or the customer role and not the admin role. We edited the 'Role is Consumer/Contact' script within line 1, adding the role of our end users. Once we did this sentiment analysis worked as expected when cases were updated

Richa2
Tera Contributor

Hi @Daniel R2 !

 

Thankyou for your response!

I looked in the flow as suggested by you. I see the following Script for the variable:

return (gs.hasRole('sn_customerservice.customer') || gs.hasRole('sn_customerservice.consumer')) && !gs.hasRole('admin');
 
Can you please share what did you exactly change in it? Our Customers do have 'sn_customerservice.customer' role, so do not exactly understand what you mean to say. Should we instead change it to 'snc_external'?
Can you please share your updated script?
However, I do agree that the script is returning False and hence the Flow is not executing further.
Thanks in advance!

Our users actually just have the snc_internal role, so we added that to the script, and it worked as expected, the sentiment fields were updating based on end user input. We will most likely make an additional adjustment below to ensure users do not have an agent role. But yeah the below worked for us.

return (gs.hasRole('sn_customerservice.customer') || gs.hasRole('sn_customerservice.consumer') || gs.hasRole('snc_internal')) && !gs.hasRole('admin');

 

hmm I would expect if your users do have the  'sn_customerservice.customer' role then it should work as expected and you dont need to change anything, but could be worth a try adding snc_external for testing purposes. 

An issue we were also facing when setting up sentiment analysis was cross scope errors on the restricted caller access privilege table (sys_restricted_caller_access). It was causing issues with sentiment analysis on case creation but didn't face this issue on case updating, but may still be worth checking if you have any cross scope errors which needed to be accepted?

 

If neither of the above work, I'm out of ideas unfortunately. But I guess it will be something in the flow if that script is returning false there.