Hr Service field is not populating

Andre Jones
Tera Expert

Hr Service field is not populating when created from Record Producer. 

AndreJones_0-1699980420214.png

This is what I have in the script 

current.hr_service = gs.getProperty("sn_hr_er_case._Leave_SysID"); 

Can someone direct me as to what I'm doing wrong?

1 ACCEPTED SOLUTION

current.hr_service = gs.getProperty("sn_hr_er_case._Leave_SysID"); 

current.contact_type= "self_service";
current.state = "10"; // Ready
current.status = " submitted"

View solution in original post

6 REPLIES 6

michaelj_sherid
ServiceNow Employee
ServiceNow Employee

@Andre Jones are you using a template with the HR Service? I am under the assumption that you are calling to that record producer in the HR Service configuration as well. Lastly, do you have the script portion of the Record Producer compared to an OOtB Record Producer? You will see the script something like this. 

michaelj_sherid_0-1699980984185.png

Regards,

Mike

I tried this line of code but nothing.

I just created a Record Producer. This is what I have for the OTB 

AndreJones_0-1699982099864.png

But for some reason I either get a blank HR service field or some other Record Producer that I did not create in it. 

Jaspal Singh
Mega Patron
Mega Patron

Hi Andre,

Is the hrUtils script include modified?

Also, can you try addiing below line of code the the Record Producer's (HR item) Script field

new sn_hr_core.hr_ServicesUtil(current, gs).createCaseFromProducer(producer, cat_item.sys_id);