Auto Assignment of Assigned to for sc_task

Thanuja K
Tera Contributor

Hi Guys,

 

We have built one catalog item and it has 5 tasks, once RITM is approved, tasks will create as per the custom workflow built for the specific catalog item.

We need same 'assigned to' auto assignment for 'task 3'  from  'task 1'. 

for ex: if 1st task is 'assigned to is ABC' and second task gets closed after that third task will create, for this 3rd task 'Assigned to should update as ABC' only, this is our requirement. please let us know how to achieve this. 

1 ACCEPTED SOLUTION

Harish Kota
Kilo Sage

Hi Thanuja,

You can achieve this by following the process:

 

In Workflow for Task 1 creation - catalog task
In Advanced condition, write the below piece of code and update
workflow.scratchpad.lastTask=task.number;

 

and in the same workflow Task 3 creation - catalog task
In Advanced condition, write the below code and update

var gr = new GlideRecord("sc_task");
gr.addQuery("number", workflow.scratchpad.lastTask);
gr.query();

if (gr.next()) {
var AT = gr.assigned_to;
task.assigned_to = AT;
}

this will take 'assigned to from task 1' by using scratchpad and it will update 'same assigned to for catalog task 3'.

Please update the same in your workflow and confirm, if the solution works for you, please hit like or Accept the solution, others also know about this solution.

 

Thanks,
Harish.

View solution in original post

2 REPLIES 2

Harish Kota
Kilo Sage

Hi Thanuja,

You can achieve this by following the process:

 

In Workflow for Task 1 creation - catalog task
In Advanced condition, write the below piece of code and update
workflow.scratchpad.lastTask=task.number;

 

and in the same workflow Task 3 creation - catalog task
In Advanced condition, write the below code and update

var gr = new GlideRecord("sc_task");
gr.addQuery("number", workflow.scratchpad.lastTask);
gr.query();

if (gr.next()) {
var AT = gr.assigned_to;
task.assigned_to = AT;
}

this will take 'assigned to from task 1' by using scratchpad and it will update 'same assigned to for catalog task 3'.

Please update the same in your workflow and confirm, if the solution works for you, please hit like or Accept the solution, others also know about this solution.

 

Thanks,
Harish.

Hi Harish,

 

Thank you, solution works for us.