how to make the rejected comments visible to the requester in service portal as well as work notes?

Yerasu Mallikar
Kilo Contributor

how to make the rejected comments visible to the requester in service portal as well as work notes?

@Ankur Bawiskar @shloke04 @Mark Roethof @dvp @Anil Lande @Jaspal Singh @asifnoor 

1 ACCEPTED SOLUTION

update line 8 as this

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

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

9 REPLIES 9

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

can you share screenshot?

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

As the approver tries to reject the request

find_real_file.png

so when approver rejects the comments should be visible to requester in work notes as well as in service portal 

find_real_file.png

find_real_file.png

requester view:

find_real_file.png

ersureshbe
Giga Sage
Giga Sage
Hi, Additional comments field is a mediator to display to information in service portal. Worknotes is part of agent and service desk , resolver group usage. I assume you rejection comments info displayed in worknotes the should popup in additional comments then requester can see the info. If rejection is happening with the help of email you should write inbound action email script and it's happening as manual you should write the script based on sys approval table. Please mark as helpful correct answer if it helped. Regards, Suresh.
Regards,
Suresh.

shloke04
Kilo Patron

Hi @Yerasu Mallikarjuna Reddy ,

What you can do here is when an Approver reject a Approver copy that Rejection comments to Work Notes of Requested Item record.

This can be done using a After Update Business Rule on Approval Table as per details mentioned below:

BR Details:

table: Approval (sysapproval_approver)

When: After Update

Condition: Approval For --> Task Type is Requested Item AND State Changes to Rejected

Script:

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

	// Add your code here
	var gr = new GlideRecord('sc_req_item');
	gr.addQuery('sys_id',current.sysapproval);
	gr.query();
	if(gr.next()){
		gr.comments = current.getJournalEntry(1);
		gr.update();
	}

})(current, previous);

find_real_file.png

My suggestion here will be to update Additional Comment fields as Work notes is a field which is ideally used for internal communication between the fulfillers and are not meant to be shown to the Requestor who has created the ticket.

Additional comment fields are by default visible on the portal so that will solve your requirement as well.

Let me know if you have a follow up query.

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke