- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2025 02:05 AM
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.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2025 12:34 AM
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.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2025 01:07 AM
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