On Service Portal While reject, when we enter comments in One RITM. It is reflection all other RITM

vivek11
Tera Contributor

Hi Team

Requirement = When we reject RITM. Comments should be mandatory. 
I have done changes it is working as expected in Service Portal  Approval Form View.  But It is working in Service Portal List View. Rather when we enter comments in One RITM. It is reflection all other RITM on Service Portal List View Approval Records.

 
2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

@vivek11 

you must have written some custom logic for this.

In that logic possibly it's not able to query the particular record and is updating every record

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

Hi @Ankur Bawiskar 

 

In Server side script I have updated (which is bold letters).
if (input.op == 'approved' || input.op == 'rejected') {
var app = new GlideRecord("sysapproval_approver");
if (app.get(input.target)) {
var isMine = gs.hasRole("approval_admin") || (gs.hasRole("approver_user") && isApprovalMine(app));
if (isMine) {
app.state = input.op;
if (input.comment){
        app.comments = input.comment;
}
app.update();
if (currentPage > 0 && !input.pagination.hasNext && input.approvals.length == 1) {
currentPage--;
initRow = (currentPage * maxNumberOfItemsInTheList);
lastRow = initRow + ma


Could you please check and let me know What I need to change