How to AutoPopulate the Change Task fields namely (assignment group, Planned start/end Date).

jabaya
Mega Guru

Hello, 

So I'm trying to Auto populate the  Change Task fields namely (assignment group, Planned start/end Date). right after clicking  the Implement button (please see screenshot)on the Change Request form.
so that this change task fields will get the same values from the same fields of change request form.

I did try to create a business rule but I'm only able to auto populate it when I hit the new button from the change task directly.

 

Appreciate any help, Thankyou in advance 🙂

 

4 REPLIES 4

SatyakiBose
Mega Sage

Hello @jabaya 

Can you please share the XML file of the UI actions.

Am assuming it has been customized.

Are you using any script include within the UI action?

jabaya
Mega Guru

Hello im currently working on it on my PDI so i assume everything is on default...
i also dont add any script include in the UI action...

 

im not sure if this is the correct XML file but (please see attachment)

Namrata Ghorpad
Mega Sage
Mega Sage

Hello,

Update the code in OOB UI Action - Implement  like below.

 

function moveToImplement() {
g_form.setValue("state", "-1");
gsftSubmit(null, g_form.getFormElement(), "state_model_move_to_implement");
}

if (typeof window == 'undefined')
setRedirect();

function setRedirect() {
var grctask=new GlideRecord('change_task');
grctask.addQuery('change_request',current.sys_id);
grctask.query();
while(grctask.next())
{
grctask.setValue('assignment_group',current.assignment_group);
grctask.setValue('planned_start_date',current.planned_start_date);
grctask.update();
}
current.update();
action.setRedirectURL(current);

}

Please mark my answer as helpful/correct if it helps you.

Regards,

Namrata

Hello Good day, 

Thankyou so much for the help, I did try the to implement the script above, after that i also tried to modify it a bit but to no avail both trials did not work. ( please see screenshots ). 
do you still have any possible idea why it did not work ?