Export a PDF of resolved incident automatically and attach a attachment in email notification.

Sweenal
Tera Contributor

Hi All,

Please help me with this below usecase:

Create a incident record, when incident state changes to "Resolved." I need to export that PDF of resolved incident automatically & attach a attachment in Email notification.

 

 

Thanks

Sweenal 

6 REPLIES 6

Murthy Ch
Giga Sage

@Sweenal Umredkar 

Create a business rule to attach the attachment to the current resolved incident.

After then in your notification click on Include Attachments check box.(It will add the attchement to the email with the triggered record).

Sample BR:

find_real_file.png

(function executeRule(current, previous /*null when async*/ ) {

    var rm = new sn_ws.RESTMessageV2();
    rm.setHttpMethod('GET');
    var url = gs.getProperty("glide.servlet.uri") + current.getTableName() + '.do?PDF&sys_id=' + current.sys_id;
    rm.setEndpoint(url);
    // Create new properties and save user id and password of an admin account
    rm.setBasicAuth('admin', 'your password');
    rm.saveResponseBodyAsAttachment(current.getTableName(), current.getUniqueValue(), current.number + ".pdf");
    var response = rm.execute();

})(current, previous);

Hope it helps

I used this script in my PDI a long back and it worked fine for me

Thanks

Murthy

Thanks,
Murthy

My whole requirement is :

  • Create a incident record, when incident state changes to "Resolved." ,
  • Export a PDF of resolved incident automatically & attach a attachment in Email notification.
  • Send Notification to the caller with attached attachment of incident record.

So i need to do these two changes can you help with this.

 

Thanks

Sweenal

Okie

What have you tried so far?

 

Thanks,
Murthy

Hi,

This is not working can you please me with this.

 

 

Thanks

Sweenal