Asana / php-asana

Official PHP client library for the Asana API v1
MIT License
136 stars 59 forks source link

createTask not working after user-task-list update #74

Closed Robertbaelde closed 3 years ago

Robertbaelde commented 3 years ago

Hi,

Since Asana started rolling out this update (https://forum.asana.com/t/update-on-our-planned-api-changes-to-user-task-lists-a-k-a-my-tasks/103828) I get an exception back when creating a new task.

The exception: This request is affected by the "new_user_task_lists" deprecation. Please visit this url for more info: https://forum.asana.com/t/update-on-our-planned-api-changes-to-user-task-lists-a-k-a-my-tasks/103828 Adding "new_user_task_lists" to your "Asana-Enable" or "Asana-Disable" header will opt in/out to this deprecation and suppress this warning.

The task is created, so i'm guessing the api redirects to the get endpoint with some wrong parameters?

The params we currently use for the createTask call (might be that one of the params is the cause?)

$task = $this->asana->tasks->createTask([
                'assignee' => ...,
                'assignee_status' => 'today',
                'due_on' => now()->addDay()->toDateString(),
                'name' => ...,
                'projects' => [...],
                'notes' => ...,
        ]);

Would love to help, but currently have no clue on where to start.

rossgrambo-zz commented 3 years ago

Hey @Robertbaelde !

I responded in the forum post https://forum.asana.com/t/update-on-our-planned-api-changes-to-user-task-lists-a-k-a-my-tasks/103828/16 but I'm happy to continue the converstaion here if you have issues. I guessed you were using node-asana, but now it appears you're using php-asana!

Check the readme for php syntax: https://github.com/Asana/php-asana#asana-change-warnings

Robertbaelde commented 3 years ago

Thanks @rossgrambo, suppressing the warning did the trick.