How to Move Project tasks from One project to another project

Kishore8
Kilo Guru

i want to move this 8-project task to another Project,

so how can i do this1.png

5 REPLIES 5

Deepak Kumar5
Kilo Sage

You can update "Parent" field of Project task and update new parent.(Not sure about exact field name,you can check in dictionary of task where field referenced to Project)


not working , can you please suggest another way.


sachin_namjoshi
Kilo Patron
Kilo Patron

Project is composite field which has project reference on project task table. You can write fix script to update project references for project task.




Below is sample script


var ptask = new GlideRecord('pm_project_task');


ptask.addEncodedQuery('task=PRJTASK0000492'); // upate your query


task.query();


while(ptask.next()){



task.project = <sys_id of project>.sub_tree_root.short_description + '\u200B' + <sys_id of project>.sub_tree_root.number;


tas.update();




}


Hi Sachin,



Do we needs to hardcode the sys_id here in your script, U am getting error.




var ptask = new GlideRecord('pm_project_task');


ptask.addEncodedQuery('sys_class_name=pm_project_task^top_task=ef21263bdb11cb006499f9261d9619f9'); // upate your query


ptask.query();


while(ptask.next()){



ptask.project = ef21263bdb11cb006499f9261d9619f9.sub_tree_root.short_description + '\u200B' + ef21263bdb11cb006499f9261d9619f9.sub_tree_root.number;


gs.log("**************" +ptask.project);


ptask.update();




}