Copy change details in the change task

Samiksha2
Mega Sage

Hi All,

I have a requirement to create a UI action to copy change Planned start and end date, short description, description in the change task.

Please help in this.

Thanks,
Sam

22 REPLIES 22

Mani A
Tera Guru

create a ui action on change request and add condition when to visible button and write below logic

copyDetails() ;

function copyDetails() {

var plannedStartDate = current.planned_start;
var plannedEndDate = current.planned_end;
var shortDescription = current.short_description;
var description = current.description;


var taskGR = new GlideRecord('change_task');
taskGR.addQuery('change_request', current.sys_id); /
taskGR.query();

while (taskGR.next()) {
taskGR.planned_start = plannedStartDate;
taskGR.planned_end = plannedEndDate;
taskGR.short_description = shortDescription;
taskGR.description = description;
taskGR.update(); 
}

}

 

Hi @Mani A ,
Button be display in Change task. When anyone create change task, new form will open with the button and once button is clicked the values should auto populate with parent change values

Thanks,
Sam

copyDetails() ;

function copyDetails() {

var taskGR = new GlideRecord('change_request');
taskGR.addQuery('sys_id', current.change_request); 
taskGR.query();
while (taskGR.next()) {
current.planned_start_date = taskGR.start_date;
current.planned_end_date = taskGR.end_date;
current.short_description =taskGR.short_description;
current.description = taskGR.description;
current.update(); 
}
}

Hi @Mani A ,

It is not working.

Thanks,
Sam