0

I am using the Microsoft Graph API to create Planner tasks, and I am wondering if there is a way to create a task including task details/description using a single HTTP request.

This old question from 2018 is asking about the same thing. The outcome in 2018 was that several separate requests were necessary ... first creating the task, then getting and updating its details object, which is a somewhat cumbersome process.

The original answerer has recently updated their answer to say that this behavior has changed and "you can set task details fields in the same request as creating the task". However, I'm confused as to whether this applies to the REST API itself, or to the Microsoft SDKs (which I am not currently using, as I don't need most of their functionality).

When I make a POST request to the /planner/tasks endpoint, and supply the details object in the body like such ...

{
  "planId": "(... plan ID ...)",
  "bucketId": "(... bucket ID ...)",
  "title": "Title for new task",
  "details": {
    "description": "Some description for new task"
  },
  "assignments": {
       (... assignment data ...)
  }
}

... the task is created, but I don't see any description/notes. This applies both to the "v1.0" and "beta" APIs. (I tried the newer "notes" property on the beta API as well, with the same result.)

Based on the MS docs I could not find a conclusive answer either.

Should a request such as the one I listed work right now? If yes, in which API version? If no, what am I missing?

Thanks!

Jan N
  • 3
  • 3

1 Answers1

0

That request should work, but there is an issue with the returned response to the create operation not including the task details. If you read the task details after the creation (or reading task expanding the details), the description should be there.

Tarkan Sevilmis
  • 1,443
  • 7
  • 9
  • OK, this is weird ... I had used the Planner iOS app to verify the tasks I created, and it doesn't show the description. But when I look at the same tasks in the web app, the description is there! So it seems like a bug in the Planner iOS app (v1.13.45), whereas the API works as it should. Thanks for your help, and sorry for the confusion! – Jan N Feb 02 '23 at 08:56
  • Interestingly, when I create the exact same tasks using Graph Explorer, the iOS app does show the description correctly ...! So I'm not sure where the bug/inconsistent behavior lies after all, but anyway it works for me since my users will be using the web app. – Jan N Feb 02 '23 at 09:05
  • I'll pass the issue along to the iOS app team, it would help if you can provide correlation ids of the requests (these are in the headers of the response) – Tarkan Sevilmis Feb 02 '23 at 19:45
  • Can do, is there a way of submitting this info outside of Stack Overflow, as I don't want to clutter this discussion here? – Jan N Feb 04 '23 at 20:24
  • The only other way I know is working through support. SO isn't for tracking bugs. I was just asking for information to do a quick investigation to see if there is a problem. If you think it doesn't work, you should actually go through support. – Tarkan Sevilmis Feb 06 '23 at 21:16