How to add KB contributor in approval/rejection mail, while sending a notification?

AmitK1382912422
Tera Contributor

Hi,


Could someone please assist me in adding the KB Contributor to the approval/rejection email notifications?

 

Thanks & regards,

Amit Kumar

5 REPLIES 5

AnkaRaoB
Giga Guru

Hi @AmitK1382912422 ,


To Add the KB Contributor as a recipient using an Advanced Recipient Script in the notification.

Steps to follow

  1. Navigate to System Notification --Email -- Notifications
  2. Open the Knowledge Approval / Rejection notification
  3. Go to the Recipients tab
  4. Enable Advanced
  5. Add the following script

Advanced Recipient Script

var kb = current.sysapproval.getRefRecord();

if (kb && kb.isValidRecord()) {

    answer = kb.kb_contributor; // or kb.author / custom contributor field

}

Notes

  • Works for both approval and rejection notifications
  • If the notification is based directly on kb_knowledge, you can instead add the contributor field under Users/Groups in fields
  • Replace kb_contributor with the correct field if your instance uses author or a custom contributor field

    If my response helped mark as helpful and accept the solution

Hi @AnkaRaoB  ,

Your solution is correct and using an Advanced Recipient Script is the right approach when the notification is triggered from sysapproval_approver.

One important detail that may be missing and is worth clarifying is the notification table context.

If the notification is based on sysapproval_approver, then using:

current.sysapproval.getRefRecord();

is required, because current refers to the approval record, not the KB article.

However, if the notification is instead configured on kb_knowledge, the Advanced Recipient Script is not needed at all. In that case, the KB contributor field, for example author, kb_contributor, or a custom field, can be added directly under Users or Groups in fields in the Recipients section.

Additionally, it is good practice to add a null check to avoid silent failures if the contributor field is empty, for example:

var kb = current.sysapproval.getRefRecord();

if (kb && kb.isValidRecord() && kb.kb_contributor) {

    answer = kb.kb_contributor;

}

Clarifying this helps avoid confusion and ensures the solution works correctly depending on how the KB approval notification is implemented.

Hope this helps @AmitK1382912422 .

AmitK1382912422
Tera Contributor

Actually I have to send notifications to kb contributor & author at a time. But I can’t see any field like contributor. As I can see the author field the notification is going to only author. Please provide the solutions.

AmitK1382912422
Tera Contributor

Hi Team,

 

I need to send notification to both contributor & Author at a time. I cant see the field like Contributor in the form view of KB. Here i am attaching the screen sort. Please provide me the solution.

AmitK1382912422_0-1769961614590.png