Awaiting Caller won't change back to In Progress if user emails with 'Outside' Email - Help?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2020 07:02 AM
I am on the New York upgrade where it has the new business rule that if the 'Caller' responds to an Incident that is in the 'On Hold - Awaiting Caller' state it sets the state back to 'In Progress'.
This will work if the caller sends the response via our companies email. Users also have the ability to email from the alternate email (gmail, yahoo, icloud) and it is recognizing the user when the submit the Incident (does not post as Guest). But once they respond via alternate email it automatically post their response as 'Guest' in the activity field. This does not match with the business rule, therefore it doesn't think the caller has responded so it will never change back to 'In Progress'.
I am at a loss, and cannot seem to figure out why it keeps posting as Guest since the callers have the alternate email in their profile correctly.
I also don't know if I should be editing the inbound action or the business rule, any thoughts?
TIA,
Jackie
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2020 07:22 AM
Hi Jackie,
If the email address from which the email was sent does not correspond to a user record in the sys_user table the system will mark the update as made by the guest account, which is the generic account.
Now, when you're saying "I am at a loss, and cannot seem to figure out why it keeps posting as Guest since the callers have the alternate email in their profile correctly. " - did you create a custom field which stores the alternative email?
If so, the system is not set to look at it, reason why I'd recommend updating you inbound action to set the record in progress if the email address from which the email has been sent is an alternative email address of the caller.
Hope the above helps!
Regards,
Tudor

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2020 07:39 AM
It's actually the contact email, which is already there. 'u_alt_contact_email' is in my inbound action already.
here is an example of a users profile.
In my Inbound Action I have this...
gs.include('validators');
if(gs.getUserName() == 'guest') {
var grUser = new GlideRecord('sys_user');
var gc = grUser.addQuery('u_alt_contact_email',email.from);
gc.addOrCondition('u_preferred_email',email.from);
gc.addOrCondition('u_actual_email',email.from);
grUser.query();
if(grUser.next()) {
current.caller = grUser.sys_id;
//current.opened_by = gr.sys_id;
}
}
if (current.getTableName() == "incident") {
gr = current;
//current.caller = gs.getUserID();
if (email.subject.toLowerCase().indexOf("please reopen") >= 0)
gr = new Incident().reopen(gr, email) || gr;
gr.comments = "reply from: " + email.origemail + "\n\n" + email.body_text;
if (gs.hasRole("itil")) {
if (email.body.assign != undefined)
gr.assigned_to = email.body.assign;
if (email.body.priority != undefined && isNumeric(email.body.priority))
gr.priority = email.body.priority;
}
gr.update();
}
But it could be wrong still....thoughts?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2020 07:49 AM
Please try replacing
if(gs.getUserName() == 'guest')
with
if(sys_email.user_id.nil())
Regards,
Tudor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2020 07:57 AM
var updatePerformedByCalller=false;
if(sys_email.user_id.nil()) {
var grUser = new GlideRecord('sys_user');
var gc = grUser.addQuery('u_alt_contact_email',email.from);
gc.addOrCondition('u_preferred_email',email.from);
gc.addOrCondition('u_actual_email',email.from);
grUser.query();
if(grUser.next()) {
if (current.caller.sys_id == grUser.sys_id){
updatePerformedByCalller=true;
}
if (current.getTableName() == "incident") {
gr = current;
if (email.subject.toLowerCase().indexOf("please reopen") >= 0)
gr = new Incident().reopen(gr, email) || gr;
gr.comments = "reply from: " + email.origemail + "\n\n" + email.body_text;
if (gs.hasRole("itil")) {
if (email.body.assign != undefined)
gr.assigned_to = email.body.assign;
if (email.body.priority != undefined && isNumeric(email.body.priority))
gr.priority = email.body.priority;
}
if (updatePerformedByCalller==true && gr.state==[value of onhold state]){
current.state = [value of active/in progress state];
}
gr.update();
}
Could you please try the above?
Regards,
Tudor