Update DevOps without Notifications with Power Automate
When a work item is assigned to you, by default you are sent a notification. Notifications can also be sent regarding updates to your items. Now imagine creating over 10 thousand tasks automatically and assigning them to people. I recently did this on a projects and potentially each person was going to get 100s of emails. So I needed Power Automate to assign the tasks without notifications. This post is part of the Power Automate and DevOps series.
DevOps with Power Automate posts
- Connecting and Creating an item in Azure DevOps
- Updating Start and Due dates and other fields
- Using DevOps Rest API
- Running a WIQL query
- Updating items without Notifications
- Updating a task on behalf of another person
YouTube Version
They are on the backlog!
Permissions for updates without notifications
Updating DevOps without notifications is not something that everyone should be able to do. Or at least the admins will want to be able to control who can do it.
In the Project settings, click on Permissions. Then click on Users to list your users. When you click on a person you get to see all their permissions. They can be Allow, Deny or Not Set for all the different actions. (inherited) means it is set by being a member of a group. If you hover your cursor over the (i) you will get a description telling you which membership the permission as inherited from. A Deny overrides an allow, so you might need to manually override the inherited permission.
The permission we are interested in is Suppress notifications for work item updates.
Updating without Notifications
Now we have the permission we can test it out in an update. This can only be done on updates done by a REST API call. If you look on https://learn.microsoft.com/en-us/rest/api/azure/devops/wit/work-items/update there is a URI parameter suppressNotifications which is a boolean.
URI parameters get added after the ? and are separated by &. So the code to update item 36 without notifications would be
{project}/_apis/wit/workitems/36?suppressNotifications=true&api-version=7.0
Item History
Suppressing the notifications does prevent automated updates filling inboxes with emails that will just get deleted. It does not however supress the history of the item being updated. So who did the update and when is still recorded.