Start date same as planned start date

J_31
Kilo Sage

I want to populate start date and end date based on planned start date and planned end date

 

run a fix script to update existing records in rm_sprint table , wrap this as a  function 

 

can someone help with code 

3 REPLIES 3

Saurabh Gupta
Kilo Patron
Kilo Patron

Hi,
You just want a copy or something else based on planned start date and planned end date?

 

 


Thanks and Regards,

Saurabh Gupta

Anil Lande
Kilo Patron

Can you please share what you did?

 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

Harish KM
Kilo Patron
Kilo Patron

Hi @J_31 Find below script which maps planned start and end dates to  start and end dates

updateDate();
function updateDate(){
var rm= new GlideRecord('rm_sprint');
rm.addEncodedQuery('end_dateISNOTEMPTY^start_dateISNOTEMPTY'); // ensure planned end and start date are not empty
rm.orderBy('sys_created_on'); //order by created on
rm.query();
while (rm.next()){
rm.start=rm.start_date;// planned start date
rm.end = rm.end_date; // planned end date
rm.setWorkflow(false); //Do not run business rules
rm.autoSysFields(false); //Do not update system field
rm.update();
}
}

Regards
Harish