Reopen an incident using an email

RudhraKAM
Tera Guru

Hello team 

I updated my existing resolve notification with a link , when the incident is resolved and if the user dont feel thats resolved , user can click on that link and it will open a email with pre defined subject and To field , 

when the user sent that email it will trigger a inbound email action and will set the state of the incident to work in progress .

Every thing is working fine 

 

what if user manually changes the incident number (that will act on that Incident number ) so is there any way we can use the water mark from the resolved notification and act on the incident associated with that 

 

find_real_file.png

when clicked on the link it will open like below (if user change the incident number that would be an issue), so can  we use watermark from the above notification and act on the state?

Can we predefine the to address ? 

find_real_file.png

Mail script which i am using

(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
          /* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
          /* Optional GlideRecord */ event) {

          // Add your code here
	

var url='<a href="mailto:' + gs.getProperty('glide.email.user') + '?subject=Re: Please Reopen the incident '+current.number+'">'+ 'click here to reopen the incident' +'</a>';
template.print(url);

})(current, template, email, email_action, event);

 

one more issue is there is a UI action to reopen the incident (OOB ) which is not visible on incident  , what is the condition meaning ? 

find_real_file.png

1 ACCEPTED SOLUTION

SanjivMeher
Kilo Patron
Kilo Patron

You can pass the watermark like this

(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
          /* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
          /* Optional GlideRecord */ event) {

          // Add your code here
	

var url='<a href="mailto:' + gs.getProperty('glide.email.user') + '?subject=Re: Please Reopen the incident '+current.number+'&amp;body='+ email.watermark +'">'+ 'Click here to reopen the incident' +'</a>';
template.print(url);

})(current, template, email, email_action, event);

 

To prepdefine the To address, you should create the property 'glide.email.user' if it already doesnt exists in sys_property table and specify the to address there.


Following is the script. it means, incident can only be opened in Resolved State and it shouldn't be a Major Incident,

find_real_file.png


Please mark this response as correct or helpful if it assisted you with your question.

View solution in original post

9 REPLIES 9

SanjivMeher
Kilo Patron
Kilo Patron

You can pass the watermark like this

(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
          /* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
          /* Optional GlideRecord */ event) {

          // Add your code here
	

var url='<a href="mailto:' + gs.getProperty('glide.email.user') + '?subject=Re: Please Reopen the incident '+current.number+'&amp;body='+ email.watermark +'">'+ 'Click here to reopen the incident' +'</a>';
template.print(url);

})(current, template, email, email_action, event);

 

To prepdefine the To address, you should create the property 'glide.email.user' if it already doesnt exists in sys_property table and specify the to address there.


Following is the script. it means, incident can only be opened in Resolved State and it shouldn't be a Major Incident,

find_real_file.png


Please mark this response as correct or helpful if it assisted you with your question.

Thanks Sanjiv 

The water mark is copying properly , but it is on the starting of the body .how to show the below format 

how to add a text : please type the reason below and send 

 

watermark 

 

and the code you mentioned at the bottom ,where do i need to put that ?

If i understand the code correctly if incident is resolved and any user can do it and not p1,p2,p3 correct ?

Try this

 

(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
          /* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
          /* Optional GlideRecord */ event) {

          // Add your code here
	

var url='<a href="mailto:' + gs.getProperty('glide.email.user') + '?subject=Re: Please Reopen the incident '+current.number+'&amp;body=Please type the reason below and send.<br><br>'+ email.watermark +'">'+ 'Click here to reopen the incident' +'</a>';
template.print(url);

})(current, template, email, email_action, event);

 

The code was response to below question. the condition call that script to check if incident is in resolved state.

one more issue is there is a UI action to reopen the incident (OOB ) which is not visible on incident  , what is the condition meaning ? 


Please mark this response as correct or helpful if it assisted you with your question.

Thanks Sanjiv 

this is how its showing , i tried <br> <br/> /n too none worked

next line is not working 

 

find_real_file.png