Creating project from template using the API doesn't add the due date

I am trying to instantiate a project from a template using the API. When called, the new project is created from the template, but the due date is left blank. This happens in my app and the API explorer.

Endpoint:
https://app.asana.com/api/1.0/project_templates/<redacted>/instantiateProject

JSON payload:

{
  "data": {
    "name": "Onboarding - Doe, John",
    "requested_dates": [
      {
        "value": "2024-04-01",
        "gid": "2"
      }
    ],
    "public": false
  }
}

Based on my reading of the API docs, this should create a private project from the template with a project due date of April 1, 2024. The project is created, but the due date is left blank.

Any thoughts?

Hi @Andrew_Pegram,

Yes, that syntax has worked for me in the past.

@John_Baldo @Jeff_Schneider any ideas why this is not working?

As a workaround, I can make a second API PUT call to the projects/<id> endpoint and set the due date that way, but I’d rather use one API call than two.

If you do, you’ll miss the automatic due date mechanism. And also I remember that a template with dates can’t be created without a starting date, it should break…

Ohh really? Even if the template is set as relative to “Before project due date”?

I believe if any date is defined, your API call needs to give a date. I had to fix a tool because of this.

@Andrew_Pegram,

In your template, do you have the schedule type set to “After project start date” or “Before project due date”? If it’s the former, that would likely explain the issue - you will need to supply a start date in that case.

I wasn’t aware of the schedule type… Thanks for letting me know!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.