Ticket not creating when user not present in the User Table

Kumar147
Tera Contributor

Hello, 

I am trying to create email inbound action. when I am sending a mail from un registered user the ticket is not getting created. its getting created only when the user is present in the system. how to make the ticket created even the user in not present. please help me on this.

Phani26_0-1690784776892.png

 

1 REPLY 1

Ravi Chandra_K
Kilo Patron
Kilo Patron

Hello @Kumar147 

Greetings!

this is expected behavior.

try below code to set the guest user. if the user is not present in user table, it will set it to guest user.

var newUser = new GlideRecord('sys_user');
newUser.addQuery('email', email.from);
newUser.query();
if(newUser.next()) {
current.caller_id = gs.getUserID();
} else {
current.caller_id='5136503cc611227c0183e96598c4f706'; //add guest user sys id
}
current.insert();

ensure guest user is not locked out,

refer below threads:

https://www.servicenow.com/community/itsm-forum/inbound-email-guest-user/td-p/562487

https://www.servicenow.com/community/architect-forum/third-party-inbound-email-guest-account-user-cr...

Please hit the thumb and Mark as correct based on Impact!!

 

Kind Regards,

Ravi Chandra.