0

We have developed an application which calls Update Task Planner Graph API to update task in Planner App. The API was working fine until some recent change in the MS docs and now it keeps throwing below error.

A type named 'microsoft.taskServices.plannerCheckListItemCollection' could not be resolved by the model. When a model is available, each type name must resolve to a valid type.

Below is the code for creating and updating the Task using Graph API.

var newTask = new PlannerTask
{
    PlanId = "planID",
    BucketId = "bucketID",
    Title = "title"
};

Logger.LogInfo(userLogs + "Task object created, calling Graph API");
var taskResponse = await graphClient.Planner.Tasks.Request().AddAsync(newTask);

PlannerTaskDetails taskDetails = new PlannerTaskDetails
{
    Checklist = new PlannerChecklistItems { AdditionalData = checkListItems }
};

Logger.LogInfo(userLogs + "Getting Details of created Task");

PlannerTaskDetails getTaskDetails = await graphClient.Planner.Tasks[taskResponse.Id].Details.Request().GetAsync();
var eTagId = getTaskDetails.GetEtag();

Logger.LogInfo(userLogs + "Updating Task");
await graphClient.Planner.Tasks[taskResponse.Id].Details.Request()
    .Header("Prefer", "return=representation")
    .Header("If-Match", eTagId)
    .UpdateAsync(taskDetails);

Code snippet for CheckListItems:

Dictionary<string, Object> checkListItems = new Dictionary<string, object>();
checkListItems.Add(key, new PlannerChecklistItem
{
    Title = "title",
    IsChecked = True
});

Also proper App Permissions in Azure are already given as this was working fine till last month.

  • Outside of your code, can you repro the issue just with Graph Explorer or POSTMAN as well? – Dev May 31 '21 at 02:47
  • 1
    Can you try adding `ODataType = null` while initializing the PlannerTaskDetails object? Had faced a similar issue with a different API in the SDK. – Neel Shah May 31 '21 at 14:00
  • @Dev It is working fine with Postman and Graph Explorer. Facing issue in Graph SDK only. – Sarjak Gandhi Jun 01 '21 at 13:37
  • Glad to hear that you isolated the issue. I would suggest you to [file the issue directly](https://github.com/microsoftgraph) at the respective language SDK build (at its Issues tab), so that it will be addressed. – Dev Jun 02 '21 at 03:53
  • 1
    @Neel Shah Thanks for your response. That did work as a work around. – Sarjak Gandhi Jun 08 '21 at 18:13

1 Answers1

1

This was a bug, and the issue should be resolved now.

Tarkan Sevilmis
  • 1,443
  • 7
  • 9