Message in SCTASK Worknotes

nameisnani
Mega Sage

Hi Team , 

 

We have requirement that 

 

You can see here 2 sctasks got generated as per the WF . 

 

nameisnani_0-1697448046237.png

 

For eg 

1 . SCTASK0001 

2 . SCTASK0002

 

Our requirement , In the 2nd SCTASK Work notes we need to display message ( ' Please review the attachment on the # SCTASK Dynamically [ Here 1st SCTASK number should come ] ) .  

 

I.e - Please review the attachment on the SCTASK0001 

nameisnani_0-1697448396329.png

 

 

How achieve this requirement please help me with screenshots for better understanding . 

 

Thanks in advance

12 REPLIES 12

Ankur Bawiskar
Tera Patron
Tera Patron

@nameisnani 

so in the 2nd catalog task activity you can use advanced script and use this

var gr = new GlideRecord("sc_task");
gr.orderBy("sys_created_on");
gr.addQuery("request_item", current.sys_id);
gr.setLimit(1);
gr.query();
if (gr.next()) {
	task.work_notes = "Please review the attachment on the " + gr.number;
}

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Hi @Uday Soni05  @Ankur Bawiskar 

 

  1. Thanks for your quick response. 

Sorry that I didn't mentioned before .

 

These behaviour should be only for a particular catalog Eg ( Laptop )  , not for all the catalogues .

Uday Soni05
Tera Guru

@nameisnani 

You can create workflow scratchpad variable in task1 and use it in task 2

Like below screenshot

Task1 Activity:

Screenshot 2023-10-16 at 4.15.26 PM.png

 Task2 Activity:

Screenshot 2023-10-16 at 4.16.30 PM.png

Task2 Comments and Work Notes:

Screenshot 2023-10-16 at 4.18.30 PM.png

 

Please mark this comment as Correct Answer/Helpful if it helped you.
Regards,
Uday

Hi @Uday Soni05 @Ankur Bawiskar 

 

 

 

Thanks for your quick response. 

Sorry that I didn't mentioned before .

 

 

 

These behaviour should be only for a particular catalog Eg ( Laptop ) , not for all the catalogues .

 

Could you please provide me the updated solution.

 

Add Products