Users cannot view the rejection reason in the Employee Center for My Requests

DavidaFS1
Tera Contributor

Users who use the Employee Center to monitor the requests they have submitted (usually via a catalog item) can view the REQ and the RITM, however, when a rejection reason is given by the approver in the SOW or UI16 view , the users cannot see it.  When approvers approve in the Employee Center, the comments are viewable by the requestor.  If users have itil access they can navigate to the RITM and see the rejection reason in the Additional Comments.  What are we missing?

1 ACCEPTED SOLUTION

Tanushree Maiti
Tera Patron

Hi @DavidaFS1 

 

To make the rejection reason visible on the Employee Center, follow these steps:

Configure a Business Rule that copies the comment when an approval is rejected.

 

  1. Create a Business Rule:
  • Name: Copy Rejection Reason to RITM
  • Table: Approval [sysapproval_approver]
  • When: After
  • Update: Check the box
  • Condition: State changes to Rejected AND Approval for starts with RITM

 

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

    if (current.sysapproval.sys_class_name == 'sc_req_item') {

        var ritm = new GlideRecord('sc_req_item');

        if (ritm.get(current.sysapproval)) {

            ritm.comments = current.comments.getJournalEntry(1);

            ritm.update();

        }

    }

})(current, previous);

 

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti

View solution in original post

1 REPLY 1

Tanushree Maiti
Tera Patron

Hi @DavidaFS1 

 

To make the rejection reason visible on the Employee Center, follow these steps:

Configure a Business Rule that copies the comment when an approval is rejected.

 

  1. Create a Business Rule:
  • Name: Copy Rejection Reason to RITM
  • Table: Approval [sysapproval_approver]
  • When: After
  • Update: Check the box
  • Condition: State changes to Rejected AND Approval for starts with RITM

 

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

    if (current.sysapproval.sys_class_name == 'sc_req_item') {

        var ritm = new GlideRecord('sc_req_item');

        if (ritm.get(current.sysapproval)) {

            ritm.comments = current.comments.getJournalEntry(1);

            ritm.update();

        }

    }

})(current, previous);

 

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti