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

Business Rule also written but as mentioned in screen shot when ever the requester checks on his Ticket in Service Portal Rejection Comments are not visible 

@asifnoor @Ankur Bawiskar @shloke04 @Anil Lande @Jaspal Singh @Chuck Tomasi @Chuck Tomasi (personal account) 

Approver View:

find_real_file.png

 

Requester View:

find_real_file.png

As it should show the comments right

in this screen shot can see that rejection comments are not showing to the requester in servicenow view 

find_real_file.png

in business rule written as mentioned in the below screen shots @Chuck Tomasi @Chuck Tomasi (personal account) @shloke04 @asifnoor @Ankur Bawiskar @Jaspal Singh @Anil Lande 

find_real_file.png

Script:

find_real_file.png

 

Business Rule also written but as mentioned in screen shot when ever the requester checks on his Ticket in Service Portal Rejection Comments are not visible 

Approver View:

find_real_file.png

 

Requester View:

find_real_file.png

As it should show the comments right

in this screen shot can see that rejection comments are not showing to the requester in servicenow view 

find_real_file.png

update line 8 as this

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

Regards
Ankur

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

if we want to run on particular catalog item then what should we need to write the script in business rule @Ankur Bawiskar @shloke04 @Chuck Tomasi @Chuck Tomasi (personal account) @Anil Lande 

update as this

(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.addQuery('cat_item.name', 'Your Item Name Here');
    gr.query();
    if(gr.next()){
        gr.comments = current.comments.getJournalEntry(1);
        gr.update();
    }

})(current, previous);

Regards
Ankur

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