Assign task back to requestor when Parent change ticket state is changed to review

Demo24
Tera Expert

we have the OOB workflow that creates two change tasks when state of change is set to implement.

When the "change" state moves from implement to review or close state, the change task should be assigned to the person who created the change request (requester) and another change task should be assigned to user (say Person A). How to achieve this?

1 ACCEPTED SOLUTION

Vaibhav Dane
Tera Expert
Tera Expert

Hi,

 

You can write before update business rule where you can mention the condition as State changes to Review or State changes to Closed Complete.

 

In the script you can write below code:

var taskGR = new GlideRecord('change_task');

taskGR.addQuery('change_request',current.sys_id);

taskGR.query();

if(taskGR.next()){

taskGR.assigned_to= <user A>;

taskGR.update();

}

current.assigned_to = current.requested_by;

 

Please mark correct if helpful.

 

Regards,

Vaibhav Dane

View solution in original post

7 REPLIES 7

Hi @Musab Rasheed ,

That worked!

Could you please tell me the difference between these two (after and before BRs), I have only read them theoretically but couldn't spot the difference while implementing.

 

Generally when you are updating some other table from based on conditions on current table then you have to go for 'After' business rule but when you are updating on current table then you have to for 'Before' Business rule.

Example : When Incident is closed then update something on Problem record - Write After BR

When Incident is closed then update something on Incident record - Write Before BR.

Best Regards

Please hit like and mark my response as correct if that helps
Regards,
Musab

Thank you!