Azure devops RestAPI系统。说明
使用Azure Devops RestAPI进行一些测试,以从powershell脚本制作发行说明。 我似乎无法从工作项中取回System.Description字段。可能是因为它是一个HTML编辑器字段 有什么想法吗 Azure devops RestAPI系统。说明 我们可以使用REST API获取详细信息:Azure devops RestAPI系统。说明,azure,azure-devops,azure-devops-rest-api,Azure,Azure Devops,Azure Devops Rest Api,使用Azure Devops RestAPI进行一些测试,以从powershell脚本制作发行说明。 我似乎无法从工作项中取回System.Description字段。可能是因为它是一个HTML编辑器字段 有什么想法吗 Azure devops RestAPI系统。说明 我们可以使用REST API获取详细信息: GET https://dev.azure.com/{organization}/{project}/_apis/wit/workitems/{id}?api-version=6.0
GET https://dev.azure.com/{organization}/{project}/_apis/wit/workitems/{id}?api-version=6.0
返回结果:
注意:
- 它是通用的HTML格式的值,例如
- 您需要在描述字段中设置值,否则字段
不存在System.Description
$connectionToken="$(PAT)"
$base64AuthInfo= [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes(":$($connectionToken)"))
$url = "https://dev.azure.com/<YourOrganizationName>/<YourTestProject>/_apis/wit/workItems/184?api-version=6.0"
$WorkItemInfo = (Invoke-RestMethod -Uri $url -Method Get -UseDefaultCredential -Headers @{Authorization=("Basic {0}" -f $base64AuthInfo)})
Write-Host "SystemDescription= $($WorkItemInfo.fields."System.Description" )"
$connectionToken=“$(PAT)”
$base64AuthInfo=[System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes(“:$($connectionToken)”)
$url=”https://dev.azure.com///_apis/wit/workItems/184?api-版本=6.0“
$WorkItemInfo=(调用RestMethod-Uri$url-Method Get-UseDefaultCredential-Headers@{Authorization=(“基本{0}”-f$base64AuthInfo)})
写入主机“SystemDescription=$($WorkItemInfo.fields.“System.Description”)”
注2:
- 在获取
的值时,我们需要在System.Description
中添加双引号System.Description
椅子和键盘之间存在问题。显然,我是在查询一个Bug,它有repro步骤,没有描述