Put "Subject Person" in OOTB HRSD in the title for few specific HR cases?

Don Dom
Tera Contributor

Hello

 

Is there a way to put "subject person" for specific 4-5 HR Services instead of "opened for" ?

DonDom_0-1703155392006.png

Please advise where I have to dig 🙂 thx

 

4 REPLIES 4

Voona Rohila
Kilo Patron
Kilo Patron

Hi @Don Dom 

The primary field Value will be shown in the record header.

 

Open a record and click 'form header' and check the 'primary field' 

 

VoonaRohila_0-1703157665417.png

VoonaRohila_1-1703157740988.png

 

 


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP

Oh nice, but can I build a "short description" from different field  + opened by + subject person + text ?

DonDom_0-1703160141065.png

 

rcard11
Tera Guru

Hey there!  You could use a business rule to replace the OOTB value that populates.  You could also add script to the record producer itself in the script section to set this value on submit.  Something like the below would work if you insert your own fields.  In the example below, u_request_type is a field the end user completes when they submit the record producer.  So the short description is "401k Inquiry for Jane Doe" instead of the OOTB one.  Hope this helps!

 

current.short_description = producer.u_request_type.getDisplayValue() + ' for ' + producer.subject_person.getDisplayValue();

Susan Britt
Mega Sage
Mega Sage

The HR Case's Short Description will default differently based on how it's created. 

  • OOB, if created from record producer that is using the script of new sn_hr_core.hr_ServicesUtil(current, gs).createCaseFromProducer(producer, cat_item.sys_id);, will result in the HR Case’s Short Description being “<HR Service Name> case for <Opened For user>” .  
  • If created manually from the agent, it will default to whatever you have on the HR Service's template
  • If created from email (i.e., inbound action), normally it is set from the email's Subject Line, but you can confirm those.

To prevent updating the OOB script include that defaults to the Opened For, I usually recommend creating a business rule on the HR Case table with appropriate conditions.  Be sure to think of all the scenarios of cases being created (e.g., only want for specific HR Services, exclude cases with Source=Email) though.  Do it as a before Insert with script similar to:

(function executeRule(current, previous /*null when async*/) {

	current.short_description = current.hr_service.getDisplayValue() + " case for " + current.subject_person.getDisplayValue();

})(current, previous);