On opening Change task planned start/end date should be same as Change request , also when change request planned dates are updated , Change Task planned date should be updated as well

Mishu
Tera Expert

Change task planned start/end date should be same as Change request , also when Change Request planned dates are updated , Change Task  planned date  should be updated as well

1 ACCEPTED SOLUTION

shloke04
Kilo Patron

Hi,

Please write a After Insert and Update Business Rule on Change request table and use the script as below:

(function executeRule(current, previous /*null when async*/) {

	// Add your code here
	var gr = new GlideRecord('change_task');
	gr.addQuery('change_request',current.sys_id);
	gr.query();
	while(gr.next()){
		gr.planned_start_date = current.start_date.getDisplayValue();
		gr.planned_end_date = current.end_date.getDisplayValue();
		gr.update();
	}

})(current, previous);
Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

View solution in original post

5 REPLIES 5

Also for reference, I am attaching the BR screenshot . Also make sure the condition of BR should be as below:

Planned Start Date Changes

OR

Planned End Date Changes

find_real_file.png

I have tested this and it is working in my PDI.

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke