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

GopikaP
Mega Sage

Hi @lalithkumar , Yes you can, please try this

${number} - ${short_description}

but i want realted records short description 

Hi @lalithkumar 

 

If there are 5 related records, which record short description must be considered for template?

********************************************************************************************************
Please appreciate the efforts of community contributors by marking the appropriate response as the correct answer and helpful. This may help other community users to follow the correct solution in the future.

********************************************************************************************************
Cheers,
Prashant Kumar
ServiceNow Technical Architect


Community Profile LinkedIn YouTube Medium TopMate
********************************************************************************************************

first realted record short description i want to display in subject