How could I get the workflow Task assigned_to name to use to another task

Andre6
Mega Expert

Hi,

I'm trying to get the Task assigned_to name from a Task and paste the name to another Task work notes.
Ex.: From Task 1, I want to get the Task assigned_to name and then paste the name to the Task3 work notes

Andre6_0-1686921637729.png

I tried with that script in

Task1

workflow.scratchpad.task1 = task.assigned_to;

 

Task3, but it paste me the assigned_to name of the previous Task (Task 2)

var gra = new GlideRecord('sc_task');
gra.get(workflow.scratchpad.task1);
var assignee = gra.assigned_to.getDisplayValue();

 

I need your lights!

 

Thanks

1 ACCEPTED SOLUTION

I resolved my issue.
I made a change to the Task1:

workflow.scratchpad.task1 = task.setNewid();

Modified Task2 and Task4 by using workflow.scratchpad.task2
Task3:

var gra = new GlideRecord('sc_task');
gra.get(workflow.scratchpad.task1);
assignee = gra.assigned_to;

 

use assignee.getDisplayValue() in the work notes
now all Tasks work as expected
Thanks for help!

View solution in original post

6 REPLIES 6

I just noticed that the Task2 is also using the workflow.scratchpad.task1 to be used in the Task4

 

I resolved my issue.
I made a change to the Task1:

workflow.scratchpad.task1 = task.setNewid();

Modified Task2 and Task4 by using workflow.scratchpad.task2
Task3:

var gra = new GlideRecord('sc_task');
gra.get(workflow.scratchpad.task1);
assignee = gra.assigned_to;

 

use assignee.getDisplayValue() in the work notes
now all Tasks work as expected
Thanks for help!