New Threads Experience in Teams Channels
Microsoft released a new Threads experience for Teams channel conversations and spun up a new page on their adoption website with some great downloadable materials regarding Threads.
If you’ve been around Teams for long enough, you probably remember how many people accidentally replied with a new post instead of replying to a channel post… As a result of this, Microsoft revamped how channels worked by hiding the compose box behind a Post button.
While that mostly prevented people starting new threads instead of replying to a parent message, it created a new problem: Teams was never auto expanding all thread replies by default so it was very hard to view entire threads at a glance. A thread always had to be opened in a separate window or the entire conversation had to be opened inside the channel to view all replies in a thread.
Now, with the new Threads experience, the channel looks much more like a group chat. The compose box is back and it’s very easy to either send a new message or reply to an existing message in a thread.
Threads can be opened on the side which makes it easy to follow a specific topic while keeping an eye on new messages sent to the channel. What’s even cooler is that you can choose to reply to the thread only, or to the thread and the channel. This is perfect if a group of people are done discussing a specific topic and want to let the wider group know what the outcome was. By posting a summary to the thread and the channel, people who weren’t involved in the thread conversation will have it easier to know if the thread is worth reading or if the summary is enough.
When the experience is switched to Threads, the Post tab is also renamed to Conversation.
What does this have to do with Planner?
Planner might not be the best project or task management tool out there but it’s included in most M365 license SKUs and nicely integrated into Teams. For example, it’s very easy to add a plan as a tab in a Teams channel. But because Planner has been around for longer than Teams, it’s also not as tightly integrated into Teams as I would like.
My main complaint with it is that the comments section of planner tasks doesn’t offer a lot of functionality or flexibility. It’s not possible to mention other team members or add hyperlinks and attachments to comments on Planner tasks. It basically only supports plain text.
Another area where Planner falls short are notifications. While there are Teams feed notifications for tasks assignments and completions, some notifications can only be received by email. Email notifications for new comments on tasks are only sent to the group inbox, unless users are explicitly following all messages in their inbox for the plan’s group. For an individual user to receive notifications about new comments directly in their inbox, they must first comment on a task themselves.
You can learn more about follow in inbox here:
- https://heusser.pro/p/everything-you-ever-wanted-to-know-about-microsoft-teams-phone-and-shared-voicemail-4df01cb28e24/#microsoft-365groups
- https://heusser.pro/p/the-ultimate-teams-shared-voicemail-solution-5dd2ce57facc/#subscribing-the-shared-mailbox-to-the-m365-groupinbox
In other words, only the group mailbox is notified about the first comment on any planner task and members are only notified about new comments directly, if they previously commented on the same task.
Even though Planner does offer limited email notifications, all of this still sounds less than ideal to me. And even if the notifications are good enough for you, it still doesn’t change the fact that comments in Planner are pretty bare bones.
What if we could link every task to a thread in a Teams channel?
This was an idea that recently came to me… So I built it. The concept is fairly easy:
A Power Automate flow triggers every time someone creates a task in a specific plan. The flow then sends an adaptive card with a button that links to the task and immediately sends a reply to the card to create a new thread in the channel.
The message mentions the user who created the task so that this user is automatically following the thread and gets notified if anybody else responds in the thread. Once the thread is created, the flow updates the card and adds a second button which opens the thread.
The Open Thread button makes it every easy to view all all messages or respond with a “comment” to any specific task from this plan.
Finally, the flow adds the link to the Teams thread as an attachment on the task. This creates a relation between both entities. From the thread it’s easy to open the task in Planner and from the task, people can use the attached link to quickly get back to the thread.
Unfortunately, I wasn’t able to disable the Show on card toggle for the attachment when the attachment is added through Power Automate. That’s why you’re seeing this big Teams icon behind the task in the screenshot above.
It’s totally possible to do it via Graph API but I couldn’t find any action in Power Automate that supports the /planner
Graph endpoint. Unless I missed something, this would require an HTTP action which requires an access token for Microsoft Graph. I may try to solve this in the future. For now, you’ll just have to uncheck the box manually if you don’t like the preview of the attachments either.
I’m going to show you how I did that in the setup section.
See it in action
Anyway, here’s how it looks in Teams. Thanks to deep links, it’s super easy and seamless to jump back and forth between Teams threads and Planner tasks!
Setup
I’ve created two versions of this flow. A premium and a standard version. The premium version requires you to make less changes to the flow after importing it into your environment but it needs a Power Automate Premium license to do that. The premium version is also capable of disabling the previews of attachments added to the Planner task by the flow.
Disabling attachment previews through Graph API
When I was researching this topic, I found quite a few posts from frustrated people trying to disable attachment previews on Planner tasks. All the answers pointed to the Graph API. The problem is that most of the blogs out there just show you how you can use the HTTP action using an access token to call the Graph API. But not all of them protect the client secret. Some at least use an Azure Key Vault to protect the secrets.
However, to my knowledge, you still need to include a username and a password when you want to get a delegated access token for Microsoft Graph. (If you’re reading this and my knowledge is outdated or wrong, please let me know… I’d love to hear that I’m wrong.). Anyway, I don’t want to use an account’s password inside Power Automate, regardless if it’s of a regular user or the one of a service account. But I also want to be able to call (almost) any Graph endpoint, not just the ones the various native actions are limited to.
Power Automate Native Graph Actions
The following actions allow you to call the Graph API natively. You would use this if a certain native action doesn’t quite do what you need. Like in my case, the Update task details action doesn’t support the previewType
property as it sits one level higher than the references
property which is what gets targeted by this action.
I guess you could say that these native actions are similar to Microsoft Graph PowerShell commands (Cmdlets and Functions) vs Invoke-MgGraphRequest
because the latter one is typically used when a PowerShell command doesn’t support a niche use case.
Connector | Action | Supported Endpoints 1st Segment | Supported Endpoints 2nd Segment |
---|---|---|---|
Teams | Send a Microsoft Graph HTTP request | /teams , /me , /users |
channels , chats , installedApps , messages , pinnedMessages |
Office 365 Outlook | Send an HTTP request | /me , /users/<userId> |
messages , mailFolders , events , calendar , calendars , outlook , inferenceClassification |
Office 365 Groups | Send an HTTP request V2 | /groups |
N/A |
Office 365 Groups Mail | Send an HTTP request | /groups |
N/A |
Office 365 Users | Send an HTTP request | /me , /users/<userId> |
messages , mailFolders , events , calendar , calendars , outlook , inferenceClassification |
Call other Graph endpoints from Power Automate
To edit a planner task’s details, such as disabling attachment previews, the request URI is https://graph.microsoft.com/v1.0/planner/tasks/{taskID}/details
. As you can see, none of the above built in actions support that endpoint. While the /groups
endpoint does allow you to fetch tasks from https://graph.microsoft.com/v1.0/groups/{group-id}/planner/plans/{planId}/tasks
, it doesn’t work for this since anything that targets a task’s details must use the /planner
endpoint directly.
I’ve seen the HTTP with Microsoft Entra ID (preauthorized) action in Power Automate before but up until today, I never actually tried it. It turns out that as long as you have a Power Automate Premium license, you can just sign in with your account as you would with any other Power Automate connection.
To use this action, simply enter https://graph.microsoft.com
for both the Base Resource URL and the Microsoft Entra ID Resource URI (Application ID URI) and click Create. In the pop-up, sign-in with your account.
Now you can use this connection to make any delegated Graph request your account has permission for without the need for any other custom actions for authentication purposes. There is no need to acquire an access token or build an authorization header yourself since Power Automate will handle the the entire authentication internally. So, this really is very similar to Invoke-MgGraphRequest
.
Given the fact that the generic HTTP action requires a Premium license as well, this seems like a vastly superior solution for what I’m trying to do here. Of course I still appreciate the non-premium actions listed in the table above for requests to supported endpoints. They can be quite handy for some scenarios, like for example, filtering Entra ID users by phone number.
To update a Planner task’s details, a valid ETag needs to be included in the If-Match
header of the update request. To get this ETag, you need to do a GET
request before you can actually send the PATCH
request.
The expression to extract the ETag from the response’s header is like this: outputs('Get_Task_Details')?['headers']?['ETag']
and the content of the body is like this: {"previewType":"noPreview"}
.
Prerequisites
To use this flow in your environment you need to have the following:
- A Team with a Planner linked to the Team’s Microsoft 365 Group
- A Teams channel where you want to create the threads for new Planner tasks
- A tab linked to the plan in the same channel
- A Power Automate license (Power Automate Premium for the premium flow version)
I recommend to create a dedicated channel for this. The flow uses Task Management as the default name. If you name yours differently, you’ll need to update one more variable in the flow.
Download and import the Flow (Premium & Standard)
If you’ve been following me for a while, you probably already know that I rarely just write a blog post. I am a perfectionist and take pride in going the extra mile for my readers by making the solutions I develop for my blog as accessible and easy to deploy in your own environment as easy as possible. For example, I spent quite a few hours creating this flow in a way where you only have to adjust two values in the flow’s trigger for it to work in your own environment. (It’s three values for the Standard version.)
I’m trying something new by providing the Zip files through my Buy me a Coffee page. This flow is available both as a paid and a free version. Both items include exactly the same content and it’s entirely up to you whether you choose to make a small contribution to my work or not. Both items include the Zip file for both the Premium and the Standard Flow version.
Downloading from Buy me a Coffee will help me get a better understanding of how many people actually try solutions I develop for this blog compared to people just reading the blog. However, if you absolutely don’t wish to provide a name and an email address, you may also download the flow for free from my GitHub repo.
Download from GitHub (Premium Version)
Download from GitHub (Standard Version)
Download any Zip file and import the desired version it in Power Automate using Import Package (Legacy). Link or create all the necessary connections and turn on the flow. Then open the flow in the editor.
Click on the trigger When a new task is created and select your Team as Group Id and your plan as Plan Id.
Optionally, if your channel is called differently than Task Management update the value in the Initialize ChannelName variable.
Note: I only tested with channel names that contain white spaces. I haven’t tested with any other special characters and don’t know if that would require additional code such as URL encoding.
Premium Version
If you’re using the premium version, you’re already done. All the subsequent actions can derive the required IDs and values from your own environment from just the Group Id and Plan Id you selected in the flow trigger.
Standard Version
If you’re using the standard version, the first two steps are the same as for the premium version. Make sure to update the trigger and if necessary the ChannelName variable.
Next, go to the Planner tab in your Teams channel and copy the link to any task from that plan.
It should look something like this. The Id you need to copy starts after planner.v1.
and ends before _p_
.
|
|
Note: Temporarily switch to the blog’s light mode theme if you can’t see the highlighted ID properly.
Copy this ID and paste it into the flow’s Initialize EntityId action.
If you know your group ID and channel ID, you may also get the entity ID from PowerShell using this code:
|
|
That’s all. Your flow is now ready to go in your environment as well!
Summary
I really like the new Threads experience and I’m very excited to see more Team owners adopt this for the majority of their channels or at least for the ones where frequent back and forth messaging is happening.
The flow presented in this blog post allows you to ignore the Planner native comments feature and bring the entire correspondence of any task into normal Teams channel conversations. People don’t need to worry about missing notifications for new comments on their tasks anymore and you’ll still have a link between any task and it’s created thread in the designated channel.
Furthermore, Planner doesn’t seem to include comments in keyword search results but of course you’ll be able to search for a tasks’s title (even though it’s part of an adaptive card) as well text in “comments” which have been posted as thread replies.
Lastly, I’m very happy that I stuck with my persistence and learned about that HTTP with Microsoft Entra ID (preauthorized) connector and action in Power Automate. This is for sure going to help me out a lot in the future!