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

Can you add %0D%0A instead of <br> and try?


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

Hello Sanjiv that doesnot work 

 

Reg : 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.

in the early message you mentioned that to pre defined we need to create a property 

the mentioned property already exist , can i create a new property and add the email address there ? or does it need to be glide.email.user

Do you have the right email address in the value field of glide.email.user? If the value field is blank, you can enter the email id of your instance.


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

its has some email in the address but different from our instance address , can i create a brand new property called glide.email.user.reopen and call that in the script will that work ?

if not how to hardcode the email value ( the reason i dont want to mess with the existing one is , not sure where and why that is used , i dont want to break any thing .

Yes..You can do that too


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