Ho w to Field details and URL in Email notification

jugantanayak
Tera Guru

Hi,

Anyone can please help me on, how I can add Integration field details in the watchdog notification and URL(view) for that particular record.

Screenshots attached to this post.

Table : sn_vul_integration_run

Field: Integration

I have written one email script but it seems it's not working.

Script:

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

    var count = event.parm1;
    var log = event.parm2;
    var body = gs.getMessage("You are receiving this email because you are subscribed to the watchdog alert: {0}.<br/><br/> The WatchDog alert rule currently generates {1} alerts.<br/><br/>Note that system automatically runs watchdog alert {2} based on current scheduler interval.", [current.name, count, current.name]);
    template.print(body);
    var recordURL = gs.getProperty('glide.servlet.uri') + "/sn_sec_cmn_watch_log.do?sys_id=" + log;
    template.print('<a class="button" href="' + recordURL + '">View</a>');

})(current, template, email, email_action, event);
 
jugantanayak_0-1705602031937.png

 

jugantanayak_0-1705649758966.png

 


 


Thanks in advance.

 

Regards,

Juganta

5 REPLIES 5

SanjivMeher
Kilo Patron
Kilo Patron

I think you can make correction here

var recordURL = gs.getProperty('glide.servlet.uri') + "/sn_vul_integration_run.do?sys_id=" + log;

 

Also never expose your company URL on public forums. You should remove the address bar part in your screenshot


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

Hi @SanjivMeher ,

Thanks for your kind advice, I have corrected as per your advice

Regards,

Juganta

How about below?

var recordURL = gs.getProperty('glide.servlet.uri') + "/sn_vul_integration_run.do?sys_id=" + current.sys_id;


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

Hi @SanjivMeher ,

It's not working.

It's creating a new record every time I clicked on the View link.

Is there would any other solution?

Regards,

Juganta