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.

Knowledge Article Rejected Email Notification for Retirement

Ash33
Tera Expert

Hi all

 

I have a requirement to send a notification to the knowledge author once the knowledge article is REJECTED on retirement.

Workflow: Click Retire UI action > State changes to Pending Retirement > Approval/Rejection is sent to approver > Requirement {if rejected, send an email to knowledge author}

How do I achieve the above requirement?

Thanks,
Ash

1 ACCEPTED SOLUTION

Ash33
Tera Expert

I configured this solution and it has worked for me.

Step 1: Create an event in the sysevent_register table.

for eg;

Name = knowledge.retire.rejected;
Table = kb_knowledge

Step 2:
After Update BR on kb_knowledge table
Script:

(function executeRule(current, previous /*null when async*/ ) {

    // Only run when state changes from pending_retirement to published
    if (previous.workflow_state == 'pending_retirement' &&
        current.workflow_state == 'published') {
var authorSysId = current.author.toString();
gs.eventQueue('kb.retirement.rejected', current, authorSysId);
    }
})(current, previous);

Step 3: Create notification on kb_knowledge table
When to send: event is fire
Event name: select event created in step 1
Who will receive:
Event parm 1 contains recipient;
 

View solution in original post

4 REPLIES 4

Mark Manders
Mega Patron

Just create a notification on the knowledge article table. Condition = 'workflow changes to retired' and you send the email to the author. Straightforward, just like with every notification.

 

Maybe also follow this thread, although I have the feeling you know about it: https://www.servicenow.com/community/architect-forum/i-have-a-requirement-to-send-a-notification-to-...


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

Its not straightforward.

When a knowledge article is in the pending_retirement stage, an approval is sent to the approver. Once approver rejects it, the state changes to "published". That is when I require the notification to be triggered to the author.

@Ash33 

 

Workflow - 'Knowledge - Approval Retire'. When Approval is rejected, customize the workflow to send an email notification along with out of box WF activity 'Move Article to Initial State'

 

https://www.servicenow.com/docs/bundle/xanadu-servicenow-platform/page/product/knowledge-management/...

 

Bhuvan_1-1755236444719.png

Thanks,

Bhuvan

 

 

Ash33
Tera Expert

I configured this solution and it has worked for me.

Step 1: Create an event in the sysevent_register table.

for eg;

Name = knowledge.retire.rejected;
Table = kb_knowledge

Step 2:
After Update BR on kb_knowledge table
Script:

(function executeRule(current, previous /*null when async*/ ) {

    // Only run when state changes from pending_retirement to published
    if (previous.workflow_state == 'pending_retirement' &&
        current.workflow_state == 'published') {
var authorSysId = current.author.toString();
gs.eventQueue('kb.retirement.rejected', current, authorSysId);
    }
})(current, previous);

Step 3: Create notification on kb_knowledge table
When to send: event is fire
Event name: select event created in step 1
Who will receive:
Event parm 1 contains recipient;