Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Rejected reason in a email

renatasanto
Tera Contributor

Hi,

I hope this email finds you well.

 

I am creating a notification (table: sysevent_email_action) that should be sent to a article's author when your material is rejected. I would like to add the reason of the rejection in the email body, but I do not know how can I do that using the tool "Select variables". 

Can anybody help me with that, please?

2 REPLIES 2

Mohammed8
Mega Sage

@renatasanto 

I'm assuming you mean to target knowledge table / article right?

 

In ServiceNow we have OOTB option , you can check this out: 

You can check it by navigating to: System Notification -> Email -> Notifications -> Article rejected for publish

Mohammed8_0-1762225729103.png

 

An Email Script is used in the body because it can pull and format data from related tables and apply logic, whereas “Select variables” can only display fields directly from the record. If you want to customize or tailor the solution, you need to understand how the Email Script (km_rejects) works in your use case

 

Please mark helpful if you found this useful

 

Thanks and Regards,

Mohammed Zakir

Sarthak Kashyap
Mega Sage

Hi @renatasanto ,

 

Can you please try to create a email script and add using current you can get the field rejectedcomment and you can use the below reference code 

var rejectedComment = current.rejected_comment;
template.print(rejectedComment);
 
Use this email script in your notification.
${mail_script:test_script}
 
Please mark my answer correct and helpful if this works for you
Thanks and Regards,
Sarthak