Knowledge Article - Rejection

Ronald_T
Mega Contributor

Is there a Knowledge Article Rejection Notification setup anywhere?

When I reject a Knowledge Article, how does the Author know I rejected it? I realize they can look in their 'My Knowledge Articles' from time to time to see if there KB Article has been published but I was hoping there was something available that would notify the Author.

I tried creating a Rejection Notification (with event) but it did not work.

We also tried adding it to the Workflow, but there is no choice for 'Author'.

We're using Jakarta.

Thank you.

6 REPLIES 6

sachin_namjoshi
Kilo Patron
Kilo Patron

Hi Ronald,



There is no OOB notification for knowledge article rejection.


I have configured knowledge article rejection notification on your instance.



This notification is triggered on event.


Event is generated by business rule.



Please see below sample code of business rule


This business rule runs on kb_knowledge table and with condition of current.workflow_state.changes()



find_real_file.png



if (current.workflow_state.changesTo('rejected')) {


    // Send Notice when a KB Article is 'Rejected'.


    gs.eventQueue("kb_knowledge.approval.rejected", current, current.number, current.author);


}



I hope this helps you to resolve issue.



Regards,


Sachin


Wow! Yes extremely helpful. Thank you!


How could I add the rejection comments?



Thank you.


You can configure mail script to get rejection comments are refer mail script in your email notification.



Please see example below



Create mail scripts in System Policy > Email > Notification Email Script->




  1. (function runMailScript(current, template, email, email_action, event) {  
  2.   var item = new GlideRecord("sc_req_item");  
  3.   item.addQuery("request", current.sys_id);  
  4.   item.query();  
  5.   while(item.next()) {  
  6.   var catalogItem = item.number + ': ' + item.cat_item.getDisplayValue();  
  7.   var misc = item.variable_pool.alt_poc;  
  8.   template.print(catalogItem + "<br/> Field: " + misc);  
  9.   }  
  10. })(current, template, email, email_action, event);  


Now you can call the above mail script in email notification(Message HTML) as ${mail_script:script name}


Here replace script name with the exact name of the notification email script you have created in step 1.



Regards,


Sachin