
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2021 11:16 PM
Hi ,
I want to extend one out of box script include "CSEMailUtil" it's out of box and I created my script include which extend OOB script include below sample code :
Client callable : True
var Getfunction = Class.create();
Getfunction .prototype = Object.extendsObject(CSEMailUtil, {
getValue: function(email) {
var value1 = '';
if (gs.nil(email))
return skills;
var emails = email.split(',');
emails = emails.reduce(function(filtered, mailId) {
if (mailId && !gs.nil(mailId.trim()))
filtered.push(mailId.trim());
return filtered;
}, []);
if (!emails || emails.length <= 0)
return value1;
var gr = new GlideRecord('sn_customerservice_channel_config');
gr.addQuery('email_address', emails);
gr.setLimit(1);
gr.query();
if (gr.next())
skills = gr.u_abc + '';
return value1;
},
type: 'Getfunction'
});
In email inbound :
((new CSEMailUtil).checkCaseChannel(email.to)) && ((new CSEMailUtil).isUserExist(email.from)) ---> do i need to make changes into it ?
If yes then what ?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2021 02:50 AM
In email inbound I need to provide the as mentioned the get the content .
So in email inbound : It will be as it is where it will verify channel configuration email associated with with Valuefunction(field on the channel) .
Script include(extend into another script include) it provide accessibility to parent script include function :
"Getfunction .prototype = Object.extendsObject(CSEMailUtil, {"
Email inbound action (body):
current.valuefunction = new Getfunction().getValue(email.to);
GetFunction : Script include which extended to CSEMailUtil or another word which provided access to parent script include function .
getValue : Function defined into extend script include .
It working as desired .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2025 03:11 PM - edited 02-11-2025 03:12 PM
I don't agree with your suggestion to update the OOB Script Include it leaves the environment in a skipped upgrade state. If SN refactors it, adds important methods, etc, the customer will miss them.
Instead, extending the SI is best practice, and it's not "copying an object" the way the customization doc from SN is talking about.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2021 11:44 PM
Hi,
even ServiceNow recommends updating OOB object and avoid copying objects for minor changes
What are the best practices for customization?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2021 02:41 AM
I found I did the correct way , Just I missed the to update into the email inbound action .
I extended the script include correctly which provided the excess CSEMailUtil().
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2021 02:46 AM
Hi,
Glad that you got the approach.
But I would suggest to update OOB object as it is recommended by ServiceNow for small changes.
I already shared link above. Please check that
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2021 02:54 AM
I saw and totally agree with you, I did in past as well .It's really minor one where only need to add on function into the list which I already did and was working perfectly. Last 1 week I was trying convinced them but they don't agree.
But you know some time you ca'nt do, what do you want ...hehehehehe .
I hope you know, boss/Client is always(if they desperately want) right 🙂