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

Thanks for the Reply!! We tried in the same way. But the same issue occurred.

Is you BR setup to run After or Before?

My BR is setup to After only as you suggested

 

@Gayathree Seeth 

 

Just add info message in your business rule and check whether it is executing or not

use gs.addInfoMessage("Checking br");

 

Thanks,

Manjusha Bangale

Sure Manju!!

Will try in the same way.