Expand my Community achievements bar.

Don't miss the Workfront Community Lens, June Edition!

FUSION - Inserting template tasks below a specific task ID in a project

Avatar

Level 4

Hopefully a simple one for the FUSION experts out there.

 

I'm attaching tasks to a project from a task template

 

GeraintJo_0-1749125386378.png

 

Having found the task ID of the task I want them to be added BENEATH (234:ID above), when I put that ID in the PredecessorTaskID field - it just puts all the templated tasks at the bottom.

 

Am I using the right field for this - or is there another way ?

8 Replies

Avatar

Level 4

and just to add ... where we have task templates that contain folder names identical to folders already on the project (we use MASTERS in every task for all deliverable assets)

 

when that task template gets added using FUSION (as above) - the project/documents then shows dupplicate folders called 'MASTERS'

 

I assume it needs some sort of 'linking' of the new MASTERS folder on the added task to the project document folder list ???

 

 

 

 

Avatar

Community Advisor

I'm reading this as you want them to be added as children to 234:ID, in which case the task ID of the task that you want to put them under should go in parentTaskID, not predecessorTaskID. 

Avatar

Level 4

Thanks Chris,

 

I have got that parent option to work.

 

But Im also trying to just put them as next task below another - not as child.

 

Avatar

Community Advisor

@GeraintJo seems like there's no provision to identify "the task under which to add the tasks in the template".

 

So 2 (more messy) options

  1. Based on @ChrisStephens' suggestion, you could try changing the indent attribute of the tasks you added
    • only modify the indent of tasks whose indent is that of the parent, minus 1. (You don't want to modify nested tasks)
  2. If the parent already has children, you could INSERT a dummy task, un-indent the added tasks, then remove the dummy task
  3. I don't know what that template looks like but you change the POSITION of a task by modifying its taskNumber attribute. So after getting the taskNumber of the task under which to insert the template you can insert the template to the bottom, then iterate through the just-added tasks and "move" them buy setting their task number

So we CAN do what you want but you need to be careful that these gymnastics don't muck up the original task relations. 

Lastly - this seems like a really meaningful usecase; might be worth adding it to the Ideas section!

Avatar

Level 4
Thanks for that, as a FUSION novice those options sound a bit too complicated for me. 
 
Not ideal,  but I could just add a single task and work out how to number it into the correct position. 
 
I'll have a play. 
 
Thanks again

Avatar

Community Advisor

Ahh - come to think of it - you could argue you WANT that additional task as a parent to the template

then you don't need to worry about all the template tasks but 

  1. insert that new parent task (without specifying a parent, but if it applies, specify the predecessor)
  2. move it by setting it's taskNumber
  3. attach the template to that new parent task

 

Let us know how it goes!

Avatar

Level 4

Hi,

 

I'm interested you mention setting a task number to position a task.

 

Does that work ?

 

Could i work out the task number I want to insert/move tasks to - and do it that way?

Avatar

Community Advisor

Use a customAPI call to insert a task at the specific number

SveniX_0-1749558574469.png