In email logs showing as processed "Create incident" inbound action but not showing the target field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2023 12:32 AM - edited 07-16-2023 12:34 AM
We have requirement when mail comes from mail address "test@example.com" to testdev@service-now.com and subject contains "Resolved", inbound action shouldn't create incident record.
If mail comes from mail address "test@example.com" and subject doesn't contain "Resolved", then inbound action should trigger and create the incident record.
We have separate conditions in the "when to run" that is "To" contains testdev@service-now.com and subject contain Service Desk.
We have made changes accordingly in "Actions" of inbound action but we are facing issue with record creations i.e in emails logs it is showing as processed "create incident" inbound action and showing incident number but in target it is showing as empty means incident record is not created.
Please help me to resolve this issue.
The script we used in actions:
if(email.from == ‘test@example.com’&&email.subject.contains('Resolved')){
current.setAbortAction(true);
}
else{
current.caller_id = gs.getUserID();
//current.comments = "received from: " + email.origemail + "\n\n" + email.body_text;
current.short_description = email.subject;
current.description = email.body_html;
if(email.from == ‘test@example.com’){
current.assignment_group = gs.getProperty('group.Service Desk');
current.assigned_to = gs.getProperty('user.krishna');
}
var watch_list;
var recipients = email.recipients;
var splitcomma = recipients.split(",");
for (var i = 0; i < splitcomma.length; i++) {
if (splitcomma[i].indexOf(‘test’@service-now.com) == -1) //if does not contains servicenow.dev@volantetech.com it will go in if loop
{
current.watch_list = current.watch_list + ',' + splitcomma[i];
}
}
current.insert();
}
Email log screenshot:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 06:49 AM
Hi I to encountered same issue could help me please