Error HR Service is not valid for the subject person

ELMAHDI
Tera Expert

Hello everyone,

I am getting a problem when submiting a new request which triggers this HR Service
. I don't understand the use of opend for /... and subject person /...

Error HR Service is not valid for the subject person  

Capture_decran_2024-10-17_a_14.22.20.pngCapture_decran_2024-10-17_a_14.23.56.png

 

1 REPLY 1

Marcel Hopp
Tera Contributor

Hi @ELMAHDI,
when you submit a record producer from the portal ServiceNow tries to insert an HR Case in the table where the HR Service is stored. When you check the ootb fields on all Case tables, you will find both fields "Opened for" and "Subject person".

  • Opened for = The person for whom the case is created for (normally the person who is logged in or who is calling)
  • Subject person = The person the case is about

see the following two examples to illustrate the difference:

  1. You open a HR Case from the ESC for HR Service "Change of address" since you have moved and you want to update your home address. -> You will be both "Opened for" and "Subject person"
  2. Your manager opens a HR Case from the ESC for HR Service "Request on Salary increase" since your manager wants to give you a raise. -> Your Manager will be "Opened for" while you are the "Subject person".

For this reason it is important to either

  • use the record producer script to map the current logged in user to the fields "Opened for" and "Subject person" on the HR Case OR
  • you have dedicated variables for the "Opened for" and the "Subject person" on the record producer and use the "map to field" feature while configuring those variables. You can easily set the current user as the default value in there. Depending on the use case you can then decide if the "Subject person" variable should be editable or not.

In any way once you submit the record producer, either the logged-in user or the user in the variable "Subject person" is evaluated against the "HR Criteria" on the HR Service definition. 

In your case of an Onboarding the HR Criteria should also include those HR Profile or Users (depending on your configuration) which an applicant/candidate has at the moment the onboarding is created since not all fields on HR Profile / User might be filled.

 

I hope this helps you to understand it. Would be great if you mark my comment as helpful.

 

For more information you can also refer to: Configure an HR service (servicenow.com)