How to hide HR services from agents while case creation?

Peeyush Jaroli
Tera Expert

Dear Community Members,

Is there any way I can restrict the visibility of few HR Services (under a fix category) to some group members only and rest of the assignment group members shouldn't have visibility to those HR services?

For example. I have HR Service Payroll Error, I want this HR service should be visible only to people who are part of Payroll Error Management group and not to other groups or their group members, how can I achieve this?

Regards,

Peeyush Jaroli

1 ACCEPTED SOLUTION

I don't know if I understand correct but if you want to hide HR service then you can try writing Query BR on HR service table like below.

Condition

gs.getSession().isInteractive() && (!gs.hasRole("admin")  ||  !gs.hasRole("sn_hr_core.admin") || gs.getUser.isMemberOf('Name of group'))

Script :

current.addEncodedQuery('name!=Administrative');
Please hit like and mark my response as correct if that helps
Regards,
Musab

View solution in original post

8 REPLIES 8

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

check this out

How to allow or restrict a user to select COE while creating HR case

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@Peeyush Jaroli 

Did you get a chance to check this?

Possibly you need to update OOB script include which has this function

getServicesForUser

find_real_file.png

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi @Ankur Bawiskar :

I thought of doing something with this function, but this deals with User, while I need HR Service restriction for agents (who are creating case from backend).

Didn't get much of how should I restrict. should I create ACL and restrict and pass it in this function or something else ?

Hi,

in that function you can check if logged in user is member or not

if not then don't push that HR service in the array

you need to analyze the function and update accordingly

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader