How to populate change request field information to change task

Zuri
Tera Expert

I want to copy information from change request when new change task is added.

change configuration item

 

find_real_file.png

 

Change task I want the field to auto populate information from change request

find_real_file.png

1 ACCEPTED SOLUTION

Hi Zuri!
I think I did a mistake there!
I pointed you to sc_task table and not the change_task table!

Your code should be something like:

var gr = new GlideRecord("change_task");
gr.addQuery("change_request", current.sys_id);
gr.query();
while(gr.next()){
   gr.planned_start_date = current.getValue("start_date");
gr.planned_end_date = current.getValue("end_date");
gr.update();
}

Only use the gr.update() if your business rule is executing AFTER update. If it is Before update remove the gr.update().

Hope this helps!!

Please, don't forget to mark my answer as correct if it solves your issue or mark it as helpful if it is relevant for you!

Best Regards,

Filipe Cruz

View solution in original post

26 REPLIES 26

Hello i was trying to do the same, getting the change task fields namely ( assigned to, assignment group, planned start/end date ) autopopulated after clicking the implement button from the change request form.

i did follow the above instructions in creating business rule in change task table (please see screenshot attachments of business rule). what can i do or am i missing something ? 
thanks for the help in advance 🙂

Capture 1.JPG

Capture2.JPG

Capture3.JPG

   

 

Hello,
(Apologies in advance If I might double the comment as im not sure if my replies are being posted).

So I'm Kinda trying to do the same thing as what OP does.
so I create a business rule within the change task table (please see screenshots attachments).

im getting it autopopulated, however im getting an error saying 'invalid insert' whenever im trying to save the change task record.
and if the change task ticket was in 'OPEN' status the fields remain empty (please see attachment name capture 1).
the only moment the change task fields get populated is when I 'CLOSE TASK'.
is it the correct behavior aside from the error or am I missing something.

Thankyou for the help in advance 🙂

 

 

 

 

330522858_498172865813542_3812181087609845756_n.png