Forum Discussion
philCryo
Jan 24, 2020Copper Contributor
Potential bug in Microsoft Planner's Task Order Hint functionality
Cross-posting from https://powerusers.microsoft.com/t5/Building-Flows/Planner-Tasks-OrderHint-value-not-respecting-order-within-Bucket/td-p/445202 as I'm not sure if this is a Microsoft Power Automate bug -- or a Microsoft Planner bug.
Hi there,
I have created manually-by-hand Tasks in a certain order in a Bucket in Microsoft Planner:
If I do a List Tasks and grab the JSON body of the List Tasks output via a Compose flow block e.g.:
...the Tasks's Order Hints order the Tasks to match what I see in Microsoft Planner in that Bucket (as expected):
Title | OrderHint - Initial |
Test5 | 8586225556019748676PQ |
Test4 | 8586225556030217433Pl |
Test3 | 8586225556040992244P6 |
Test2 | 8586225556087825095PU |
Test1 | 8586225556103966463P} |
For reference sake, my concept of direction of sorting is taken from this docs.Microsoft.com how-to article: https://docs.microsoft.com/en-us/graph/api/resources/planner-order-hint-format?view=graph-rest-1.0
So if I was to manually-by-hand re-arrange those Tasks in that Bucket in Microsoft Planner -- and then run the same Flow to get the raw data of those Tasks, when sorted that raw data by Order Hint, the Task Titles should be ordered in a way that matches the display in Microsoft Planner, right?
Nope 😞
In Microsoft Planner, in that same Bucket, I took the same Tasks and manually-by-hand I rearranged them into this order:
When I now run the same Power Automate Flow and retrieve the raw Task data, every one of those Tasks's Order Hints has not changed AT ALL:
Title | OrderHint - Initial | OrderHint - After Manual-By-Hand Rearranging Tasks |
Test5 | 8586225556019748676PQ | 8586225556019748676PQ |
Test4 | 8586225556030217433Pl | 8586225556030217433Pl |
Test3 | 8586225556040992244P6 | 8586225556040992244P6 |
Test2 | 8586225556087825095PU | 8586225556087825095PU |
Test1 | 8586225556103966463P} | 8586225556103966463P} |
Help????
philCryo Are you using the orderhint field on the Task entity? If so that is not what is used to sort tasks in the board view when grouped by buckets. Instead you need to look at the orderhints on the BucketTaskBoardTaskFormatting entity for the task.
philCryo Are you using the orderhint field on the Task entity? If so that is not what is used to sort tasks in the board view when grouped by buckets. Instead you need to look at the orderhints on the BucketTaskBoardTaskFormatting entity for the task.
- philCryoCopper Contributor
Thank you for writing back. Here are the fields I get when I run the List Tasks feature in Power Automate. I don't see anything like "BucketTaskBoardTaskFormatting" as an attribute in this list.
"@odata.etag": <the odata etag>, "planId": <plan's unique id>, "bucketId": <bucket's unique id>, "title": <task human-readable title>, "orderHint": "8586404548461516552", "assigneePriority": "", "percentComplete": 100, "startDateTime": null, "createdDateTime": "2019-06-21T21:20:39.3259255Z", "dueDateTime": null, "hasDescription": false, "previewType": "reference", "completedDateTime": "2019-06-26T01:13:03.5170485Z", "referenceCount": 1, "checklistItemCount": 0, "activeChecklistItemCount": 0, "conversationThreadId": null, "id": <task unique ID>, "createdBy": { "user": { "displayName": null, "id": <user's id> } }, "completedBy": { "user": { "displayName": null, "id": <user's id> } }, "appliedCategories": {}, "assignments": {}, "_assignments": []
philCryo This is the Task entity only.
The formatting entities are related entities for a task: For reference: https://docs.microsoft.com/en-us/graph/api/resources/plannertask?view=graph-rest-beta
Also https://docs.microsoft.com/en-us/graph/api/resources/plannerbuckettaskboardtaskformat?view=graph-rest-beta for a description of the BucketTaskboardTaskFormatting entity for a given task.
Note: I am not familiar with Power automate, but given your json payload below, it is using the graph api under the hoods.