- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 03:38 AM
Hi all,
Looking for support on the correct syntax for an Inbound Email Action. We have an action in situ working, however, we now need to pass the CI (which is captured in the From field of the incoming email) into the Configuration Item field on the Incident form.
Could someone assist with adding the correct syntax to our existing script please? I believe it would be something along the lines of the below, however, I can't work out how to only pass the CI value, as opposed to all the information in the Sender field of the incoming email.
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2025 04:14 AM
is it prefix or suffix?
if 1st letter at the start of string is to be removed then use this line
var exampleCI = inputString.split('.')[0].substring(1).toLowerCase();
if last letter at the end of string is to be removed then use this line
var exampleCI = inputString.split('.')[0].slice(0, -1).toLowerCase();
I believe I have answered your question.
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
04-07-2025 03:50 AM
Hi @GMoon
Could you please share the sample email?
Reagrds,
Siva
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 04:00 AM
Hello,
Yes of course, please see below:
Subject: HPE iLO AlertMail-032: (REPAIRED)
From: EXAMPLECI.xxxx.local@smtprelay.xxx.local
To: service.now@xxxx.com
The 'EXAMPLECI' is the value I need to pass into the CI field on the Incident form and always comes in uppercase format.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 04:22 AM
Hi @GMoon
You can use "email.origemail" in place of email.from.
Also if you want only the fiest half of the from address then, you need to use,
var emailFrom= email.origemail;
var ci = emailFrom.split('.')[0];
Note:The above script will work only if the CI name doesn't conatins dot(.).
For more details please review below doc.
https://www.servicenow.com/docs/bundle/yokohama-platform-administration/page/administer/notification...
Regards,
Siva
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 05:29 AM - edited 04-07-2025 05:41 AM
Hi Siva,
I tested your suggestion but unfortunately it was not successful. This is my updated script: