Expand my Community achievements bar.

Attaching a new Templates to an existing Project using API calls

Avatar

Level 1

I can't find any doc about this subject that could bring me a solution, then here I'm:

 

I already created many projects using API calls, via Snaplogic and even updated them in the same way, but what doesn't work is the action attachTemplate as below:

valeSouza_0-1662061553596.png

this was supposed to add a new Template to a existing project, but when I use PUT passing the update parameters it returns error code 422. 

2 Replies

Avatar

Level 7

We're doing this via Fusion, but I think the same approach applies.  We're using "assignCategories".

 

Just a heads up, I remember we originally wrote this with a different call and it removed existing templates from the projects.

 

 

Jason_JB_0-1662124466274.png

 

Avatar

Level 10

Hi,

 

I just tried to do it using a PUT call and it worked:

https://example.my.workfront.com/attask/api-internal/PROJ/attachTemplate?method=PUT&action=attachTem...


using the following payload:

{
  "templateID": "<templateID>",
  "predecessorTaskID": "<predecessorTaskID>",
  "parentTaskID": '',
  "excludeTemplateTaskIDs": [
    "<excludeTemplateTaskID>"
  ],
  "options": []
}

 

Regards

Lars