- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2023 11:13 AM
We have a create incident inbound email action that has been working fine.
I created a new user with a new email address to add to the action, and that one is not working (the original ones continue to work).
Below is the script with the part that I added yesterday in bold.
The error that I get (in the email log) when I send an email to that address is: Create Incident : did not create or update incident using current
It seems that it is not setting the target table to incident. What do I need to do to make it set the target table to incident?
We are on San Diego if not that that probably matters.
Script:
var data = [
{
"email": 'ecwhelp@rsfh.com',
"assignment_group": '4717f733879bc11466eeb8cd8bbb3537',
"short_descrip": ''
},
{
"email": 'psstrategicbusiness@rsfh.com',
"assignment_group": '0717f733879bc11466eeb8cd8bbb354b',
"short_descrip": '-'
},
{
"email": 'telmediqoptimization@rsfh.com',
"assignment_group": '0717f733879bc11466eeb8cd8bbb354b',
"short_descrip": ''
},
{
"email": 'csphishing@rsfh.com',
"assignment_group": '21f57f3f875bc11466eeb8cd8bbb352f',
"short_descrip": ''
},
{
"email": 'psecwsupport@rsfh.com',
"assignment_group": '4717f733879bc11466eeb8cd8bbb3537',
"short_descrip": ''
},
{
"email": 'rsfcareconnect@rsfh.com',
"assignment_group": '4717f733879bc11466eeb8cd8bbb3537',
"short_descrip": ''
},
{
"email": 'trackIt@rsfh.com',
"assignment_group": '4717f733879bc11466eeb8cd8bbb3537',
"short_descrip": ''
},
{
"email": 'MoveAddChange@rsfh.com',
"assignment_group": '733ad0dd8796011066eeb8cd8bbb3582',
"short_descrip": ''
},
];
var emailRecipients = [''];
for (i = 0; i < data.length; i++) {
if (email.recipients.toLowerCase().split(',')[0] == data[i].email) {
current.caller_id = gs.getUserID();
current.description = email.body_text.split('<mailto:')[0];
current.comments = "received from: " + email.origemail + "\n\n" + email.body_text;
current.short_description = data[i].short_descrip + email.subject;
current.assignment_group = data[i].assignment_group;
current.category = "software";
current.incident_state = IncidentState.NEW;
current.notify = 2;
current.contact_type = "email";
if (email.body.assign != undefined) {
current.assigned_to = email.body.assign;
}
if (email.importance != undefined) {
if (email.importance.toLowerCase() == "high") {
current.impact = 1;
current.urgency = 1;
}
}
current.insert();
}
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2023 01:01 PM
Hi, the value you have added contains UpperCase characters but your script is converting the email.recipients to lowercase
email.recipients.toLowerCase()
and so there is never a match.
Try updating to "email": 'moveaddchange@rsfh.com',
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2023 01:01 PM
Hi, the value you have added contains UpperCase characters but your script is converting the email.recipients to lowercase
email.recipients.toLowerCase()
and so there is never a match.
Try updating to "email": 'moveaddchange@rsfh.com',