Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Azure devops RestAPI系统。说明_Azure_Azure Devops_Azure Devops Rest Api - Fatal编程技术网

Azure devops RestAPI系统。说明

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

使用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
返回结果:

注意:

  • 它是通用的HTML格式的值,例如
  • 您需要在描述字段中设置值,否则字段
    System.Description
    不存在
我的powershell测试脚本:

$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步骤,没有描述