Home / Guides / Hide internal comments from customers
Hide internal comments from customers in Azure DevOps
Once a customer can open a work item, they can read every comment on it, including the one where your team says what it really thinks.
Azure DevOps has no private comment. This guide shows what you can do with the built-in tools, gives you a script that
checks a work item against an [internal] rule, and says where each approach stops.
Short answer.
The Discussion box and the comments REST API have no visibility setting: a comment is visible to everyone who can open the work item.
So you keep internal talk away from customers in one of two ways. Either customers never open the work item (they see a layer in
front of it that filters out comments marked [internal]), or the internal talk lives somewhere they have no permission to
read, such as a separate work item in a restricted area path. A customer portal such as BoardwalkDesk does the first one for you.
Why it is not a setting
Microsoft's comments API takes the comment text and nothing else: the request that creates a comment (CommentCreate) has one property,
text. There is no field for an audience, and the work item form has no "private" tick box next to the Discussion box.
What decides who can read a comment is who can open the work item. For a customer who is a Stakeholder or a guest in your
project, that is everything in the areas they are allowed to see (see
customers and Azure DevOps licenses).
Anyone you @mention also gets an email about the comment, so an internal remark that names a customer's account is sent to them.
Option 1: a separate work item for internal talk
Keep the customer's ticket clean and do the internal discussion on a second work item, for example a Task linked to the ticket. The second work item sits in an area path the customers cannot read:
- Create an area path such as
Support\Internalunder Project settings > Project configuration > Areas. - Open its Security dialog and set View work items in this node to Deny for the group that holds your customers.
- Create the internal work items in that area and link them to the ticket.
The permission is documented under work tracking permissions, and Microsoft's Boards FAQ names area path permissions as the way to restrict who can view selected work items. Where it stops: your team now works in two places per ticket, every new area needs the same Deny, and the link on the customer's ticket still exists. Test with a real customer account what the Related Work list shows them before you rely on it. If you want some people to comment without editing fields, there is also an area path permission Edit work item comments in this node.
Option 2: a marker, and a layer that obeys it
The common convention is to start internal comments with a fixed marker such as [internal]. Azure DevOps ignores the marker,
so it only works if everything that shows comments to customers (a portal, a mail relay, a report) drops those comments. That layer is the part
you build or buy. The script below is the read-only half of it: it lists the comments of one work item and says which ones a layer that
follows the rule would show. Use it to check your habit (are agents really typing the marker?) and as the model for the filter you write.
# Get-CustomerVisibleComments.ps1: lists a work item's comments and marks the ones that start with [internal].
# Read-only. Uses a Microsoft Entra token from the Azure CLI (az login).
param(
[Parameter(Mandatory)][string]$Organization,
[Parameter(Mandatory)][string]$Project,
[Parameter(Mandatory)][int]$WorkItemId,
[string]$Marker = '[internal]'
)
# 499b84ac-1321-427f-aa17-267ca6975798 is the resource ID of Azure DevOps.
$token = az account get-access-token --resource 499b84ac-1321-427f-aa17-267ca6975798 --query accessToken -o tsv
if (-not $token) { throw 'No Azure DevOps token. Sign in with az login first.' }
$base = 'https://dev.azure.com/{0}/{1}/_apis/wit/workItems/{2}/comments?$top=100&api-version=7.1-preview.4' -f
$Organization, [uri]::EscapeDataString($Project), $WorkItemId
$next = $base
while ($next) {
$page = Invoke-RestMethod -Uri $next -Headers @{ Authorization = "Bearer $token" }
foreach ($c in $page.comments) {
# Comments can be HTML or Markdown: drop tags, decode entities, then look at the first characters.
$plain = [System.Net.WebUtility]::HtmlDecode(($c.text -replace '<[^>]+>', '')).Trim()
[pscustomobject]@{
Id = $c.id
Created = $c.createdDate
Author = $c.createdBy.displayName
CustomerCanSee = -not $plain.StartsWith($Marker, [System.StringComparison]::OrdinalIgnoreCase)
Text = $plain.Substring(0, [Math]::Min(60, $plain.Length))
}
}
$next = if ($page.continuationToken) { $base + '&continuationToken=' + [uri]::EscapeDataString($page.continuationToken) } else { $null }
}
Run it after az login with an account that can read the project:
.\Get-CustomerVisibleComments.ps1 -Organization contoso -Project Support -WorkItemId 1234 | Format-Table -AutoSize
What it does and why:
- It reads
GET .../_apis/wit/workItems/{id}/comments?api-version=7.1-preview.4, which needs thevso.workscope, and followscontinuationTokenuntil the last page. - It strips HTML tags and decodes entities before it looks at the start of the text, because the editor often wraps a comment in a
<div>or bold tags. - The marker match ignores case, so
[Internal]counts too. A comment that only mentions the word later in the text does not.
The weak spots of a marker are all human: someone forgets it, or a customer is @mentioned in an internal note. Decide in advance what a customer-facing layer does with a comment it cannot classify, and
prefer showing nothing.
What does not work
- Hiding a field. You can hide a custom "Internal notes" field on the form, even per group with a custom rule. Microsoft's documentation says the data of a hidden field is still kept in the data store and the work item history. It is a form setting, not a security boundary, so do not put anything in it you would not want a customer-facing integration to read.
- Edit and delete. Deleting an embarrassing comment afterwards does not unsend an email. Comment edits and deletions are recorded in the work item history.
- Asking agents to be careful. It works until the first busy Friday.
Questions
Can I make a comment private in Azure DevOps?
Not as a setting. The work item Discussion box and the comments REST API have no visibility option, so a comment can be read by everyone who can open the work item. You keep internal talk from customers by keeping customers out of the work item, by putting internal discussion on a work item in an area path they cannot read, or by using a layer in front of Azure DevOps that filters comments.
How do I stop customers seeing internal notes on a work item?
Set View work items in this node to Deny for the customers' group on the area path that holds the internal work items, and discuss internal matters there. Customers who only use a portal that filters comments never open the work item at all.
Does hiding a field hide it from customers?
Only on the form. Microsoft documents that the data of a hidden field stays in the data store and in the work item history, so treat hiding as a layout choice, not as security.
Do customers get emailed my internal comment?
Anyone you @mention receives an email about the comment, and that includes a customer account. Leave customers out of internal comments and check who follows the work item before you write.
How does BoardwalkDesk handle internal comments?
A comment in Azure DevOps that starts with [internal] is never shown in the customer portal and never emailed to a customer. Comments hidden in the team area are not shown either, and agent comments appear as Support team.
Related
- Let customers create Azure DevOps work items without a license
- A customer support portal for Azure Boards: your options compared
- BoardwalkDesk: a customer service desk for Azure DevOps
- All guides
Sources (Microsoft Learn): Comments - Add, Comments - Get Comments, Azure Boards FAQs, Set work tracking permissions, Use @mentions in work items and pull requests, Add and manage fields (Inheritance process), Sample custom rule scenarios.