how to add a current kb article number from email notification script?

raj765_32
Tera Contributor

Hi can anyone help me with the code correction for adding the current kb article number for the email notification script ..
iam able to add kb article number but when i click on kb article it is going to new record, but not the kb article number record.

 

Please see the code below.

 

(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
          /* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
          /* Optional GlideRecord */ event) {
var portal = gs.getProperty("sn_km_portal.glide.knowman.serviceportal.portal_url",'kb');
 
    template.print("Hi "+current.assigned_to.first_name+",<br/>");
template.print("<br/>");
template.print("A feedback requires your action ");
template.print("<a href='"+gs.getProperty('glide.servlet.uri')+ "kb_feedback_task.do?sys_id="+ current.sys_id + "'>"+ current.number +"</a><br/><br/>");
template.print("<b>Article: </b>");
template.print("<a href='"+gs.getProperty('glide.servlet.uri')+ "kb_knowledge.do?sys_id="+ current.feedback.article + "'>"+current.u_article.getDisplayValue()+"</a><br/>");
template.print("<b>Article Title</b>: "+current.feedback.article.short_description+"<br/>");
template.print("<b>Reason:</b> "+current.feedback.reason.getDisplayValue()+"<br/>");
template.print("<b>Description:</b> "+current.description+"<br/>");
template.print("<b>Assigned by:</b> "+event.parm2+"<br/>");
 
 
})(current, template, email, email_action, event);
3 REPLIES 3

Samaksh Wani
Giga Sage
Giga Sage

Hello @raj765_32 

 

You need to change this line :-

 

template.print("<a href='"kb_feedback_task.do?sys_id="+ current.sys_id + "'>"+ current.number +"</a><br/><br/>");

 

Plz Mark my Solution as Accept and Give me thumbs up, if you find it Helpful.

 

Regards,

Samaksh

 

 

 

 

hi it is going to kb feedback task but it should go to kb article number. not kb feedack number

Hello @raj765_32 

 

Use this :-

 

template.print("<a href='"kb_knowledge.do?sys_id="+ current.sys_id + "'>"+ current.number +"</a><br/><br/>");

 

Plz Mark my Solution as Accept and Give me thumbs up, if you find it Helpful.

 

Regards,

Samaksh