Planned start date and end date is not getting populated to the change task when change is created

Gayathree Seeth
Tera Expert

Hi,

Could you please help me with this case!!

1. When i create the change request, planned start and end date from the change request is not getting populated into the change task. (But when i update the change with new start and end date it is working)

2. Below is my code from Before Business rule(Insert and update) .

 

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

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

 

GayathreeSeeth_0-1680258836257.png

 

 

 

1 ACCEPTED SOLUTION

Gayathree Seeth
Tera Expert

Hi Kamil and Manju thanks for the help!!

 

I have created the below BR (Before,insert) which helped to populate the start date and end date from the change request to change task.

 

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

// Add your code here
current.planned_start_date=current.change_request.start_date +' ';
current.planned_end_date=current.change_request.end_date +' ';


})(current, previous);

View solution in original post

13 REPLIES 13

Gayathree Seeth
Tera Expert

Hi Kamil and Manju thanks for the help!!

 

I have created the below BR (Before,insert) which helped to populate the start date and end date from the change request to change task.

 

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

// Add your code here
current.planned_start_date=current.change_request.start_date +' ';
current.planned_end_date=current.change_request.end_date +' ';


})(current, previous);

@Gayathree Seeth 

 

You created before insert business rule on sc_task table right?

if yes, any changes done on change for start date and end date won't get updated to task start date and end date field

Mark this answer as correct/helpful  based on impact

Thanks,

Manjusha Bangale

Hi Manjusha,

I have created before,insert BR on Change_task table. And it is not on sc_task table for your information.

@Gayathree Seeth 

 

Yes i got that you created before insert  business rule on change_task table.

After task creation ,if someone updated start date and end date on change record-these changes wont get updated to your task fields as your business rule will execute only once(before record insert)

Mark this answer as correct/helpful based on impact

Thanks,

Manjusha Bangale