Inbound Email Action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2023 02:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2023 02:57 AM
Hi,
You can achieve this using inbound flow.
Creating Inbound Email Flows | ServiceNow Developer
Thanks and Regards,
Saurabh Gupta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2023 03:12 AM - edited 12-15-2023 03:13 AM
Hi @Anusha Medharam ,
If the email body contains the 'service id' as serviceID:1234
you can set it as current.yourFieldName.setDisplayValue(email.body.serviceID);
As it is of reference type field, you would need to validate it through the GlideRecord query to make sure the ServiceID exists in the system.
Regards,
Sunil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2023 07:37 AM
Hi,
Here, you should parse the ServiceID and write Gliderecord for that table. Find the ServiceID exists or new - If new create it in that table and map it with the case ticket.
Parse and compare activities - you take a reference from the existing OOB code (i.e., inbound email action)
Suresh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2023 08:19 AM
Hi @Anusha Medharam,
// Fetch the email body or subject that contains the Service ID
var emailBody = current.email.body_text; // Assuming 'email' is the email record
var serviceID = extractServiceID(emailBody); // Write a function to extract the Service ID from the email body
// Find the relevant Case record based on the email or other criteria
var caseGR = new GlideRecord('incident'); // Assuming 'incident' is your Case table
caseGR.addQuery('number', current.number); // Assuming 'current.number' is the Case number
caseGR.query();
if (caseGR.next()) {
// Update the Service ID field in the Case record
caseGR.setValue('service_id', serviceID); // Assuming 'service_id' is the reference field to the install base item table
caseGR.update();
}
for your reference you can modify the code.
Thanks
SP.