HR case template fields not defaulting

Dennis Ford
Giga Guru

I am trying to set a default case state for an HR Service by using the HR Case template.  In my personal developer's instance, I modified the General Inquiry HR case template and added the State field with value of "Work in Progress".  I also added the Source(contact_type) field to the template with a value of "In Person".  If I create the case from the platform, the values default as I have specified.  However, if I create the case from the employee service center, then the values do not default.  I assume that the record producer must be defaulting the State and Source(contact_type) fields, and the record producer is overriding the HR case template.  Is that the expected behavior or is there some way around that?  Thanks!     

1 ACCEPTED SOLUTION

michaelj_sherid
ServiceNow Employee
ServiceNow Employee

Hi Dennis,

The hr_serviceUtil script include is setting those values from the function CreateCaseFromProducer. This is why you are getting different values when submitting from the ESC in regards to using the Create New Case in the fulfiller view. I believe around line 56 it is setting the source (contact_type) to self_service.

Regards,

Mike

 

View solution in original post

11 REPLIES 11

Hi,

I think I ran into the same problem - not so much for 'source' but for "state".

In our business scenario: When the request is submitted there are immediately a bunch of automated things happening so we would like to set it to "WIP", as nobody would manually touch it for a while in order to set it to "WIP" and - bluntly speaking - I'd rather expect the HR template for the case taking precedence than some hidden and probably undocumented script 'setting' :-S

I share the same hesitance as @Dennis Ford to touch the ootb script and ideally also don't want to create another script to revert the effect of the ootb script if the idea of the case template makes absolute sense and should simply work as expected (that is obviously 'as expected by me as the user' ;-)) 

I'll try the RP variable, though...

Christian

 

@michaelj.sheridan What Christian was explaining was my hope as well.  Ideally, we prefer to not customize a script and use the HR case template since it is configuration.  A nice design might be for the HR case template to have a flag we could check to override the record producer values if the field is specified on the template. I do appreciate your prompt replies giving us some options.  Thanks!

You are right.  Setting the source to "In Person" makes no sense from the RP.  I was just testing the concept of using the HR case template to set field values 🙂    

Hi Dennis and Christian,

It was never my intention to have you customize the OOB script include. I just wanted to let you know where this was coming from (technically).

This is good feedback though, and I would encourage you to vote on this idea since this is a way to get this the visibility needed. I believe there are other ways to meet the requirement and the variable was the first to come to mind.

Stay safe, my friends.

Regards,

Mike

The RP variable works - minor annotation: "2" is the default value for 'task' - for sn_hr_core etc. it seems it should be "18" 😉