Knowledge Approval emails

daniellethomson
Tera Expert

Hello!

I have created an approval email notification and template for a knowledgebase approval workflow and I cannot get the email to kick off. I have approval emails for Change and Request that fire based on task type Change/Request but I cannot find a condition for knowledge that is working. I thought it would be knowledge submission but that isn't it.

Any idea how to fire an approval email based on knowledge in review state to be approved to be published?

Thank you!

Danielle

1 ACCEPTED SOLUTION

Hi Leah,



I worked with HI on a solution for this and I have to create a mail script to make this work since the notification needs to come from the approval table but the fields are on the KB table. All is working for us now. I hope this helps!


View solution in original post

28 REPLIES 28

Please mark as helpful if you find it so.





Jon



Jon Mulherin


EA Process Architect


Off: +1 (914) 323-5775


Cell: +1 (214) 649-0738


Todd_Goodhew
Kilo Guru

Posting this for anyone else that has this issue and needs the solution.  It's much simpler than a mail script.  There are 2 pieces to it all.

1. The workflow will generate an event.  It can be seen in the Event log.  We just need to register this event and set the notification to look for it.  This will cause the notification to fire.  Be sure to still set the Table in the notification to Approval [sysapproval_approver].  When creating the event, I just duplicated the event for "approval.inserted" and gave it the Event Name as seen in the event log.

        Event to Register:  kb_knowledge.approval.inserted

   If you want it to for for rejected, then do the same.

2. To put fields from the KB into the notification we have to change how we reference the field.  Since this is the Approval table, we are all probalby used to using ${sysapproval.URI_REF} or ${sysapproval.name}.  That works great for tables that were extended from Task.  For Knowledge, this table was not extended from Task and thus needs to be referenced this way:  ${document_id.URI_REF} or ${document_id.name}

 

Background:

Why for non-task extended tables do we need to use document_id instead of sysapproval?

Simple, the field sysapproval (which is on the Approval table) is a reference field to the Task table.  Since our table was not extended from Task, such as in the case of kb_knowledgebase, that field is empty.  Instead, we have to rely on the document_id field which is of type Document ID.

Although you do see where the event is firing in the event log, the notification never got sent.  The above solution given by Tiffany worked for me

A Kose
Tera Contributor

Hi there, 

This post really helped @jonmulherin @Todd_Goodhew . But, I now have to filter by knowledge base. I thought I could use an advanced condition to only trigger a notification if the Knowledge Base isn't IT. This is what i have so far but it is triggering the email notification for all knowledge bases, any advise would be great, please. 

 

var kbGR = new GlideRecord("kb_knowledge"); 
kbGR.addQuery("sys_id", current.document_id); 
kbGR.query();
 
var knowledgeBase = kbGR.kb_knowledge_base.getDisplayValue();
 
knowledgeBase != 'IT KB';  //returns true if KB != IT and notification is triggered
 
Any direction would be great please