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.

User criteria is not working on knowledge articles

Rae2
Tera Contributor

I have this user criteria with the script below:

find_real_file.png

The script is correct but when I impersonate a user that matches the user criteria and open the article below which he should not see the article, he can still the article on self service knowledge

find_real_file.png

 

Here's the user criteria diagnostics:

find_real_file.png

 

The User doesn't have any role except for Business stakeholder role. The knowledge base doesn't have any user criteria under Can Read and Can Contribute.

1 ACCEPTED SOLUTION

Musab Rasheed
Tera Sage

Hi Rae,

This below article might help you. Mark my answer as correct if that helps

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0623654

Regards

Please hit like and mark my response as correct if that helps
Regards,
Musab

View solution in original post

5 REPLIES 5

Aman Kumar S
Kilo Patron

Hey,

The code doesn't seem right:

you should be using

gs.getUserID() instead of user_Id in 2nd line

 

Feel free to mark correct, If I answered your query.

Will be helpful for future visitors looking for similar questions 🙂

 

Best Regards
Aman Kumar