How to inform guest user that incident ticket is created on his behalf?

SudhirOjha
Mega Guru

How to inform guest user that incident ticket is created on his behalf?

Guest user just create an incident using inbound email and OOB business rule created a ticket onbehalf of him.

Now i have a requirement to inform the guest user that ticket has been created and send him the incident ID.

any idea??

Thanks

Sudhir

1 ACCEPTED SOLUTION

Hi Sudhir,

 

You need to create an event in your event registry so you can trigger it in your eventQueue(). You will probably want some logic in your inbound action to only generate the event if the user is not in your user table, something like this:

var gr = new GlideRecord('sys_user');
gr.addQuery('sys_id', gs.getUserID());
gr.query();
if(!gr.hasNext()){
gs.eventQueue('your.event.name', current, email.origemail);
}

You then need to create an event and in the when to send tab select the option to send when an event is fired, in the who will receive tab tick the box for parm1 contains recipient, then just fill out the content of the email to mirror the standard incident opened for me notification.

 

Cheers

Dave

 

View solution in original post

10 REPLIES 10

Dubz
Mega Sage

Hi Sudhir,

 

You can have the system create user accounts automatically when it receives mail from unknown email addresses, that way they will receive the standard Incident created for me notification.

 

If you want to keep them as guest you'll need to create a new notification and trigger it from your inbound actions as this is the only place where the users email address is available:

 

gs.eventQueue('your.new.event', current, email.origemail);

SudhirOjha
Mega Guru

Do you have step wise actions for this?

 

what need to be done in notification and what in event and what in inbound action ??

Hi Sudhir,

 

You need to create an event in your event registry so you can trigger it in your eventQueue(). You will probably want some logic in your inbound action to only generate the event if the user is not in your user table, something like this:

var gr = new GlideRecord('sys_user');
gr.addQuery('sys_id', gs.getUserID());
gr.query();
if(!gr.hasNext()){
gs.eventQueue('your.event.name', current, email.origemail);
}

You then need to create an event and in the when to send tab select the option to send when an event is fired, in the who will receive tab tick the box for parm1 contains recipient, then just fill out the content of the email to mirror the standard incident opened for me notification.

 

Cheers

Dave

 

Try this "https://docs.servicenow.com/bundle/jakarta-servicenow-platform/page/administer/notification/task/t_CreateANotification.html"

 

Anil74
Tera Guru

Hi,

OR you can follow the below steps to send email notification to guest user

1. create on custom field on form like Guest email and write code as current.guest-email = email.from in inbound action --->to copy the guest email id in about created custom field.

2. create one event.

3. create one business rule 

gs.eventQueue('incident.guestuser',current,gs.u_guest_email);

4. create email notification when event is fired.