email client template

lalithkumar
Tera Contributor

hi everyone i need help to configure the subject in email client templates 

lalithkumar_0-1741587449241.png

here in subject i want incident record's related record short description  it is possible to configure ? if yes can anyone help me how to do it 

2 ACCEPTED SOLUTIONS

Hi @lalithkumar , For this, we will have to script and query the related records, so we need mail script. But you can't add a mailscript to the subject, but you can call a mailscript in the body and set the subject. Try this -

var gr = new GlideRecord("change_task");
    gr.addQuery("change_request", current.sys_id);
    gr.query();
    if (gr.next()) {
        var subject = gr.number + ' - ' + gr.short_description;
    }
    email.setSubject(subject);

View solution in original post

Hi @lalithkumar yes. Unfortunately, the email client template does not have access to the 'email' object. Sorry, I missed that. 

View solution in original post

8 REPLIES 8

Hi @lalithkumar , For this, we will have to script and query the related records, so we need mail script. But you can't add a mailscript to the subject, but you can call a mailscript in the body and set the subject. Try this -

var gr = new GlideRecord("change_task");
    gr.addQuery("change_request", current.sys_id);
    gr.query();
    if (gr.next()) {
        var subject = gr.number + ' - ' + gr.short_description;
    }
    email.setSubject(subject);

lalithkumar_0-1741590922023.png

i tried like this but its not working .

Hi @lalithkumar yes. Unfortunately, the email client template does not have access to the 'email' object. Sorry, I missed that. 

PrashantLearnIT
Tera Sage

Hi @lalithkumar 

 

This will work here for Email Client Template ${number} - ${short_description}

 

Mark this as correct answer if it works for you