workflow activity comments

Saib1
Tera Guru

Hi,

 

Can someone tell me how to add the comments when the request approved 

 

Need to give the RITM that who has approved it .

 

Example : RITM has been approved by Adam George 

 

 

 

 

 

Shohaib_0-1674040152634.png

 

 

Shohaib_1-1674040280702.png

 

 

Shohaib_2-1674040385418.png

 

1 ACCEPTED SOLUTION

var approver = approvalBy.name;

change this line to var approver = approvalBy.approver.name;

 

 

View solution in original post

8 REPLIES 8

Basheer
Mega Sage

Hi @Saib1 

There is some error in scripting

modify as below

current.work_notes = "RITM is approved";

 

Let me know if you need more help on this as I just looked into the screenshot and modified the code.

@Basheer - Here all i need is need to add who has approved in the comments .

 

What to do ?

 

Example if Adam George approve the RITM

 

it should come as RITM has been approved by Adam George 

 

Do like this

var record = current.getUniqueValue();

 

var approvalBy = new GlideRecord("sysapproval_approver");

approvalBy.addQuery("document_id",record);

approvalBy.addQuery("state","approved");//Add state only if there are mulitple approvers

approvalBy.query();

if(approvalBy.next()){

var approver = approver.name

}

 

current.comments = "RITM approved by : " + approver;

current.work_notes = "RITM approved by : "+approver;

@Basheer - it shows 

 

RITM was approved by undefined