Phi*_*gen 1 tfs-2015 azure-pipelines-build-task
我们有一个CI构建服务器执行自动构建,并希望在程序集版本中包含当前的sprint/iteration编号.是否有环境变量或简单的方法来获取构建过程中的当前sprint数?TFS On Permise 2015 Update 3
没有内置变量来获取当前sprint,但您可以使用REST API.脚步:
码:
Param(
[string]$collection,
[string]$projectName,
[string]$token
)
$uri="$collection/$projectName/_apis/work/teamsettings/iterations?`$timeframe=current&api-version=v2.0-preview"
Write-Output $uri
$result = Invoke-RestMethod -Uri $uri -Method Get -Headers @{Authorization=("Bearer {0}" -f $token)}
Write-Output "success"
Write-Output $result.value.path
Write-Host "##vso[task.setvariable variable=currentSprint;]$($result.value.path)"
Run Code Online (Sandbox Code Playgroud)
之后,当前sprint值存储在currentSprint变量中.
| 归档时间: |
|
| 查看次数: |
1165 次 |
| 最近记录: |