Incident created by an unknown Inbound Email address - set "Opened by" to something other than Guest
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2013 07:43 AM
I'm on Berlin.
Currently, when an Incident is created by an unknown inbound email address, the "Opened By" is set to Guest.
For some reason, the application owners think that Guest "doesn't look nice" in the Opened By field. They want to be able to report on that field with something like an account named "Inbound Email." Creating the account's the easy part. I can't just rename that account because our analysts use Guest for the Caller when they can't find a user in the system.
How can I get the Inbound rule to set "Opened By" to something other than Guest?
I've looked at the Create Incident Inbound rule and I can't see where it says to enter Guest in the "Opened By" field.
Thanks in advance for your help.
[quote]
current.comments = "received from: " + email.origemail + "\n\n" + email.body_text;
current.short_description = email.subject;
var sid = gs.createUser(email.from);
var gr = new GlideRecord('sys_user_group');
gr.addQuery('u_default_service_desk',true);
gr.query();
while (gr.next()){
if (gr.sys_id != undefined){
current.u_sd_group = gr.sys_id;
}
}
current.caller_id = sid;
current.opened_by = sid;
//current.category = "request";
current.incident_state = 1;
current.notify = 2;
current.contact_type = "email";
/*if (email.body.assign != undefined)
current.assigned_to = email.body.assign;
*/
current.insert();
[/quote]

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2013 11:15 AM
This can probably be done, but why don't you just set the 'Contact type' field on the incident to 'Email'? Reporting on any incident for guest, along with the correct contact type, would get you exactly what you need.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2013 11:24 AM
I agree 100% and that's what I suggested to them: that a report run on Opened By Guest and contact type email would give them Incidents created by unknown inbound email address.
Even one that runs on ONLY Opened By Guest will give them what they want. There's no way an Incident can be opened BY a Guest in our instance. Not one that I can think of.
This is purely an aesthetic issue for them... (insert grumble here)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2013 11:34 AM
Grumble indeed...
Well, the line that returns the guest ID is this one.
var sid = gs.createUser(email.from);
Maybe the simplest solution would be to query on that ID and see if it is the guest user. If so, it sets it to a new user that you create. You could do this in the inbound action or in a regular business rule on the incident table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2013 07:09 AM
So would it just be something like:
if var side = x (whatever the sid for guest is)
then Opened by = y (whatever the new "Not Guest" user is)
I would just do this on the Inbound create and forward actions.
The only time "Opened By" should be "Guest" is on inbound email created Incidents.
The rest of the time, people are logging in and it should show them as the opener.
Just kinda scary messing with this stuff. Especially since I can't test email rules in my dev environment because email is turned off. Unless there's a way to do it and I just don't know how.
Thank you very much for your help, btw.