HRSD - Append Short Description.

SandeshD
Tera Contributor

Currently , we have the "hr_CaseUtils" OOTB Script Include running which is setting the Short Description to "Suject Person name & Employee Id " we wish to append this script by adding the Company code to it.Kindly assist.

 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@SandeshD 

rather than updating the OOTB script include, I will suggest to append the company using after insert business rule.

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

View solution in original post

5 REPLIES 5

Shubham_Jain
Mega Sage

@SandeshD 

 

Recommended Approach: Use a Custom Extension

1. Clone or Extend hr_CaseUtils

  • Create a new Script Include, e.g., Custom_hr_CaseUtils.
  • Extend hr_CaseUtils if it's designed for extension, or copy the relevant method (e.g., setShortDescription) and modify it.

2. Modify the Logic

Update the method to include the Company Code. Example: 

setShortDescription: function(caseGr) {
    var subjectPerson = caseGr.subject_person.getDisplayValue();
    var employeeId = caseGr.subject_person.employee_id;
    var companyCode = caseGr.subject_person.company.getDisplayValue(); // assuming 'company' is a reference field

    var shortDesc = subjectPerson + ' & ' + employeeId + ' & ' + companyCode;
    caseGr.short_description = shortDesc;
}

 

 Make sure company is a valid reference field on the sys_user or related table.

3. Update the Flow or Business Rule

  • Wherever hr_CaseUtils.setShortDescription() is called, replace it with your custom version if needed.
  • Or, override the method globally if your instance supports it.

 

Avoid Direct Modification of OOTB Script Includes

Modifying OOTB scripts directly can cause issues during upgrades. Always use extension or override patterns.

 

 

✔️ If this solves your issue, please mark it as Correct.


✔️ If you found it helpful, please mark it as Helpful.



Shubham Jain