Close all the Tasks when Change is Closed

NehaSNOW
Tera Guru

Hi Team,

 

I want to Close all the Tasks when the Change Reques (CR) is Closed. For this, I have designed the Flow Designer but when I Change the status of the CR is shows me the Error: - "Invalid Update. Unable to close the Change request as there are open Change tasks."

Please suggest.

NehaSNOW_1-1754738893537.png

 

 

NehaSNOW_0-1754738824849.png

 

1 ACCEPTED SOLUTION

Viraj Hudlikar
Giga Sage

Hello @NehaSNOW 

 

This is happening due to OOTB BR named "Check open change_tasks" and before closing CHG request it's always best to close all CTask prior closing the CHG.


If my response has helped you hit helpful button and if your concern is solved do mark my response as correct.

 

Thanks & Regards
Viraj Hudlikar.

View solution in original post

3 REPLIES 3

Rafael Batistot
Tera Sage

Hi @NehaSNOW 

 

May you consider create a business rule? it’s more functionality 


Creante a BL with the condition 

after > updated

 

(function executeRule(current, previous) {
var grTask = new GlideRecord('task');
grTask.addQuery('parent', current.sys_id);
grTask.addEncodedQuery('stateNOT IN3,4,7');
grTask.setValue('state', '3');
grTask.setValue('work_notes',
"Task has been closed automatically because the associated Change Request (" + current.number + ") was closed."
);
grTask.updateMultiple();
})(current, previous);

Viraj Hudlikar
Giga Sage

Hello @NehaSNOW 

 

This is happening due to OOTB BR named "Check open change_tasks" and before closing CHG request it's always best to close all CTask prior closing the CHG.


If my response has helped you hit helpful button and if your concern is solved do mark my response as correct.

 

Thanks & Regards
Viraj Hudlikar.

Bhuvan
Kilo Patron

@NehaSNOW 

 

There is a Business Rule that checks whether change tasks are closed before closing a change. This is the reason Flow is not getting triggered as the condition is not met. 

 

Your requirement is a major change in the Change Process flow, so check with your Change Management team if they are fine with automating change tasks closure on change closure. If you do not want to validate change tasks are closed before closing a change, disable this BR and try the flow. 

 

Bhuvan_0-1754742256588.png

Below is a sample Flow that will update multiple records and set change tasks to closed when change is closed after disabling the BR,

Bhuvan_1-1754744150382.png

 

Bhuvan_3-1754744196490.png

Bhuvan_4-1754744232524.png

Thanks,

Bhuvan