diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 5794d594a..000000000 --- a/.editorconfig +++ /dev/null @@ -1,3 +0,0 @@ -[*] -indent_style = space -indent_size = 3 \ No newline at end of file diff --git a/.gitignore b/.gitignore index a02478323..404406a81 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,8 @@ Source/Classes/vsteam.classes.ps1 /dist test-results.xml coverage.xml +.editorconfig +.vscode/settings.json .DS_Store ._.DS_Store **/.DS_Store diff --git a/.vscode/settings.json b/.vscode/settings.json index f5d99a39d..aedfe2f40 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -49,18 +49,9 @@ "vssgp", "vssps" ], - "workbench.colorCustomizations": { - "activityBar.background": "#007699", - "activityBar.foreground": "#e7e7e7", - "activityBar.inactiveForeground": "#e7e7e799", - "activityBarBadge.background": "#ff80e2", - "activityBarBadge.foreground": "#15202b", - "titleBar.activeBackground": "#004f66", - "titleBar.inactiveBackground": "#004f6699", - "titleBar.activeForeground": "#e7e7e7", - "titleBar.inactiveForeground": "#e7e7e799", - "statusBar.background": "#004f66", - "statusBarItem.hoverBackground": "#007699", - "statusBar.foreground": "#e7e7e7" - } + "terminal.integrated.commandsToSkipShell": [ + "PowerShell.RunSelection", + "workbench.action.files.save", + "workbench.action.files.newUntitled" + ] } \ No newline at end of file diff --git a/Build-Module.ps1 b/Build-Module.ps1 index 5faff2c8a..c0e86e1b4 100644 --- a/Build-Module.ps1 +++ b/Build-Module.ps1 @@ -86,7 +86,7 @@ Copy-Item -Path ./Source/VSTeam.psm1 -Destination "$output/VSTeam.psm1" -Force Write-Output 'Updating Functions To Export' $newValue = ((Get-ChildItem -Path "./Source/Public" -Filter '*.ps1').BaseName | - ForEach-Object -Process { Write-Output "'$_'" }) -join ',' + ForEach-Object -Process { Write-Output "'$_'" }) -join ',' (Get-Content "./Source/VSTeam.psd1") -Replace ("FunctionsToExport.+", "FunctionsToExport = ($newValue)") | Set-Content "$output/VSTeam.psd1" @@ -107,7 +107,7 @@ if ($ipmo.IsPresent -or $runTests.IsPresent) { # run the unit tests with Pester if ($runTests.IsPresent) { - if ($null -eq $(Get-Module -Name Pester)) { + if ($null -eq $(Get-Module -ListAvailable Pester)) { Install-Module -Name Pester -Repository PSGallery -Force -Scope CurrentUser -AllowClobber -SkipPublisherCheck } @@ -120,7 +120,7 @@ if ($runTests.IsPresent) { } if ($codeCoverage.IsPresent) { - $pesterArgs.CodeCoverage = "$outputDir\*.ps1" + $pesterArgs.CodeCoverage = "./Source/**/*.ps1" $pesterArgs.CodeCoverageOutputFile = "coverage.xml" $pesterArgs.CodeCoverageOutputFileFormat = 'JaCoCo' } diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f06fd610..c7ee54477 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,15 @@ _callAPI, _buildRequestURI and Invoke-VSTeamRequest now support UseProjectId switch if the Project ID is required for the API call. +Addressed following issues: + +- Do not change the strict mode setting for the user's PowerShell session [#296](https://github.com/DarqueWarrior/vsteam/issues/296) +- Consider reducing the scope of the default parameter "Project" from "*" to "*-VsTeam*" [#297](https://github.com/DarqueWarrior/vsteam/issues/297) + +Merged [Pull Request](https://github.com/DarqueWarrior/vsteam/pull/275) from [Jhoneill](https://github.com/jhoneill) which included the following: + +- Removing Dynamic parameters for completer and validator attributes. + Merged [Pull Request](https://github.com/DarqueWarrior/vsteam/pull/283) from [Sebastian Schütze](https://github.com/SebastianSchuetze) which included the following: - Added Get-VSTeamBuildTimeline to get timeline of a build @@ -898,4 +907,4 @@ Merged [Pull Request](https://github.com/DarqueWarrior/vsteam/pull/3) from [Andy ## 0.1.14 -Initial Open Source release +Initial Open Source release \ No newline at end of file diff --git a/Source/Classes/BuildCompleter.ps1 b/Source/Classes/BuildCompleter.ps1 new file mode 100644 index 000000000..96e9ba8fe --- /dev/null +++ b/Source/Classes/BuildCompleter.ps1 @@ -0,0 +1,41 @@ +using namespace System.Collections +using namespace System.Collections.Generic +using namespace System.Management.Automation + +# This class defines an attribute that allows the user the tab complete +# build numbers for function parameters. For this completer to work the +# users must have already provided the ProjectName parameter for the +# function or set a default project. +class BuildCompleter : IArgumentCompleter { + [IEnumerable[CompletionResult]] CompleteArgument( + [string] $CommandName, + [string] $ParameterName, + [string] $WordToComplete, + [Language.CommandAst] $CommandAst, + [IDictionary] $FakeBoundParameters) { + + $results = [List[CompletionResult]]::new() + + # If the user has explictly added the -ProjectName parameter + # to the command use that instead of the default project. + $projectName = $FakeBoundParameters['ProjectName'] + + # Only use the default project if the ProjectName parameter was + # not used + if (-not $projectName) { + $projectName = _getDefaultProject + } + + # If there is no projectName by this point just return a empty + # list. + if ($projectName) { + foreach ($b in (Get-VSTeamBuild -ProjectName $projectName)) { + if ($b.buildNumber -like "$WordToComplete*") { + $results.Add([CompletionResult]::new($b.buildNumber)) + } + } + } + + return $results + } +} diff --git a/Source/Classes/BuildDefinitionCompleter.ps1 b/Source/Classes/BuildDefinitionCompleter.ps1 new file mode 100644 index 000000000..2aa76570e --- /dev/null +++ b/Source/Classes/BuildDefinitionCompleter.ps1 @@ -0,0 +1,41 @@ +using namespace System.Collections +using namespace System.Collections.Generic +using namespace System.Management.Automation + +# This class defines an attribute that allows the user the tab complete +# build definition names for function parameters. For this completer to +# work the users must have already provided the ProjectName parameter for +# the function or set a default project. +class BuildDefinitionCompleter : IArgumentCompleter { + [IEnumerable[CompletionResult]] CompleteArgument( + [string] $CommandName, + [string] $ParameterName, + [string] $WordToComplete, + [Language.CommandAst] $CommandAst, + [IDictionary] $FakeBoundParameters) { + + $results = [List[CompletionResult]]::new() + + # If the user has explictly added the -ProjectName parameter + # to the command use that instead of the default project. + $projectName = $FakeBoundParameters['ProjectName'] + + # Only use the default project if the ProjectName parameter was + # not used + if (-not $projectName) { + $projectName = _getDefaultProject + } + + # If there is no projectName by this point just return a empty + # list. + if ($projectName) { + foreach ($b in (Get-VSTeamBuildDefinition -ProjectName $projectName)) { + if ($b.name -like "*$WordToComplete*") { + $results.Add([CompletionResult]::new($b.name)) + } + } + } + + return $results + } +} diff --git a/Source/Classes/ProcessTemplateCompleter.ps1 b/Source/Classes/ProcessTemplateCompleter.ps1 new file mode 100644 index 000000000..63e9a3dc7 --- /dev/null +++ b/Source/Classes/ProcessTemplateCompleter.ps1 @@ -0,0 +1,30 @@ +using namespace System.Collections +using namespace System.Collections.Generic +using namespace System.Management.Automation + +# This class defines an attribute that allows the user the tab complete +# process templates for function parameters. +class ProcessTemplateCompleter : IArgumentCompleter { + [IEnumerable[CompletionResult]] CompleteArgument( + [string] $CommandName, + [string] $ParameterName, + [string] $WordToComplete, + [Language.CommandAst] $CommandAst, + [IDictionary] $FakeBoundParameters) { + + $results = [List[CompletionResult]]::new() + + if (_hasProcessTemplateCacheExpired) { + [VSTeamProcessCache]::processes = _getProcesses + [VSTeamProcessCache]::timestamp = (Get-Date).Minute + } + + foreach ($p in [VSTeamProcessCache]::processes) { + if ($p -like "*$WordToComplete*") { + $results.Add([CompletionResult]::new($p)) + } + } + + return $results + } +} diff --git a/Source/Classes/ProcessValidateAttribute.ps1 b/Source/Classes/ProcessValidateAttribute.ps1 new file mode 100644 index 000000000..25f526fca --- /dev/null +++ b/Source/Classes/ProcessValidateAttribute.ps1 @@ -0,0 +1,19 @@ +using namespace System.Management.Automation + +class ProcessValidateAttribute : ValidateArgumentsAttribute { + [void] Validate( + [object] $arguments, + [EngineIntrinsics] $EngineIntrinsics) { + + if (_hasProcessTemplateCacheExpired) { + [VSTeamProcessCache]::processes = _getProcesses + [VSTeamProcessCache]::timestamp = (Get-Date).Minute + } + + if (($null -ne [VSTeamProcessCache]::processes) -and (-not ($arguments -in [VSTeamProcessCache]::processes))) { + throw [ValidationMetadataException]::new( + "'$arguments' is not a valid process. Valid processes are: '" + + ([VSTeamProcessCache]::processes -join "', '") + "'") + } + } +} \ No newline at end of file diff --git a/Source/Classes/ProjectCompleter.ps1 b/Source/Classes/ProjectCompleter.ps1 new file mode 100644 index 000000000..78b7de15c --- /dev/null +++ b/Source/Classes/ProjectCompleter.ps1 @@ -0,0 +1,28 @@ +using namespace System.Collections +using namespace System.Collections.Generic +using namespace System.Management.Automation + +class ProjectCompleter : IArgumentCompleter { + [IEnumerable[CompletionResult]] CompleteArgument( + [string] $CommandName, + [string] $ParameterName, + [string] $WordToComplete, + [Language.CommandAst] $CommandAst, + [IDictionary] $FakeBoundParameters) { + + $results = [List[CompletionResult]]::new() + + if (_hasProjectCacheExpired) { + [VSTeamProjectCache]::projects = _getProjects + [VSTeamProjectCache]::timestamp = (Get-Date).Minute + } + + foreach ($p in [VSTeamProjectCache]::projects) { + if ($p -like "*$WordToComplete*") { + $results.Add([CompletionResult]::new($p)) + } + } + + return $results + } +} \ No newline at end of file diff --git a/Source/Classes/ProjectValidateAttribute.ps1 b/Source/Classes/ProjectValidateAttribute.ps1 new file mode 100644 index 000000000..f29c46a01 --- /dev/null +++ b/Source/Classes/ProjectValidateAttribute.ps1 @@ -0,0 +1,19 @@ +using namespace System.Management.Automation + +class ProjectValidateAttribute : ValidateArgumentsAttribute { + [void] Validate( + [object] $arguments, + [EngineIntrinsics] $EngineIntrinsics) { + + if (_hasProjectCacheExpired) { + [VSTeamProjectCache]::projects = _getProjects + [VSTeamProjectCache]::timestamp = (Get-Date).Minute + } + + if (($null -ne [VSTeamProjectCache]::projects) -and (-not ($arguments -in [VSTeamProjectCache]::projects))) { + throw [ValidationMetadataException]::new( + "'$arguments' is not a valid project. Valid projects are: '" + + ([VSTeamProjectCache]::projects -join "', '") + "'") + } + } +} \ No newline at end of file diff --git a/Source/Classes/ReleaseDefinitionCompleter.ps1 b/Source/Classes/ReleaseDefinitionCompleter.ps1 new file mode 100644 index 000000000..d0a366445 --- /dev/null +++ b/Source/Classes/ReleaseDefinitionCompleter.ps1 @@ -0,0 +1,37 @@ +using namespace System.Collections +using namespace System.Collections.Generic +using namespace System.Management.Automation + +class ReleaseDefinitionCompleter : IArgumentCompleter { + [IEnumerable[CompletionResult]] CompleteArgument( + [string] $CommandName, + [string] $ParameterName, + [string] $WordToComplete, + [Language.CommandAst] $CommandAst, + [IDictionary] $FakeBoundParameters) { + + $results = [List[CompletionResult]]::new() + + # If the user has explictly added the -ProjectName parameter + # to the command use that instead of the default project. + $projectName = $FakeBoundParameters['ProjectName'] + + # Only use the default project if the ProjectName parameter was + # not used + if (-not $projectName) { + $projectName = _getDefaultProject + } + + # If there is no projectName by this point just return a empty + # list. + if ($projectName) { + foreach ($r in (Get-VSTeamReleaseDefinition -ProjectName $projectName)) { + if ($r.name -like "*$WordToComplete*") { + $results.Add([CompletionResult]::new($r.name)) + } + } + } + + return $results + } +} diff --git a/Source/Classes/TeamQueueCompleter.ps1 b/Source/Classes/TeamQueueCompleter.ps1 new file mode 100644 index 000000000..f9aebb92b --- /dev/null +++ b/Source/Classes/TeamQueueCompleter.ps1 @@ -0,0 +1,37 @@ +using namespace System.Collections +using namespace System.Collections.Generic +using namespace System.Management.Automation + +class TeamQueueCompleter : IArgumentCompleter { + [IEnumerable[CompletionResult]] CompleteArgument( + [string] $CommandName, + [string] $ParameterName, + [string] $WordToComplete, + [Language.CommandAst] $CommandAst, + [IDictionary] $FakeBoundParameters) { + + $results = [List[CompletionResult]]::new() + + # If the user has explictly added the -ProjectName parameter + # to the command use that instead of the default project. + $projectName = $FakeBoundParameters['ProjectName'] + + # Only use the default project if the ProjectName parameter was + # not used + if (-not $projectName) { + $projectName = _getDefaultProject + } + + # If there is no projectName by this point just return a empty + # list. + if ($projectName) { + foreach ($q in (Get-VSTeamQueue -ProjectName $projectName)) { + if ($q.name -like "*$WordToComplete*") { + $results.Add([CompletionResult]::new($q.name)) + } + } + } + + return $results + } +} diff --git a/Source/Classes/UncachedProjectCompleter.ps1 b/Source/Classes/UncachedProjectCompleter.ps1 new file mode 100644 index 000000000..0d7a6194d --- /dev/null +++ b/Source/Classes/UncachedProjectCompleter.ps1 @@ -0,0 +1,29 @@ +using namespace System.Collections +using namespace System.Collections.Generic +using namespace System.Management.Automation + +class UncachedProjectCompleter : IArgumentCompleter { + [IEnumerable[CompletionResult]] CompleteArgument( + [string] $CommandName, + [string] $ParameterName, + [string] $WordToComplete, + [Language.CommandAst] $CommandAst, + [IDictionary] $FakeBoundParameters) { + + $results = [List[CompletionResult]]::new() + + [VSTeamProjectCache]::projects = _getProjects + [VSTeamProjectCache]::timestamp = (Get-Date).Minute + + foreach ($p in [VSTeamProjectCache]::projects) { + if ($p -like "*$WordToComplete*" -and $p -match "\s") { + $results.Add([CompletionResult]::new("'$p'")) + } + elseif ($p -like "*$WordToComplete*") { + $results.Add([CompletionResult]::new($p)) + } + } + + return $results + } +} diff --git a/Source/Classes/UncachedProjectValidateAttribute.ps1 b/Source/Classes/UncachedProjectValidateAttribute.ps1 new file mode 100644 index 000000000..6dddf2a87 --- /dev/null +++ b/Source/Classes/UncachedProjectValidateAttribute.ps1 @@ -0,0 +1,17 @@ +using namespace System.Management.Automation + +class UncachedProjectValidateAttribute : ValidateArgumentsAttribute { + [void] Validate( + [object] $arguments, + [EngineIntrinsics] $EngineIntrinsics) { + + [VSTeamProjectCache]::projects = _getProjects + [VSTeamProjectCache]::timestamp = (Get-Date).Minute + + if (-not $arguments -in [VSTeamProjectCache]::projects) { + throw [ValidationMetadataException]::new( + "'$arguments' is not a valid project. Valid projects are: '" + + ([VSTeamProjectCache]::projects -join "', '") + "'" ) + } + } +} \ No newline at end of file diff --git a/Source/Classes/VSTeamAccessControlList.ps1 b/Source/Classes/VSTeamAccessControlList.ps1 index e8dd53399..61a4b0567 100644 --- a/Source/Classes/VSTeamAccessControlList.ps1 +++ b/Source/Classes/VSTeamAccessControlList.ps1 @@ -27,6 +27,6 @@ class VSTeamAccessControlList : VSTeamLeaf { } [string]ToString() { - return $this.Descriptor + return $this.Token } } \ No newline at end of file diff --git a/Source/Classes/VSTeamAccount.ps1 b/Source/Classes/VSTeamAccount.ps1 index b7987bd41..a62dd2fb2 100644 --- a/Source/Classes/VSTeamAccount.ps1 +++ b/Source/Classes/VSTeamAccount.ps1 @@ -25,7 +25,7 @@ class VSTeamAccount : SHiPSDirectory { $topLevelFolders += [VSTeamFeeds]::new('Feeds') } - if(_testGraphSupport) { + if (_testGraphSupport) { $topLevelFolders += [VSTeamPermissions]::new('Permissions') } diff --git a/Source/Classes/WorkItemTypeCompleter.ps1 b/Source/Classes/WorkItemTypeCompleter.ps1 new file mode 100644 index 000000000..05da1032c --- /dev/null +++ b/Source/Classes/WorkItemTypeCompleter.ps1 @@ -0,0 +1,37 @@ +using namespace System.Collections +using namespace System.Collections.Generic +using namespace System.Management.Automation + +class WorkItemTypeCompleter : IArgumentCompleter { + [IEnumerable[CompletionResult]] CompleteArgument( + [string] $CommandName, + [string] $ParameterName, + [string] $WordToComplete, + [Language.CommandAst] $CommandAst, + [IDictionary] $FakeBoundParameters) { + + $results = [List[CompletionResult]]::new() + + # If the user has explictly added the -ProjectName parameter + # to the command use that instead of the default project. + $projectName = $FakeBoundParameters['ProjectName'] + + # Only use the default project if the ProjectName parameter was + # not used + if (-not $projectName) { + $projectName = _getDefaultProject + } + + # If there is no projectName by this point just return a empty + # list. + if ($projectName) { + foreach ($w in (_getWorkItemTypes -ProjectName $projectName)) { + if ($w -like "*$WordToComplete*") { + $results.Add([CompletionResult]::new($w)) + } + } + } + + return $results + } +} \ No newline at end of file diff --git a/Source/Classes/WorkItemTypeValidateAttribute.ps1 b/Source/Classes/WorkItemTypeValidateAttribute.ps1 new file mode 100644 index 000000000..5da5f957e --- /dev/null +++ b/Source/Classes/WorkItemTypeValidateAttribute.ps1 @@ -0,0 +1,18 @@ +using namespace System.Management.Automation + +class WorkItemTypeValidateAttribute : ValidateArgumentsAttribute { + [void] Validate( + [object] $arguments, + [EngineIntrinsics] $EngineIntrinsics) { + + if (_getDefaultProject) { + $types = _getWorkItemTypes -ProjectName $(_getDefaultProject) + + if (($null -ne $types) -and (-not ($arguments -in $types))) { + throw [ValidationMetadataException]::new( + "'$arguments' is not a valid WorkItemType. Valid WorkItemTypees are: '" + + ($types -join "', '") + "'") + } + } + } +} \ No newline at end of file diff --git a/Source/Classes/_classes.json b/Source/Classes/_classes.json index 00421be5e..af91fb769 100644 --- a/Source/Classes/_classes.json +++ b/Source/Classes/_classes.json @@ -2,6 +2,18 @@ "outputFile": "vsteam.classes.ps1", "fileType": "classes", "files": [ + "BuildCompleter.ps1", + "BuildDefinitionCompleter.ps1", + "ProcessTemplateCompleter.ps1", + "ProjectCompleter.ps1", + "ReleaseDefinitionCompleter.ps1", + "TeamQueueCompleter.ps1", + "UncachedProjectCompleter.ps1", + "WorkItemTypeCompleter.ps1", + "ProcessValidateAttribute.ps1", + "ProjectValidateAttribute.ps1", + "UncachedProjectValidateAttribute.ps1", + "WorkItemTypeValidateAttribute.ps1", "VSTeamVersions.ps1", "VSTeamProjectCache.ps1", "VSTeamProcessCache.ps1", diff --git a/Source/Private/callMembershipAPI.ps1 b/Source/Private/callMembershipAPI.ps1 index a17c2845e..6e1f65f5e 100644 --- a/Source/Private/callMembershipAPI.ps1 +++ b/Source/Private/callMembershipAPI.ps1 @@ -9,8 +9,6 @@ function _callMembershipAPI { [ValidateSet('', 'Up', 'Down')] [string] $Direction ) - Set-StrictMode -Version Latest - # This will throw if this account does not support the graph API _supportsGraph diff --git a/Source/Private/common.ps1 b/Source/Private/common.ps1 index 109fea36e..37346243b 100644 --- a/Source/Private/common.ps1 +++ b/Source/Private/common.ps1 @@ -1,984 +1,976 @@ -Set-StrictMode -Version Latest - -$here = Split-Path -Parent $MyInvocation.MyCommand.Path - -[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseDeclaredVarsMoreThanAssignments", "It is used in other files")] -$profilesPath = "$HOME/vsteam_profiles.json" - -# Not all versions support the name features. - -function _supportsGraph { - _hasAccount - if ($false -eq $(_testGraphSupport)) { - throw 'This account does not support the graph API.' - } -} - -function _testGraphSupport { - if (-not $(_getApiVersion Graph)) { - return $false - } - - return $true -} - -function _supportsFeeds { - _hasAccount - if ($false -eq $(_testFeedSupport)) { - throw 'This account does not support packages.' - } -} - -function _testFeedSupport { - if (-not $(_getApiVersion Packaging)) { - return $false - } - - return $true -} - -function _supportsSecurityNamespace { - _hasAccount - if (([VSTeamVersions]::Version -ne "VSTS") -and ([VSTeamVersions]::Version -ne "AzD")) { - throw 'Security Namespaces are currently only supported in Azure DevOps Service (Online)' - } -} - -function _supportsMemberEntitlementManagement { - _hasAccount - if (-not $(_getApiVersion MemberEntitlementManagement)) { - throw 'This account does not support Member Entitlement.' - } -} - -function _testAdministrator { - $user = [Security.Principal.WindowsIdentity]::GetCurrent() - (New-Object Security.Principal.WindowsPrincipal $user).IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator) -} - -# When you mock this in tests be sure to add a Parameter Filter that matches -# the Service that should be used. -# Mock _getApiVersion { return '1.0-gitUnitTests' } -ParameterFilter { $Service -eq 'Git' } -# Also test in the Assert-MockCalled that the correct version was used in the URL that was -# built for the API call. -function _getApiVersion { - [CmdletBinding(DefaultParameterSetName = 'Service')] - param ( - [parameter(ParameterSetName = 'Service', Mandatory = $true, Position = 0)] - [ValidateSet('Build', 'Release', 'Core', 'Git', 'DistributedTask', 'VariableGroups', 'Tfvc', 'Packaging', 'MemberEntitlementManagement', 'ExtensionsManagement', 'ServiceFabricEndpoint', 'Graph', 'TaskGroups', 'Policy')] - [string] $Service, - - [parameter(ParameterSetName = 'Target')] - [switch] $Target - ) - - if ($Target.IsPresent) { - return [VSTeamVersions]::Version - } - else { - - switch ($Service) { - 'Build' { - return [VSTeamVersions]::Build - } - 'Release' { - return [VSTeamVersions]::Release - } - 'Core' { - return [VSTeamVersions]::Core - } - 'Git' { - return [VSTeamVersions]::Git - } - 'DistributedTask' { - return [VSTeamVersions]::DistributedTask - } - 'VariableGroups' { - return [VSTeamVersions]::VariableGroups - } - 'Tfvc' { - return [VSTeamVersions]::Tfvc - } - 'Packaging' { - return [VSTeamVersions]::Packaging - } - 'MemberEntitlementManagement' { - return [VSTeamVersions]::MemberEntitlementManagement - } - 'ExtensionsManagement' { - return [VSTeamVersions]::ExtensionsManagement - } - 'ServiceFabricEndpoint' { - return [VSTeamVersions]::ServiceFabricEndpoint - } - 'Graph' { - return [VSTeamVersions]::Graph - } - 'TaskGroups' { - return [VSTeamVersions]::TaskGroups - } - 'Policy' { - return [VSTeamVersions]::Policy - } - } - } -} - -function _getInstance { - return [VSTeamVersions]::Account -} - -function _hasAccount { - if (-not $(_getInstance)) { - throw 'You must call Set-VSTeamAccount before calling any other functions in this module.' - } -} - -function _buildRequestURI { - [CmdletBinding()] - param( - [string]$team, - [string]$resource, - [string]$area, - [string]$id, - [string]$version, - [string]$subDomain, - [object]$queryString, - [switch]$UseProjectId, - [switch]$NoProject - ) - DynamicParam { - _buildProjectNameDynamicParam -Mandatory $false - } - - process { - _hasAccount - - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - - $sb = New-Object System.Text.StringBuilder - - $sb.Append($(_addSubDomain -subDomain $subDomain -instance $(_getInstance))) | Out-Null - - # There are some APIs that must not have the project added to the URI. - # However, if they caller set the default project it will be passed in - # here and added to the URI by mistake. Functions that need the URI - # created without the project even if the default project is set needs - # to pass the -NoProject switch. - if ($ProjectName -and $NoProject.IsPresent -eq $false) { - if ($UseProjectId.IsPresent) { - $projectId = (Get-VSTeamProject -Name $ProjectName | Select-Object -ExpandProperty id) - $sb.Append("/$projectId") | Out-Null - } - else { - $sb.Append("/$projectName") | Out-Null - } - } - - if ($team) { - $sb.Append("/$team") | Out-Null - } - - $sb.Append("/_apis") | Out-Null - - if ($area) { - $sb.Append("/$area") | Out-Null - } - - if ($resource) { - $sb.Append("/$resource") | Out-Null - } - - if ($id) { - $sb.Append("/$id") | Out-Null - } - - if ($version) { - $sb.Append("?api-version=$version") | Out-Null - } - - $url = $sb.ToString() - - if ($queryString) { - foreach ($key in $queryString.keys) { - $Url += _appendQueryString -name $key -value $queryString[$key] - } - } - - return $url - } -} - -function _handleException { - param( - [Parameter(Position = 1)] - $ex - ) - - $handled = $false - - if ($ex.Exception.PSObject.Properties.Match('Response').count -gt 0 -and - $null -ne $ex.Exception.Response -and - $ex.Exception.Response.StatusCode -ne "BadRequest") { - $handled = $true - $msg = "An error occurred: $($ex.Exception.Message)" - Write-Warning -Message $msg - } - - try { - $e = (ConvertFrom-Json $ex.ToString()) - - $hasValueProp = $e.PSObject.Properties.Match('value') - - if (0 -eq $hasValueProp.count) { - $handled = $true - Write-Warning -Message $e.message - } - else { - $handled = $true - Write-Warning -Message $e.value.message - } - } - catch { - $msg = "An error occurred: $($ex.Exception.Message)" - } - - if (-not $handled) { - throw $ex - } -} - -function _isVSTS { - param( - [parameter(Mandatory = $true)] - [string] $instance - ) - return $instance -like "*.visualstudio.com*" -or $instance -like "https://dev.azure.com/*" -} - -function _getVSTeamAPIVersion { - param( - [parameter(Mandatory = $true)] - [string] $instance, - [string] $Version - ) - - if ($Version) { - return $Version - } - else { - if (_isVSTS $instance) { - return 'VSTS' - } - else { - return 'TFS2017' - } - } -} - -function _isOnWindows { - $os = Get-OperatingSystem - return $os -eq 'Windows' -} - -function _addSubDomain { - param( - [string] $subDomain, - [string] $instance - ) - - # For VSTS Entitlements is under .vsaex - if ($subDomain -and $instance.ToLower().Contains('dev.azure.com')) { - $instance = $instance.ToLower().Replace('dev.azure.com', "$subDomain.dev.azure.com") - } - - return $instance -} - -function _appendQueryString { - param( - $name, - $value, - # When provided =0 will be outputed otherwise zeros will not be - # added. I had to add this for the userentitlements that is the only - # VSTS API I have found that requires Top and Skip to be passed in. - [Switch]$retainZero - ) - - if ($retainZero.IsPresent) { - if ($null -ne $value) { - return "&$name=$value" - } - } - else { - if ($value) { - return "&$name=$value" - } - } -} - -function _getUserAgent { - [CmdletBinding()] - param() - - $os = Get-OperatingSystem - - $result = "Team Module/$([VSTeamVersions]::ModuleVersion) ($os) PowerShell/$($PSVersionTable.PSVersion.ToString())" - - Write-Verbose $result - - return $result -} - -function _useWindowsAuthenticationOnPremise { - return (_isOnWindows) -and (!$env:TEAM_PAT) -and -not ($(_getInstance) -like "*visualstudio.com") -and -not ($(_getInstance) -like "https://dev.azure.com/*") -} - -function _useBearerToken { - return (!$env:TEAM_PAT) -and ($env:TEAM_TOKEN) -} - -function _getWorkItemTypes { - param( - [Parameter(Mandatory = $true)] - [string] $ProjectName - ) - - if (-not $(_getInstance)) { - Write-Output @() - return - } - - # Call the REST API - try { - $resp = _callAPI -ProjectName $ProjectName -area 'wit' -resource 'workitemtypes' -version $(_getApiVersion Core) - - # This call returns JSON with "": which causes the ConvertFrom-Json to fail. - # To replace all the "": with "_end": - $resp = $resp.Replace('"":', '"_end":') | ConvertFrom-Json - - if ($resp.count -gt 0) { - Write-Output ($resp.value).name - } - } - catch { - Write-Verbose $_ - Write-Output @() - } -} - -# When writing unit tests mock this and return false. -# This will prevent the dynamic project name parameter -# from trying to call the getProject function. -# Mock _hasProjectCacheExpired { return $false } -function _hasProjectCacheExpired { - return $([VSTeamProjectCache]::timestamp) -ne (Get-Date).Minute -} - -function _getProjects { - if (-not $(_getInstance)) { - Write-Output @() - return - } - - $resource = "/projects" - $instance = $(_getInstance) - $version = $(_getApiVersion Core) - - # Build the url to list the projects - # You CANNOT use _buildRequestURI here or you will end up - # in an infinite loop. - $listurl = $instance + '/_apis' + $resource + '?api-version=' + $version + '&stateFilter=All&$top=9999' - - # Call the REST API - try { - $resp = _callAPI -url $listurl - - if ($resp.count -gt 0) { - Write-Output ($resp.value).name - } - } - catch { - Write-Output @() - } -} - -function _buildProjectNameDynamicParam { - param( - [string] $ParameterName = 'ProjectName', - [string] $ParameterSetName, - [bool] $Mandatory = $true, - [string] $AliasName, - [int] $Position = 0 - ) - - # Create the dictionary - $RuntimeParameterDictionary = New-Object System.Management.Automation.RuntimeDefinedParameterDictionary - - # Create the collection of attributes - $AttributeCollection = New-Object System.Collections.ObjectModel.Collection[System.Attribute] - - # Create and set the parameters' attributes - $ParameterAttribute = New-Object System.Management.Automation.ParameterAttribute - $ParameterAttribute.Mandatory = $Mandatory - $ParameterAttribute.Position = $Position - - if ($ParameterSetName) { - $ParameterAttribute.ParameterSetName = $ParameterSetName - } - - $ParameterAttribute.ValueFromPipelineByPropertyName = $true - $ParameterAttribute.HelpMessage = "The name of the project. You can tab complete from the projects in your Team Services or TFS account when passed on the command line." - - # Add the attributes to the attributes collection - $AttributeCollection.Add($ParameterAttribute) - - if ($AliasName) { - $AliasAttribute = New-Object System.Management.Automation.AliasAttribute(@($AliasName)) - $AttributeCollection.Add($AliasAttribute) - } - - # Generate and set the ValidateSet - if (_hasProjectCacheExpired) { - $arrSet = _getProjects - [VSTeamProjectCache]::projects = $arrSet - [VSTeamProjectCache]::timestamp = (Get-Date).Minute - } - else { - $arrSet = [VSTeamProjectCache]::projects - } - - if ($arrSet) { - Write-Verbose "arrSet = $arrSet" - - $ValidateSetAttribute = New-Object System.Management.Automation.ValidateSetAttribute($arrSet) - - # Add the ValidateSet to the attributes collection - $AttributeCollection.Add($ValidateSetAttribute) - } - - # Create and return the dynamic parameter - $RuntimeParameter = New-Object System.Management.Automation.RuntimeDefinedParameter($ParameterName, [string], $AttributeCollection) - $RuntimeParameterDictionary.Add($ParameterName, $RuntimeParameter) - return $RuntimeParameterDictionary - - <# - Builds a dynamic parameter that can be used to tab complete the ProjectName - parameter of functions from a list of projects from the added TFS Account. - You must call Set-VSTeamAccount before trying to use any function that relies - on this dynamic parameter or you will get an error. - - This can only be used in Advanced Fucntion with the [CmdletBinding()] attribute. - The function must also have a begin block that maps the value to a common variable - like this. - - DynamicParam { - # Generate and set the ValidateSet - $arrSet = Get-VSTeamProjects | Select-Object -ExpandProperty Name - - _buildProjectNameDynamicParam -arrSet $arrSet - } - - process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters[$ParameterName] - } - #> -} - -function _getProcesses { - if (-not $(_getInstance)) { - Write-Output @() - return - } - - # Call the REST API - try { - $query = @{ } - $query['stateFilter'] = 'All' - $query['$top'] = '9999' - $resp = _callAPI -area 'process' -resource 'processes' -Version $(_getApiVersion Core) -QueryString $query - - if ($resp.count -gt 0) { - Write-Output ($resp.value).name - } - } - catch { - Write-Output @() - } -} -function _buildProcessNameDynamicParam { - param( - [string] $ParameterName = 'ProcessName', - [string] $ParameterSetName, - [bool] $Mandatory = $true, - [string] $AliasName, - [int] $Position = 0 - ) - - # Create the dictionary - $RuntimeParameterDictionary = New-Object System.Management.Automation.RuntimeDefinedParameterDictionary - - # Create the collection of attributes - $AttributeCollection = New-Object System.Collections.ObjectModel.Collection[System.Attribute] - - # Create and set the parameters' attributes - $ParameterAttribute = New-Object System.Management.Automation.ParameterAttribute - $ParameterAttribute.Mandatory = $Mandatory - $ParameterAttribute.Position = $Position - - if ($ParameterSetName) { - $ParameterAttribute.ParameterSetName = $ParameterSetName - } - - $ParameterAttribute.ValueFromPipelineByPropertyName = $true - $ParameterAttribute.HelpMessage = "The name of the process. You can tab complete from the processes in your Team Services or TFS account when passed on the command line." - - # Add the attributes to the attributes collection - $AttributeCollection.Add($ParameterAttribute) - - if ($AliasName) { - $AliasAttribute = New-Object System.Management.Automation.AliasAttribute(@($AliasName)) - $AttributeCollection.Add($AliasAttribute) - } - - # Generate and set the ValidateSet - if ($([VSTeamProcessCache]::timestamp) -ne (Get-Date).Minute) { - $arrSet = _getProcesses - [VSTeamProcessCache]::processes = $arrSet - [VSTeamProcessCache]::timestamp = (Get-Date).Minute - } - else { - $arrSet = [VSTeamProcessCache]::projects - } - - if ($arrSet) { - Write-Verbose "arrSet = $arrSet" - - $ValidateSetAttribute = New-Object System.Management.Automation.ValidateSetAttribute($arrSet) - - # Add the ValidateSet to the attributes collection - $AttributeCollection.Add($ValidateSetAttribute) - } - - # Create and return the dynamic parameter - $RuntimeParameter = New-Object System.Management.Automation.RuntimeDefinedParameter($ParameterName, [string], $AttributeCollection) - $RuntimeParameterDictionary.Add($ParameterName, $RuntimeParameter) - return $RuntimeParameterDictionary - - <# - Builds a dynamic parameter that can be used to tab complete the ProjectName - parameter of functions from a list of projects from the added TFS Account. - You must call Set-VSTeamAccount before trying to use any function that relies - on this dynamic parameter or you will get an error. - - This can only be used in Advanced Fucntion with the [CmdletBinding()] attribute. - The function must also have a begin block that maps the value to a common variable - like this. - - DynamicParam { - # Generate and set the ValidateSet - $arrSet = Get-VSTeamProjects | Select-Object -ExpandProperty Name - - _buildProjectNameDynamicParam -arrSet $arrSet - } - process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters[$ParameterName] - } - #> -} -function _buildDynamicParam { - param( - [string] $ParameterName = 'QueueName', - [array] $arrSet, - [bool] $Mandatory = $false, - [string] $ParameterSetName, - [int] $Position = -1, - [type] $ParameterType = [string], - [bool] $ValueFromPipelineByPropertyName = $true, - [string] $AliasName, - [string] $HelpMessage - ) - # Create the collection of attributes - $AttributeCollection = New-Object System.Collections.ObjectModel.Collection[System.Attribute] - <# -.SYNOPSIS -Short description - -.DESCRIPTION -Long description - -.PARAMETER ParameterName -Parameter description - -.PARAMETER ParameterSetName -Parameter description - -.PARAMETER Mandatory -Parameter description - -.PARAMETER AliasName -Parameter description - -.PARAMETER Position -Parameter description - -.EXAMPLE -An example - -.NOTES -General notes -#> - # Create and set the parameters' attributes - $ParameterAttribute = New-Object System.Management.Automation.ParameterAttribute - $ParameterAttribute.Mandatory = $Mandatory - $ParameterAttribute.ValueFromPipelineByPropertyName = $ValueFromPipelineByPropertyName - - if ($Position -ne -1) { - $ParameterAttribute.Position = $Position - } - - if ($ParameterSetName) { - $ParameterAttribute.ParameterSetName = $ParameterSetName - } - - if ($HelpMessage) { - $ParameterAttribute.HelpMessage = $HelpMessage - } - - # Add the attributes to the attributes collection - $AttributeCollection.Add($ParameterAttribute) - - if ($AliasName) { - $AliasAttribute = New-Object System.Management.Automation.AliasAttribute(@($AliasName)) - $AttributeCollection.Add($AliasAttribute) - } - - if ($arrSet) { - # Generate and set the ValidateSet - $ValidateSetAttribute = New-Object System.Management.Automation.ValidateSetAttribute($arrSet) - - # Add the ValidateSet to the attributes collection - $AttributeCollection.Add($ValidateSetAttribute) - } - - # Create and return the dynamic parameter - return New-Object System.Management.Automation.RuntimeDefinedParameter($ParameterName, $ParameterType, $AttributeCollection) -} - -function _convertSecureStringTo_PlainText { - [CmdletBinding()] - param( - [parameter(ParameterSetName = 'Secure', Mandatory = $true, HelpMessage = 'Secure String')] - [securestring] $SecureString - ) - - # Convert the securestring to a normal string - # this was the one technique that worked on Mac, Linux and Windows - $credential = New-Object System.Management.Automation.PSCredential 'unknown', $SecureString - return $credential.GetNetworkCredential().Password -} - -# This is the main function for calling TFS and VSTS. It handels the auth and format of the route. -# If you need to call TFS or VSTS this is the function to use. -function _callAPI { - param( - [string]$resource, - [string]$area, - [string]$id, - [string]$version, - [string]$subDomain, - [ValidateSet('Get', 'Post', 'Patch', 'Delete', 'Options', 'Put', 'Default', 'Head', 'Merge', 'Trace')] - [string]$method, - [Parameter(ValueFromPipeline = $true)] - [object]$body, - [string]$InFile, - [string]$OutFile, - [string]$ContentType, - [string]$ProjectName, - [string]$Team, - [string]$Url, - [object]$QueryString, - [hashtable]$AdditionalHeaders, - # Some API calls require the Project ID and not the project name. - # However, the dynamic project name parameter only shows you names - # and not the Project IDs. Using this flag the project name provided - # will be converted to the Project ID when building the URI for the API - # call. - [switch]$UseProjectId, - # This flag makes sure that even if a default project is set that it is - # not used to build the URI for the API call. Not all API require or - # allow the project to be used. Setting a default project would cause - # that project name to be used in building the URI that would lead to - # 404 because the URI would not be correct. - [switch]$NoProject - ) - - # If the caller did not provide a Url build it. - if (-not $Url) { - $buildUriParams = @{ } + $PSBoundParameters; - $extra = 'method', 'body', 'InFile', 'OutFile', 'ContentType', 'AdditionalHeaders' - foreach ($x in $extra) { $buildUriParams.Remove($x) | Out-Null } - $Url = _buildRequestURI @buildUriParams - } - elseif ($QueryString) { - # If the caller provided the URL and QueryString we need - # to add the querystring now - foreach ($key in $QueryString.keys) { - $Url += _appendQueryString -name $key -value $QueryString[$key] - } - } - - if ($body) { - Write-Verbose "Body $body" - } - - $params = $PSBoundParameters - $params.Add('Uri', $Url) - $params.Add('UserAgent', (_getUserAgent)) - - if (_useWindowsAuthenticationOnPremise) { - $params.Add('UseDefaultCredentials', $true) - $params.Add('Headers', @{ }) - } - elseif (_useBearerToken) { - $params.Add('Headers', @{Authorization = "Bearer $env:TEAM_TOKEN" }) - } - else { - $params.Add('Headers', @{Authorization = "Basic $env:TEAM_PAT" }) - } - - if ($AdditionalHeaders -and $AdditionalHeaders.PSObject.Properties.name -match "Keys") { - foreach ($key in $AdditionalHeaders.Keys) { - $params['Headers'].Add($key, $AdditionalHeaders[$key]) - } - } - - # We have to remove any extra parameters not used by Invoke-RestMethod - $extra = 'NoProject', 'UseProjectId', 'Area', 'Resource', 'SubDomain', 'Id', 'Version', 'JSON', 'ProjectName', 'Team', 'Url', 'QueryString', 'AdditionalHeaders' - foreach ($e in $extra) { $params.Remove($e) | Out-Null } - - try { - $resp = Invoke-RestMethod @params - - if ($resp) { - Write-Verbose "return type: $($resp.gettype())" - Write-Verbose $resp - } - - return $resp - } - catch { - _handleException $_ - - throw - } -} - -function _trackProjectProgress { - param( - [Parameter(Mandatory = $true)] $Resp, - [string] $Title, - [string] $Msg - ) - - $i = 0 - $x = 1 - $y = 10 - $status = $resp.status - - # Track status - while ($status -ne 'failed' -and $status -ne 'succeeded') { - $status = (_callAPI -Url $resp.url).status - - # oscillate back a forth to show progress - $i += $x - Write-Progress -Activity $title -Status $msg -PercentComplete ($i / $y * 100) - - if ($i -eq $y -or $i -eq 0) { - $x *= -1 - } - } -} - -$iTracking = 0 -$xTracking = 1 -$yTracking = 10 -$statusTracking = $null - -function _trackServiceEndpointProgress { - param( - [Parameter(Mandatory = $true)] - [string] $projectName, - - [Parameter(Mandatory = $true)] - $resp, - - [string] $title, - - [string] $msg - ) - - $iTracking = 0 - $xTracking = 1 - $yTracking = 10 - - $isReady = $false - - # Track status - while (-not $isReady) { - $statusTracking = _callAPI -ProjectName $projectName -Area 'distributedtask' -Resource 'serviceendpoints' -Id $resp.id ` - -Version $(_getApiVersion DistributedTask) - - $isReady = $statusTracking.isReady; - - if (-not $isReady) { - $state = $statusTracking.operationStatus.state - - if ($state -eq "Failed") { - throw $statusTracking.operationStatus.statusMessage - } - } - - # oscillate back a forth to show progress - $iTracking += $xTracking - Write-Progress -Activity $title -Status $msg -PercentComplete ($iTracking / $yTracking * 100) - - if ($iTracking -eq $yTracking -or $iTracking -eq 0) { - $xTracking *= -1 - } - } -} - -function _supportsServiceFabricEndpoint { - if (-not $(_getApiVersion ServiceFabricEndpoint)) { - throw 'This account does not support Service Fabric endpoints.' - } -} - -function _getModuleVersion { - # Read the version from the psd1 file. - # $content = (Get-Content -Raw "./VSTeam.psd1" | Out-String) - $content = (Get-Content -Raw "$here\VSTeam.psd1" | Out-String) - $r = [regex]"ModuleVersion += +'([^']+)'" - $d = $r.Match($content) - - return $d.Groups[1].Value -} - -function _setEnvironmentVariables { - [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseDeclaredVarsMoreThanAssignments", "")] - param ( - [string] $Level = "Process", - [string] $Pat, - [string] $Acct, - [string] $BearerToken, - [string] $Version - ) - - # You always have to set at the process level or they will Not - # be seen in your current session. - $env:TEAM_PAT = $Pat - $env:TEAM_ACCT = $Acct - $env:TEAM_VERSION = $Version - $env:TEAM_TOKEN = $BearerToken - - [VSTeamVersions]::Account = $Acct - - # This is so it can be loaded by default in the next session - if ($Level -ne "Process") { - [System.Environment]::SetEnvironmentVariable("TEAM_PAT", $Pat, $Level) - [System.Environment]::SetEnvironmentVariable("TEAM_ACCT", $Acct, $Level) - [System.Environment]::SetEnvironmentVariable("TEAM_VERSION", $Version, $Level) - } -} - -# If you remove an account the current default project needs to be cleared as well. -function _clearEnvironmentVariables { - [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseDeclaredVarsMoreThanAssignments", "")] - param ( - [string] $Level = "Process" - ) - - $env:TEAM_PROJECT = $null - [VSTeamVersions]::DefaultProject = '' - $Global:PSDefaultParameterValues.Remove("*:projectName") - - # This is so it can be loaded by default in the next session - if ($Level -ne "Process") { - [System.Environment]::SetEnvironmentVariable("TEAM_PROJECT", $null, $Level) - } - - _setEnvironmentVariables -Level $Level -Pat '' -Acct '' -UseBearerToken '' -Version '' -} - -function _convertToHex() { - [cmdletbinding()] - param( - [parameter(Mandatory = $true)] - [string]$Value - ) - - $bytes = $Value | Format-Hex -Encoding Unicode - $hexString = ($bytes.Bytes | ForEach-Object ToString X2) -join '' - return $hexString.ToLowerInvariant(); -} - -function _getVSTeamIdFromDescriptor { - [cmdletbinding()] - param( - [parameter(Mandatory = $true)] - [string]$Descriptor - ) - - $identifier = $Descriptor.Split('.')[1] - - # We need to Pad the string for FromBase64String to work reliably (AzD Descriptors are not padded) - $ModulusValue = ($identifier.length % 4) - Switch ($ModulusValue) { - '0' { $Padded = $identifier } - '1' { $Padded = $identifier.Substring(0, $identifier.Length - 1) } - '2' { $Padded = $identifier + ('=' * (4 - $ModulusValue)) } - '3' { $Padded = $identifier + ('=' * (4 - $ModulusValue)) } - } - - return [System.Text.Encoding]::ASCII.GetString([System.Convert]::FromBase64String($Padded)) -} - -function _getDescriptorForACL { - [cmdletbinding()] - param( - [parameter(Mandatory = $true, ParameterSetName = "ByUser")] - [VSTeamUser]$User, - - [parameter(MAndatory = $true, ParameterSetName = "ByGroup")] - [VSTeamGroup]$Group - ) - - if ($User) { - switch ($User.Origin) { - "vsts" { - $sid = _getVSTeamIdFromDescriptor -Descriptor $User.Descriptor - $descriptor = "Microsoft.TeamFoundation.Identity;$sid" - } - "aad" { - $descriptor = "Microsoft.IdentityModel.Claims.ClaimsIdentity;$($User.Domain)\\$($User.PrincipalName)" - } - default { throw "User type not handled yet for ACL. Please report this as an issue on the VSTeam Repository: https://github.com/DarqueWarrior/vsteam/issues" } - } - } - - if ($Group) { - switch ($Group.Origin) { - "vsts" { - $sid = _getVSTeamIdFromDescriptor -Descriptor $Group.Descriptor - $descriptor = "Microsoft.TeamFoundation.Identity;$sid" - } - default { throw "Group type not handled yet for Add-VSTeamGitRepositoryPermission. Please report this as an issue on the VSTeam Repository: https://github.com/DarqueWarrior/vsteam/issues" } - } - } - - return $descriptor -} +$here = Split-Path -Parent $MyInvocation.MyCommand.Path + +[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseDeclaredVarsMoreThanAssignments", "It is used in other files")] +$profilesPath = "$HOME/vsteam_profiles.json" + +# This is the main function for calling TFS and VSTS. It handels the auth and format of the route. +# If you need to call TFS or VSTS this is the function to use. +function _callAPI { + param( + [string]$resource, + [string]$area, + [string]$id, + [string]$version, + [string]$subDomain, + [ValidateSet('Get', 'Post', 'Patch', 'Delete', 'Options', 'Put', 'Default', 'Head', 'Merge', 'Trace')] + [string]$method, + [Parameter(ValueFromPipeline = $true)] + [object]$body, + [string]$InFile, + [string]$OutFile, + [string]$ContentType, + [string]$ProjectName, + [string]$Team, + [string]$Url, + [object]$QueryString, + [hashtable]$AdditionalHeaders, + # Some API calls require the Project ID and not the project name. + # However, the dynamic project name parameter only shows you names + # and not the Project IDs. Using this flag the project name provided + # will be converted to the Project ID when building the URI for the API + # call. + [switch]$UseProjectId, + # This flag makes sure that even if a default project is set that it is + # not used to build the URI for the API call. Not all API require or + # allow the project to be used. Setting a default project would cause + # that project name to be used in building the URI that would lead to + # 404 because the URI would not be correct. + [Alias('IgnoreDefaultProject')] + [switch]$NoProject + ) + + # If the caller did not provide a Url build it. + if (-not $Url) { + $buildUriParams = @{ } + $PSBoundParameters; + $extra = 'method', 'body', 'InFile', 'OutFile', 'ContentType', 'AdditionalHeaders' + foreach ($x in $extra) { $buildUriParams.Remove($x) | Out-Null } + $Url = _buildRequestURI @buildUriParams + } + elseif ($QueryString) { + # If the caller provided the URL and QueryString we need + # to add the querystring now + foreach ($key in $QueryString.keys) { + $Url += _appendQueryString -name $key -value $QueryString[$key] + } + } + + if ($body) { + Write-Verbose "Body $body" + } + + $params = $PSBoundParameters + $params.Add('Uri', $Url) + $params.Add('UserAgent', (_getUserAgent)) + + if (_useWindowsAuthenticationOnPremise) { + $params.Add('UseDefaultCredentials', $true) + $params.Add('Headers', @{ }) + } + elseif (_useBearerToken) { + $params.Add('Headers', @{Authorization = "Bearer $env:TEAM_TOKEN" }) + } + else { + $params.Add('Headers', @{Authorization = "Basic $env:TEAM_PAT" }) + } + + if ($AdditionalHeaders -and $AdditionalHeaders.PSObject.Properties.name -match "Keys") { + foreach ($key in $AdditionalHeaders.Keys) { + $params['Headers'].Add($key, $AdditionalHeaders[$key]) + } + } + + # We have to remove any extra parameters not used by Invoke-RestMethod + $extra = 'NoProject', 'UseProjectId', 'Area', 'Resource', 'SubDomain', 'Id', 'Version', 'JSON', 'ProjectName', 'Team', 'Url', 'QueryString', 'AdditionalHeaders' + foreach ($e in $extra) { $params.Remove($e) | Out-Null } + + try { + $resp = Invoke-RestMethod @params + + if ($resp) { + Write-Verbose "return type: $($resp.gettype())" + Write-Verbose $resp + } + + return $resp + } + catch { + _handleException $_ + + throw + } +} + +# Not all versions support the name features. + +function _supportsGraph { + _hasAccount + if ($false -eq $(_testGraphSupport)) { + throw 'This account does not support the graph API.' + } +} + +function _testGraphSupport { + (_getApiVersion Graph) -as [boolean] +} + +function _supportsFeeds { + _hasAccount + if ($false -eq $(_testFeedSupport)) { + throw 'This account does not support packages.' + } +} + +function _testFeedSupport { + (_getApiVersion Packaging) -as [boolean] +} + +function _supportsSecurityNamespace { + _hasAccount + if (([VSTeamVersions]::Version -ne "VSTS") -and ([VSTeamVersions]::Version -ne "AzD")) { + throw 'Security Namespaces are currently only supported in Azure DevOps Service (Online)' + } +} + +function _supportsMemberEntitlementManagement { + _hasAccount + if (-not $(_getApiVersion MemberEntitlementManagement)) { + throw 'This account does not support Member Entitlement.' + } +} + +function _testAdministrator { + $user = [Security.Principal.WindowsIdentity]::GetCurrent() + (New-Object Security.Principal.WindowsPrincipal $user).IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator) +} + +# When you mock this in tests be sure to add a Parameter Filter that matches +# the Service that should be used. +# Mock _getApiVersion { return '1.0-gitUnitTests' } -ParameterFilter { $Service -eq 'Git' } +# Also test in the Assert-MockCalled that the correct version was used in the URL that was +# built for the API call. +function _getApiVersion { + [CmdletBinding(DefaultParameterSetName = 'Service')] + param ( + [parameter(ParameterSetName = 'Service', Mandatory = $true, Position = 0)] + [ValidateSet('Build', 'Release', 'Core', 'Git', 'DistributedTask', 'VariableGroups', 'Tfvc', 'Packaging', 'MemberEntitlementManagement', 'ExtensionsManagement', 'ServiceFabricEndpoint', 'Graph', 'TaskGroups', 'Policy')] + [string] $Service, + + [parameter(ParameterSetName = 'Target')] + [switch] $Target + ) + + if ($Target.IsPresent) { + return [VSTeamVersions]::Version + } + else { + + switch ($Service) { + 'Build' { + return [VSTeamVersions]::Build + } + 'Release' { + return [VSTeamVersions]::Release + } + 'Core' { + return [VSTeamVersions]::Core + } + 'Git' { + return [VSTeamVersions]::Git + } + 'DistributedTask' { + return [VSTeamVersions]::DistributedTask + } + 'VariableGroups' { + return [VSTeamVersions]::VariableGroups + } + 'Tfvc' { + return [VSTeamVersions]::Tfvc + } + 'Packaging' { + return [VSTeamVersions]::Packaging + } + 'MemberEntitlementManagement' { + return [VSTeamVersions]::MemberEntitlementManagement + } + 'ExtensionsManagement' { + return [VSTeamVersions]::ExtensionsManagement + } + 'ServiceFabricEndpoint' { + return [VSTeamVersions]::ServiceFabricEndpoint + } + 'Graph' { + return [VSTeamVersions]::Graph + } + 'TaskGroups' { + return [VSTeamVersions]::TaskGroups + } + 'Policy' { + return [VSTeamVersions]::Policy + } + } + } +} + +function _getInstance { + return [VSTeamVersions]::Account +} + +function _getDefaultProject { + return $Global:PSDefaultParameterValues["*-vsteam*:projectName"] +} +function _hasAccount { + if (-not $(_getInstance)) { + throw 'You must call Set-VSTeamAccount before calling any other functions in this module.' + } +} + +function _buildRequestURI { + [CmdletBinding()] + param( + [string]$team, + [string]$resource, + [string]$area, + [string]$id, + [string]$version, + [string]$subDomain, + [object]$queryString, + [ProjectValidateAttribute()] + $ProjectName, + [switch]$UseProjectId, + [switch]$NoProject + ) + + process { + $sb = New-Object System.Text.StringBuilder + + $sb.Append($(_addSubDomain -subDomain $subDomain -instance $(_getInstance))) | Out-Null + + # There are some APIs that must not have the project added to the URI. + # However, if they caller set the default project it will be passed in + # here and added to the URI by mistake. Functions that need the URI + # created without the project even if the default project is set needs + # to pass the -NoProject switch. + if ($ProjectName -and $NoProject.IsPresent -eq $false) { + if ($UseProjectId.IsPresent) { + $projectId = (Get-VSTeamProject -Name $ProjectName | Select-Object -ExpandProperty id) + $sb.Append("/$projectId") | Out-Null + } + else { + $sb.Append("/$projectName") | Out-Null + } + } + + if ($team) { + $sb.Append("/$team") | Out-Null + } + + $sb.Append("/_apis") | Out-Null + + if ($area) { + $sb.Append("/$area") | Out-Null + } + + if ($resource) { + $sb.Append("/$resource") | Out-Null + } + + if ($id) { + $sb.Append("/$id") | Out-Null + } + + if ($version) { + $sb.Append("?api-version=$version") | Out-Null + } + + $url = $sb.ToString() + + if ($queryString) { + foreach ($key in $queryString.keys) { + $Url += _appendQueryString -name $key -value $queryString[$key] + } + } + + return $url + } +} + +function _handleException { + param( + [Parameter(Position = 1)] + $ex + ) + + $handled = $false + + if ($ex.Exception.PSObject.Properties.Match('Response').count -gt 0 -and + $null -ne $ex.Exception.Response -and + $ex.Exception.Response.StatusCode -ne "BadRequest") { + $handled = $true + $msg = "An error occurred: $($ex.Exception.Message)" + Write-Warning -Message $msg + } + + try { + $e = (ConvertFrom-Json $ex.ToString()) + + $hasValueProp = $e.PSObject.Properties.Match('value') + + if (0 -eq $hasValueProp.count) { + $handled = $true + Write-Warning -Message $e.message + } + else { + $handled = $true + Write-Warning -Message $e.value.message + } + } + catch { + $msg = "An error occurred: $($ex.Exception.Message)" + } + + if (-not $handled) { + throw $ex + } +} + +function _isVSTS { + param( + [parameter(Mandatory = $true)] + [string] $instance + ) + return $instance -like "*.visualstudio.com*" -or $instance -like "https://dev.azure.com/*" +} + +function _getVSTeamAPIVersion { + param( + [parameter(Mandatory = $true)] + [string] $instance, + [string] $Version + ) + + if ($Version) { + return $Version + } + else { + if (_isVSTS $instance) { + return 'VSTS' + } + else { + return 'TFS2017' + } + } +} + +function _isOnWindows { + $os = Get-OperatingSystem + return $os -eq 'Windows' +} + +function _addSubDomain { + param( + [string] $subDomain, + [string] $instance + ) + + # For VSTS Entitlements is under .vsaex + if ($subDomain -and $instance.ToLower().Contains('dev.azure.com')) { + $instance = $instance.ToLower().Replace('dev.azure.com', "$subDomain.dev.azure.com") + } + + return $instance +} + +function _appendQueryString { + param( + $name, + $value, + # When provided =0 will be outputed otherwise zeros will not be + # added. I had to add this for the userentitlements that is the only + # VSTS API I have found that requires Top and Skip to be passed in. + [Switch]$retainZero + ) + + if ($retainZero.IsPresent) { + if ($null -ne $value) { + return "&$name=$value" + } + } + else { + if ($value) { + return "&$name=$value" + } + } +} + +function _getUserAgent { + [CmdletBinding()] + param() + + $os = Get-OperatingSystem + + $result = "Team Module/$([VSTeamVersions]::ModuleVersion) ($os) PowerShell/$($PSVersionTable.PSVersion.ToString())" + + Write-Verbose $result + + return $result +} + +function _useWindowsAuthenticationOnPremise { + return (_isOnWindows) -and (!$env:TEAM_PAT) -and -not ($(_getInstance) -like "*visualstudio.com") -and -not ($(_getInstance) -like "https://dev.azure.com/*") +} + +function _useBearerToken { + return (!$env:TEAM_PAT) -and ($env:TEAM_TOKEN) +} + +function _getWorkItemTypes { + param( + [Parameter(Mandatory = $true)] + [string] $ProjectName + ) + + if (-not $(_getInstance)) { + Write-Output @() + return + } + + # Call the REST API + try { + $resp = _callAPI -ProjectName $ProjectName -area 'wit' -resource 'workitemtypes' -version $(_getApiVersion Core) + + # This call returns JSON with "": which causes the ConvertFrom-Json to fail. + # To replace all the "": with "_end": + $resp = $resp.Replace('"":', '"_end":') | ConvertFrom-Json + + if ($resp.count -gt 0) { + Write-Output ($resp.value).name + } + } + catch { + Write-Verbose $_ + Write-Output @() + } +} + +# When writing unit tests mock this and return false. +# This will prevent the dynamic project name parameter +# from trying to call the getProject function. +# Mock _hasProjectCacheExpired { return $false } +function _hasProjectCacheExpired { + return $([VSTeamProjectCache]::timestamp) -ne (Get-Date).Minute +} + +function _hasProcessTemplateCacheExpired { + return $([VSTeamProcessCache]::timestamp) -ne (Get-Date).Minute +} + +function _getProjects { + if (-not $(_getInstance)) { + Write-Output @() + return + } + + $resource = "/projects" + $instance = $(_getInstance) + $version = $(_getApiVersion Core) + + # Build the url to list the projects + # You CANNOT use _buildRequestURI here or you will end up + # in an infinite loop. + $listurl = $instance + '/_apis' + $resource + '?api-version=' + $version + '&stateFilter=All&$top=9999' + + # Call the REST API + try { + $resp = _callAPI -url $listurl + + if ($resp.count -gt 0) { + Write-Output ($resp.value).name + } + } + catch { + Write-Output @() + } +} + +function _buildProjectNameDynamicParam { + param( + [string] $ParameterName = 'ProjectName', + [string] $ParameterSetName, + [bool] $Mandatory = $true, + [string] $AliasName, + [int] $Position = 0 + ) + + # Create the dictionary + $RuntimeParameterDictionary = New-Object System.Management.Automation.RuntimeDefinedParameterDictionary + + # Create the collection of attributes + $AttributeCollection = New-Object System.Collections.ObjectModel.Collection[System.Attribute] + + # Create and set the parameters' attributes + $ParameterAttribute = New-Object System.Management.Automation.ParameterAttribute + $ParameterAttribute.Mandatory = $Mandatory + $ParameterAttribute.Position = $Position + + if ($ParameterSetName) { + $ParameterAttribute.ParameterSetName = $ParameterSetName + } + + $ParameterAttribute.ValueFromPipelineByPropertyName = $true + $ParameterAttribute.HelpMessage = "The name of the project. You can tab complete from the projects in your Team Services or TFS account when passed on the command line." + + # Add the attributes to the attributes collection + $AttributeCollection.Add($ParameterAttribute) + + if ($AliasName) { + $AliasAttribute = New-Object System.Management.Automation.AliasAttribute(@($AliasName)) + $AttributeCollection.Add($AliasAttribute) + } + + # Generate and set the ValidateSet + if (_hasProjectCacheExpired) { + $arrSet = _getProjects + [VSTeamProjectCache]::projects = $arrSet + [VSTeamProjectCache]::timestamp = (Get-Date).Minute + } + else { + $arrSet = [VSTeamProjectCache]::projects + } + + if ($arrSet) { + Write-Verbose "arrSet = $arrSet" + + $ValidateSetAttribute = New-Object System.Management.Automation.ValidateSetAttribute($arrSet) + + # Add the ValidateSet to the attributes collection + $AttributeCollection.Add($ValidateSetAttribute) + } + + # Create and return the dynamic parameter + $RuntimeParameter = New-Object System.Management.Automation.RuntimeDefinedParameter($ParameterName, [string], $AttributeCollection) + $RuntimeParameterDictionary.Add($ParameterName, $RuntimeParameter) + return $RuntimeParameterDictionary + + <# + Builds a dynamic parameter that can be used to tab complete the ProjectName + parameter of functions from a list of projects from the added TFS Account. + You must call Set-VSTeamAccount before trying to use any function that relies + on this dynamic parameter or you will get an error. + + This can only be used in Advanced Fucntion with the [CmdletBinding()] attribute. + The function must also have a begin block that maps the value to a common variable + like this. + + DynamicParam { + # Generate and set the ValidateSet + $arrSet = Get-VSTeamProjects | Select-Object -ExpandProperty Name + + _buildProjectNameDynamicParam -arrSet $arrSet + } + + process { + # Bind the parameter to a friendly variable + $ProjectName = $PSBoundParameters[$ParameterName] + } + #> +} + +function _getProcesses { + if (-not $(_getInstance)) { + Write-Output @() + return + } + + # Call the REST API + try { + $query = @{ } + $query['stateFilter'] = 'All' + $query['$top'] = '9999' + $resp = _callAPI -area 'process' -resource 'processes' -Version $(_getApiVersion Core) -QueryString $query -NoProject + + if ($resp.count -gt 0) { + Write-Output ($resp.value).name + } + } + catch { + Write-Output @() + } +} +function _buildProcessNameDynamicParam { + param( + [string] $ParameterName = 'ProcessName', + [string] $ParameterSetName, + [bool] $Mandatory = $true, + [string] $AliasName, + [int] $Position = 0 + ) + + # Create the dictionary + $RuntimeParameterDictionary = New-Object System.Management.Automation.RuntimeDefinedParameterDictionary + + # Create the collection of attributes + $AttributeCollection = New-Object System.Collections.ObjectModel.Collection[System.Attribute] + + # Create and set the parameters' attributes + $ParameterAttribute = New-Object System.Management.Automation.ParameterAttribute + $ParameterAttribute.Mandatory = $Mandatory + $ParameterAttribute.Position = $Position + + if ($ParameterSetName) { + $ParameterAttribute.ParameterSetName = $ParameterSetName + } + + $ParameterAttribute.ValueFromPipelineByPropertyName = $true + $ParameterAttribute.HelpMessage = "The name of the process. You can tab complete from the processes in your Team Services or TFS account when passed on the command line." + + # Add the attributes to the attributes collection + $AttributeCollection.Add($ParameterAttribute) + + if ($AliasName) { + $AliasAttribute = New-Object System.Management.Automation.AliasAttribute(@($AliasName)) + $AttributeCollection.Add($AliasAttribute) + } + + # Generate and set the ValidateSet + if ($([VSTeamProcessCache]::timestamp) -ne (Get-Date).Minute) { + $arrSet = _getProcesses + [VSTeamProcessCache]::processes = $arrSet + [VSTeamProcessCache]::timestamp = (Get-Date).Minute + } + else { + $arrSet = [VSTeamProcessCache]::processes + } + + if ($arrSet) { + Write-Verbose "arrSet = $arrSet" + + $ValidateSetAttribute = New-Object System.Management.Automation.ValidateSetAttribute($arrSet) + + # Add the ValidateSet to the attributes collection + $AttributeCollection.Add($ValidateSetAttribute) + } + + # Create and return the dynamic parameter + $RuntimeParameter = New-Object System.Management.Automation.RuntimeDefinedParameter($ParameterName, [string], $AttributeCollection) + $RuntimeParameterDictionary.Add($ParameterName, $RuntimeParameter) + return $RuntimeParameterDictionary + + <# + Builds a dynamic parameter that can be used to tab complete the ProjectName + parameter of functions from a list of projects from the added TFS Account. + You must call Set-VSTeamAccount before trying to use any function that relies + on this dynamic parameter or you will get an error. + + This can only be used in Advanced Fucntion with the [CmdletBinding()] attribute. + The function must also have a begin block that maps the value to a common variable + like this. + + DynamicParam { + # Generate and set the ValidateSet + $arrSet = Get-VSTeamProjects | Select-Object -ExpandProperty Name + + _buildProjectNameDynamicParam -arrSet $arrSet + } + process { + # Bind the parameter to a friendly variable + $ProjectName = $PSBoundParameters[$ParameterName] + } + #> +} +function _buildDynamicParam { + param( + [string] $ParameterName = 'QueueName', + [array] $arrSet, + [bool] $Mandatory = $false, + [string] $ParameterSetName, + [int] $Position = -1, + [type] $ParameterType = [string], + [bool] $ValueFromPipelineByPropertyName = $true, + [string] $AliasName, + [string] $HelpMessage + ) + # Create the collection of attributes + $AttributeCollection = New-Object System.Collections.ObjectModel.Collection[System.Attribute] + <# +.SYNOPSIS +Short description + +.DESCRIPTION +Long description + +.PARAMETER ParameterName +Parameter description + +.PARAMETER ParameterSetName +Parameter description + +.PARAMETER Mandatory +Parameter description + +.PARAMETER AliasName +Parameter description + +.PARAMETER Position +Parameter description + +.EXAMPLE +An example + +.NOTES +General notes +#> + # Create and set the parameters' attributes + $ParameterAttribute = New-Object System.Management.Automation.ParameterAttribute + $ParameterAttribute.Mandatory = $Mandatory + $ParameterAttribute.ValueFromPipelineByPropertyName = $ValueFromPipelineByPropertyName + + if ($Position -ne -1) { + $ParameterAttribute.Position = $Position + } + + if ($ParameterSetName) { + $ParameterAttribute.ParameterSetName = $ParameterSetName + } + + if ($HelpMessage) { + $ParameterAttribute.HelpMessage = $HelpMessage + } + + # Add the attributes to the attributes collection + $AttributeCollection.Add($ParameterAttribute) + + if ($AliasName) { + $AliasAttribute = New-Object System.Management.Automation.AliasAttribute(@($AliasName)) + $AttributeCollection.Add($AliasAttribute) + } + + if ($arrSet) { + # Generate and set the ValidateSet + $ValidateSetAttribute = New-Object System.Management.Automation.ValidateSetAttribute($arrSet) + + # Add the ValidateSet to the attributes collection + $AttributeCollection.Add($ValidateSetAttribute) + } + + # Create and return the dynamic parameter + return New-Object System.Management.Automation.RuntimeDefinedParameter($ParameterName, $ParameterType, $AttributeCollection) +} + +function _convertSecureStringTo_PlainText { + [CmdletBinding()] + param( + [parameter(ParameterSetName = 'Secure', Mandatory = $true, HelpMessage = 'Secure String')] + [securestring] $SecureString + ) + + # Convert the securestring to a normal string + # this was the one technique that worked on Mac, Linux and Windows + $credential = New-Object System.Management.Automation.PSCredential 'unknown', $SecureString + return $credential.GetNetworkCredential().Password +} + +function _trackProjectProgress { + param( + [Parameter(Mandatory = $true)] $Resp, + [string] $Title, + [string] $Msg + ) + + $i = 0 + $x = 1 + $y = 10 + $status = $resp.status + + # Track status + while ($status -ne 'failed' -and $status -ne 'succeeded') { + $status = (_callAPI -Url $resp.url).status + + # oscillate back a forth to show progress + $i += $x + Write-Progress -Activity $title -Status $msg -PercentComplete ($i / $y * 100) + + if ($i -eq $y -or $i -eq 0) { + $x *= -1 + } + } +} + +$iTracking = 0 +$xTracking = 1 +$yTracking = 10 +$statusTracking = $null + +function _trackServiceEndpointProgress { + param( + [Parameter(Mandatory = $true)] + [string] $projectName, + + [Parameter(Mandatory = $true)] + $resp, + + [string] $title, + + [string] $msg + ) + + $iTracking = 0 + $xTracking = 1 + $yTracking = 10 + + $isReady = $false + + # Track status + while (-not $isReady) { + $statusTracking = _callAPI -ProjectName $projectName -Area 'distributedtask' -Resource 'serviceendpoints' -Id $resp.id ` + -Version $(_getApiVersion DistributedTask) + + $isReady = $statusTracking.isReady; + + if (-not $isReady) { + $state = $statusTracking.operationStatus.state + + if ($state -eq "Failed") { + throw $statusTracking.operationStatus.statusMessage + } + } + + # oscillate back a forth to show progress + $iTracking += $xTracking + Write-Progress -Activity $title -Status $msg -PercentComplete ($iTracking / $yTracking * 100) + + if ($iTracking -eq $yTracking -or $iTracking -eq 0) { + $xTracking *= -1 + } + } +} + +function _supportsServiceFabricEndpoint { + if (-not $(_getApiVersion ServiceFabricEndpoint)) { + throw 'This account does not support Service Fabric endpoints.' + } +} + +function _getModuleVersion { + # Read the version from the psd1 file. + # $content = (Get-Content -Raw "./VSTeam.psd1" | Out-String) + $content = (Get-Content -Raw "$here\VSTeam.psd1" | Out-String) + $r = [regex]"ModuleVersion += +'([^']+)'" + $d = $r.Match($content) + + return $d.Groups[1].Value +} + +function _setEnvironmentVariables { + [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseDeclaredVarsMoreThanAssignments", "")] + param ( + [string] $Level = "Process", + [string] $Pat, + [string] $Acct, + [string] $BearerToken, + [string] $Version + ) + + # You always have to set at the process level or they will Not + # be seen in your current session. + $env:TEAM_PAT = $Pat + $env:TEAM_ACCT = $Acct + $env:TEAM_VERSION = $Version + $env:TEAM_TOKEN = $BearerToken + + [VSTeamVersions]::Account = $Acct + + # This is so it can be loaded by default in the next session + if ($Level -ne "Process") { + [System.Environment]::SetEnvironmentVariable("TEAM_PAT", $Pat, $Level) + [System.Environment]::SetEnvironmentVariable("TEAM_ACCT", $Acct, $Level) + [System.Environment]::SetEnvironmentVariable("TEAM_VERSION", $Version, $Level) + } +} + +# If you remove an account the current default project needs to be cleared as well. +function _clearEnvironmentVariables { + [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseDeclaredVarsMoreThanAssignments", "")] + param ( + [string] $Level = "Process" + ) + + $env:TEAM_PROJECT = $null + [VSTeamVersions]::DefaultProject = '' + $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") + + # This is so it can be loaded by default in the next session + if ($Level -ne "Process") { + [System.Environment]::SetEnvironmentVariable("TEAM_PROJECT", $null, $Level) + } + + _setEnvironmentVariables -Level $Level -Pat '' -Acct '' -UseBearerToken '' -Version '' +} + +function _convertToHex() { + [cmdletbinding()] + param( + [parameter(Mandatory = $true)] + [string]$Value + ) + + $bytes = $Value | Format-Hex -Encoding Unicode + $hexString = ($bytes.Bytes | ForEach-Object ToString X2) -join '' + return $hexString.ToLowerInvariant(); +} + +function _getVSTeamIdFromDescriptor { + [cmdletbinding()] + param( + [parameter(Mandatory = $true)] + [string]$Descriptor + ) + + $identifier = $Descriptor.Split('.')[1] + + # We need to Pad the string for FromBase64String to work reliably (AzD Descriptors are not padded) + $ModulusValue = ($identifier.length % 4) + Switch ($ModulusValue) { + '0' { $Padded = $identifier } + '1' { $Padded = $identifier.Substring(0, $identifier.Length - 1) } + '2' { $Padded = $identifier + ('=' * (4 - $ModulusValue)) } + '3' { $Padded = $identifier + ('=' * (4 - $ModulusValue)) } + } + + return [System.Text.Encoding]::ASCII.GetString([System.Convert]::FromBase64String($Padded)) +} + +function _getDescriptorForACL { + [cmdletbinding()] + param( + [parameter(Mandatory = $true, ParameterSetName = "ByUser")] + [VSTeamUser]$User, + + [parameter(MAndatory = $true, ParameterSetName = "ByGroup")] + [VSTeamGroup]$Group + ) + + if ($User) { + switch ($User.Origin) { + "vsts" { + $sid = _getVSTeamIdFromDescriptor -Descriptor $User.Descriptor + $descriptor = "Microsoft.TeamFoundation.Identity;$sid" + } + "aad" { + $descriptor = "Microsoft.IdentityModel.Claims.ClaimsIdentity;$($User.Domain)\\$($User.PrincipalName)" + } + default { throw "User type not handled yet for ACL. Please report this as an issue on the VSTeam Repository: https://github.com/DarqueWarrior/vsteam/issues" } + } + } + + if ($Group) { + switch ($Group.Origin) { + "vsts" { + $sid = _getVSTeamIdFromDescriptor -Descriptor $Group.Descriptor + $descriptor = "Microsoft.TeamFoundation.Identity;$sid" + } + default { throw "Group type not handled yet for Add-VSTeamGitRepositoryPermission. Please report this as an issue on the VSTeam Repository: https://github.com/DarqueWarrior/vsteam/issues" } + } + } + + return $descriptor +} diff --git a/Source/Public/Add-VSTeam.ps1 b/Source/Public/Add-VSTeam.ps1 index 4cc88abe9..467e334b2 100644 --- a/Source/Public/Add-VSTeam.ps1 +++ b/Source/Public/Add-VSTeam.ps1 @@ -1,28 +1,26 @@ -function Add-VSTeam { - [CmdletBinding()] - param( - [Parameter(Mandatory = $true, Position = 1)] - [Alias('TeamName')] - [string]$Name, - - [string]$Description = '' - ) - DynamicParam { - _buildProjectNameDynamicParam - } - - process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - - $body = '{ "name": "' + $Name + '", "description": "' + $Description + '" }' - - # Call the REST API - $resp = _callAPI -Area 'projects' -Resource "$ProjectName/teams" -NoProject ` - -Method Post -ContentType 'application/json' -Body $body -Version $(_getApiVersion Core) - - $team = [VSTeamTeam]::new($resp, $ProjectName) - - Write-Output $team - } -} \ No newline at end of file +function Add-VSTeam { + [CmdletBinding()] + param( + [Parameter(Mandatory = $true, Position = 1)] + [Alias('TeamName')] + [string] $Name, + + [string] $Description = '', + + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [string] $ProjectName + ) + process { + $body = '{ "name": "' + $Name + '", "description": "' + $Description + '" }' + + # Call the REST API + $resp = _callAPI -Area 'projects' -Resource "$ProjectName/teams" -NoProject ` + -Method Post -ContentType 'application/json' -Body $body -Version $(_getApiVersion Core) + + $team = [VSTeamTeam]::new($resp, $ProjectName) + + Write-Output $team + } +} diff --git a/Source/Public/Add-VSTeamAzureRMServiceEndpoint.ps1 b/Source/Public/Add-VSTeamAzureRMServiceEndpoint.ps1 index 26c14cf7b..50706a29e 100644 --- a/Source/Public/Add-VSTeamAzureRMServiceEndpoint.ps1 +++ b/Source/Public/Add-VSTeamAzureRMServiceEndpoint.ps1 @@ -4,7 +4,7 @@ function Add-VSTeamAzureRMServiceEndpoint { [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [Alias('displayName')] [string] $subscriptionName, - + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [string] $subscriptionId, @@ -17,17 +17,14 @@ function Add-VSTeamAzureRMServiceEndpoint { [Parameter(ParameterSetName = 'Manual', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [string] $servicePrincipalKey, - [string] $endpointName - ) - - DynamicParam { - _buildProjectNameDynamicParam - } - - Process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] + [string] $endpointName, + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [string] $ProjectName + ) + process { if (-not $endpointName) { $endpointName = $subscriptionName } diff --git a/Source/Public/Add-VSTeamBuild.ps1 b/Source/Public/Add-VSTeamBuild.ps1 index 428456b6c..cf1716841 100644 --- a/Source/Public/Add-VSTeamBuild.ps1 +++ b/Source/Public/Add-VSTeamBuild.ps1 @@ -1,98 +1,73 @@ -function Add-VSTeamBuild { - [CmdletBinding(DefaultParameterSetName = 'ByName')] - param( - [Parameter(ParameterSetName = 'ByID', ValueFromPipelineByPropertyName = $true)] - [Int32] $BuildDefinitionId, - - [Parameter(Mandatory = $false)] - [string] $SourceBranch, - - [Parameter(Mandatory = $false)] - [hashtable] $BuildParameters - ) - DynamicParam { - $dp = _buildProjectNameDynamicParam - - # If they have not set the default project you can't find the - # validateset so skip that check. However, we still need to give - # the option to pass a QueueName to use. - $queues = $null - $queueArrSet = $null - - if ($Global:PSDefaultParameterValues["*:projectName"]) { - $queues = Get-VSTeamQueue -ProjectName $Global:PSDefaultParameterValues["*:projectName"] - $queueArrSet = $queues.name - } - else { - Write-Verbose 'Call Set-VSTeamDefaultProject for Tab Complete of QueueName' - } - - $ParameterName = 'QueueName' - $rp = _buildDynamicParam -ParameterName $ParameterName -arrSet $queueArrSet - $dp.Add($ParameterName, $rp) - - $buildDefs = $null - $buildDefsArrSet = $null - - if ($Global:PSDefaultParameterValues["*:projectName"]) { - $buildDefs = Get-VSTeamBuildDefinition -ProjectName $Global:PSDefaultParameterValues["*:projectName"] - $buildDefsArrSet = $buildDefs.name - } - else { - Write-Verbose 'Call Set-VSTeamDefaultProject for Tab Complete of BuildDefinition' - } - - $ParameterName = 'BuildDefinitionName' - $rp = _buildDynamicParam -ParameterName $ParameterName -arrSet $buildDefsArrSet -ParameterSetName 'ByName' - $dp.Add($ParameterName, $rp) - - $dp - } - - process { - # Bind the parameter to a friendly variable - $QueueName = $PSBoundParameters["QueueName"] - $ProjectName = $PSBoundParameters["ProjectName"] - $BuildDefinition = $PSBoundParameters["BuildDefinitionName"] - - if ($BuildDefinitionId) { - $id = $BuildDefinitionId - } - else { - # Find the BuildDefinition id from the name - $id = Get-VSTeamBuildDefinition -ProjectName "$ProjectName" -Type All | - Where-Object { $_.name -eq $BuildDefinition } | - Select-Object -ExpandProperty id - } - - $body = @{ - definition = @{ - id = $id - }; - } - - if ($QueueName) { - $queueId = Get-VSTeamQueue -ProjectName "$ProjectName" -queueName "$QueueName" | - Select-Object -ExpandProperty Id - - $body.Add('queue', @{ id = $queueId }) - } - - if ($SourceBranch) { - $body.Add('sourceBranch', $SourceBranch) - } - - if ($BuildParameters) { - $body.Add('parameters', ($BuildParameters | ConvertTo-Json -Compress)) - } - - # Call the REST API - $resp = _callAPI -ProjectName $ProjectName -Area 'build' -Resource 'builds' ` - -Method Post -ContentType 'application/json' -Body ($body | ConvertTo-Json) ` - -Version $(_getApiVersion Build) - - _applyTypesToBuild -item $resp - - return $resp - } -} \ No newline at end of file +function Add-VSTeamBuild { + [CmdletBinding(DefaultParameterSetName = 'ByName')] + param( + [Parameter(ParameterSetName = 'ByID', ValueFromPipelineByPropertyName = $true)] + [Int32] $BuildDefinitionId, + + [Parameter(Mandatory = $false)] + [string] $SourceBranch, + + [Parameter(Mandatory = $false)] + [hashtable] $BuildParameters, + + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [string] $ProjectName, + + [ArgumentCompleter([TeamQueueCompleter])] + [string] $QueueName, + + [ArgumentCompleter([BuildDefinitionCompleter])] + [string] $BuildDefinitionName + ) + begin { + if ($BuildDefinitionId) { + $body = @{ + definition = @{ + id = $BuildDefinitionId + }; + } + } + elseif ($BuildDefinitionName) { + # Find the BuildDefinition id from the name + $id = (Get-VSTeamBuildDefinition -ProjectName "$ProjectName" -Filter $BuildDefinitionName -Type All).id + if (-not $id) { + throw "'$BuildDefinitionName' is not a valid build definition. Use Get-VSTeamBuildDefinition to get a list of build names" ; return + } + $body = @{ + definition = @{ + id = $id + }; + } + } + else { throw "'No build definition was given. Use Get-VSTeamBuildDefinition to get a list of builds" ; return } + + if ($QueueName) { + $queueId = (Get-VSTeamQueue -ProjectName "$ProjectName" -queueName "$QueueName").id + if (-not ($env:Testing -or $queueId)) { + throw "'$QueueName' is not a valid Queue. Use Get-VSTeamQueue to get a list of queues" ; return + } + else { $body["queue"] = @{id = $queueId } } + } + } + + process { + if ($SourceBranch) { + $body.Add('sourceBranch', $SourceBranch) + } + + if ($BuildParameters) { + $body.Add('parameters', ($BuildParameters | ConvertTo-Json -Compress)) + } + + # Call the REST API + $resp = _callAPI -ProjectName $ProjectName -Area 'build' -Resource 'builds' ` + -Method Post -ContentType 'application/json' -Body ($body | ConvertTo-Json) ` + -Version $(_getApiVersion Build) + + _applyTypesToBuild -item $resp + + return $resp + } +} diff --git a/Source/Public/Add-VSTeamBuildDefinition.ps1 b/Source/Public/Add-VSTeamBuildDefinition.ps1 index 7d6557153..1a234bec0 100644 --- a/Source/Public/Add-VSTeamBuildDefinition.ps1 +++ b/Source/Public/Add-VSTeamBuildDefinition.ps1 @@ -1,20 +1,16 @@ -function Add-VSTeamBuildDefinition { - [CmdletBinding()] - param( - [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [string] $InFile - ) - - DynamicParam { - _buildProjectNameDynamicParam - } - - process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - - $resp = _callAPI -Method Post -ProjectName $ProjectName -Area build -Resource definitions -Version $(_getApiVersion Build) -infile $InFile -ContentType 'application/json' - - return $resp - } -} \ No newline at end of file +function Add-VSTeamBuildDefinition { + [CmdletBinding()] + param( + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [string] $InFile, + + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [string] $ProjectName + ) + + process { + return _callAPI -Method Post -ProjectName $ProjectName -Area build -Resource definitions -Version $(_getApiVersion Build) -infile $InFile -ContentType 'application/json' + } +} diff --git a/Source/Public/Add-VSTeamBuildTag.ps1 b/Source/Public/Add-VSTeamBuildTag.ps1 index 2dde4817f..c0b16cfb3 100644 --- a/Source/Public/Add-VSTeamBuildTag.ps1 +++ b/Source/Public/Add-VSTeamBuildTag.ps1 @@ -1,31 +1,29 @@ -function Add-VSTeamBuildTag { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] - param( - [parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Position = 0)] - [string[]] $Tags, - - [parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [Alias('BuildID')] - [int[]] $Id, - - [switch] $Force - ) - - DynamicParam { - _buildProjectNameDynamicParam - } - - Process { - $ProjectName = $PSBoundParameters["ProjectName"] - - foreach ($item in $id) { - if ($Force -or $pscmdlet.ShouldProcess($item, "Add-VSTeamBuildTag")) { - foreach ($tag in $tags) { - # Call the REST API - _callAPI -ProjectName $projectName -Area 'build' -Resource "builds/$Id/tags" ` - -Method Put -Querystring @{tag = $tag} -Version $(_getApiVersion Build) | Out-Null - } - } - } - } -} \ No newline at end of file +function Add-VSTeamBuildTag { + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] + param( + [parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Position = 0)] + [string[]] $Tags, + + [parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [Alias('BuildID')] + [int[]] $Id, + + [switch] $Force, + + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [string] $ProjectName + ) + process { + foreach ($item in $id) { + if ($Force -or $pscmdlet.ShouldProcess($item, "Add-VSTeamBuildTag")) { + foreach ($tag in $tags) { + # Call the REST API + _callAPI -ProjectName $projectName -Area 'build' -Resource "builds/$Id/tags" ` + -Method Put -Querystring @{tag = $tag } -Version $(_getApiVersion Build) | Out-Null + } + } + } + } +} diff --git a/Source/Public/Add-VSTeamFeed.ps1 b/Source/Public/Add-VSTeamFeed.ps1 index 227f751cb..7096c2870 100644 --- a/Source/Public/Add-VSTeamFeed.ps1 +++ b/Source/Public/Add-VSTeamFeed.ps1 @@ -1,57 +1,57 @@ -function Add-VSTeamFeed { - [CmdletBinding()] - param ( - [Parameter(Position = 0, Mandatory = $true)] - [string] $Name, - - [Parameter(Position = 1)] - [string] $Description, - - [switch] $EnableUpstreamSources, - - [switch] $showDeletedPackageVersions - ) - - process { - # Thi swill throw if this account does not support feeds - _supportsFeeds - - $body = @{ - name = $Name - description = $Description - hideDeletedPackageVersions = $true - } - - if ($showDeletedPackageVersions.IsPresent) { - $body.hideDeletedPackageVersions = $false - } - - if ($EnableUpstreamSources.IsPresent) { - $body.upstreamEnabled = $true - $body.upstreamSources = @( - @{ - id = [System.Guid]::NewGuid() - name = 'npmjs' - protocol = 'npm' - location = 'https://registry.npmjs.org/' - upstreamSourceType = 1 - }, - @{ - id = [System.Guid]::NewGuid() - name = 'nuget.org' - protocol = 'nuget' - location = 'https://api.nuget.org/v3/index.json' - upstreamSourceType = 1 - } - ) - } - - $bodyAsJson = $body | ConvertTo-Json - - # Call the REST API - $resp = _callAPI -subDomain feeds -Area packaging -Resource feeds ` - -Method Post -ContentType 'application/json' -body $bodyAsJson -Version $(_getApiVersion Packaging) - - return [VSTeamFeed]::new($resp) - } +function Add-VSTeamFeed { + [CmdletBinding()] + param ( + [Parameter(Position = 0, Mandatory = $true)] + [string] $Name, + + [Parameter(Position = 1)] + [string] $Description, + + [switch] $EnableUpstreamSources, + + [switch] $showDeletedPackageVersions + ) + + process { + # This will throw if this account does not support feeds + _supportsFeeds + + $body = @{ + name = $Name + description = $Description + hideDeletedPackageVersions = $true + } + + if ($showDeletedPackageVersions.IsPresent) { + $body.hideDeletedPackageVersions = $false + } + + if ($EnableUpstreamSources.IsPresent) { + $body.upstreamEnabled = $true + $body.upstreamSources = @( + @{ + id = [System.Guid]::NewGuid() + name = 'npmjs' + protocol = 'npm' + location = 'https://registry.npmjs.org/' + upstreamSourceType = 1 + }, + @{ + id = [System.Guid]::NewGuid() + name = 'nuget.org' + protocol = 'nuget' + location = 'https://api.nuget.org/v3/index.json' + upstreamSourceType = 1 + } + ) + } + + $bodyAsJson = $body | ConvertTo-Json + + # Call the REST API + $resp = _callAPI -subDomain feeds -Area packaging -Resource feeds ` + -Method Post -ContentType 'application/json' -body $bodyAsJson -Version $(_getApiVersion Packaging) + + return [VSTeamFeed]::new($resp) + } } \ No newline at end of file diff --git a/Source/Public/Add-VSTeamGitRepository.ps1 b/Source/Public/Add-VSTeamGitRepository.ps1 index 174fc0c91..9cdfd4c2b 100644 --- a/Source/Public/Add-VSTeamGitRepository.ps1 +++ b/Source/Public/Add-VSTeamGitRepository.ps1 @@ -1,33 +1,31 @@ -function Add-VSTeamGitRepository { - [CmdletBinding()] - param( - [parameter(Mandatory = $true)] - [string] $Name - ) - - DynamicParam { - _buildProjectNameDynamicParam - } - - process { - $ProjectName = $PSBoundParameters["ProjectName"] - - $body = '{"name": "' + $Name + '"}' - - try { - # Call the REST API - $resp = _callAPI -ProjectName $ProjectName -Area 'git' -Resource 'repositories' ` - -Method Post -ContentType 'application/json' -Body $body -Version $(_getApiVersion Git) - - # Storing the object before you return it cleaned up the pipeline. - # When I just write the object from the constructor each property - # seemed to be written - $repo = [VSTeamGitRepository]::new($resp, $ProjectName) - - Write-Output $repo - } - catch { - _handleException $_ - } - } -} \ No newline at end of file +function Add-VSTeamGitRepository { + [CmdletBinding()] + param( + [parameter(Mandatory = $true)] + [string] $Name, + + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [string] $ProjectName + ) + process { + $body = '{"name": "' + $Name + '"}' + + try { + # Call the REST API + $resp = _callAPI -ProjectName $ProjectName -Area 'git' -Resource 'repositories' ` + -Method Post -ContentType 'application/json' -Body $body -Version $(_getApiVersion Git) + + # Storing the object before you return it cleaned up the pipeline. + # When I just write the object from the constructor each property + # seemed to be written + $repo = [VSTeamGitRepository]::new($resp, $ProjectName) + + Write-Output $repo + } + catch { + _handleException $_ + } + } +} diff --git a/Source/Public/Add-VSTeamGitRepositoryPermission.ps1 b/Source/Public/Add-VSTeamGitRepositoryPermission.ps1 index 498229350..b47ba3c34 100644 --- a/Source/Public/Add-VSTeamGitRepositoryPermission.ps1 +++ b/Source/Public/Add-VSTeamGitRepositoryPermission.ps1 @@ -1,70 +1,70 @@ function Add-VSTeamGitRepositoryPermission { [CmdletBinding(DefaultParameterSetName = 'ByProjectAndUser')] param( - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndDescriptor")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndGroup")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndUser")] - [parameter(Mandatory=$true,ParameterSetName="ByRepositoryIdAndGroup")] - [parameter(Mandatory=$true,ParameterSetName="ByRepositoryIdAndUser")] - [parameter(Mandatory=$true,ParameterSetName="ByRepositoryNameAndGroup")] - [parameter(Mandatory=$true,ParameterSetName="ByRepositoryNameAndUser")] - [parameter(Mandatory=$true,ParameterSetName="ByRepositoryIdAndDescriptor")] - [parameter(Mandatory=$true,ParameterSetName="ByRepositoryNameAndDescriptor")] + [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndDescriptor")] + [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndGroup")] + [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndUser")] + [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryIdAndGroup")] + [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryIdAndUser")] + [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryNameAndGroup")] + [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryNameAndUser")] + [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryIdAndDescriptor")] + [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryNameAndDescriptor")] [VSTeamProject]$Project, - [parameter(Mandatory=$true,ParameterSetName="ByRepositoryIdAndGroup")] - [parameter(Mandatory=$true,ParameterSetName="ByRepositoryIdAndUser")] - [parameter(Mandatory=$true,ParameterSetName="ByRepositoryIdAndDescriptor")] + [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryIdAndGroup")] + [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryIdAndUser")] + [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryIdAndDescriptor")] [guid]$RepositoryId, - [parameter(Mandatory=$true,ParameterSetName="ByRepositoryNameAndGroup")] - [parameter(Mandatory=$true,ParameterSetName="ByRepositoryNameAndUser")] - [parameter(Mandatory=$true,ParameterSetName="ByRepositoryNameAndDescriptor")] + [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryNameAndGroup")] + [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryNameAndUser")] + [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryNameAndDescriptor")] [string]$RepositoryName, - [parameter(Mandatory=$false,ParameterSetName="ByRepositoryIdAndGroup")] - [parameter(Mandatory=$false,ParameterSetName="ByRepositoryIdAndUser")] - [parameter(Mandatory=$false,ParameterSetName="ByRepositoryNameAndGroup")] - [parameter(Mandatory=$false,ParameterSetName="ByRepositoryNameAndUser")] - [parameter(Mandatory=$false,ParameterSetName="ByRepositoryIdAndDescriptor")] - [parameter(Mandatory=$false,ParameterSetName="ByRepositoryNameAndDescriptor")] + [parameter(Mandatory = $false, ParameterSetName = "ByRepositoryIdAndGroup")] + [parameter(Mandatory = $false, ParameterSetName = "ByRepositoryIdAndUser")] + [parameter(Mandatory = $false, ParameterSetName = "ByRepositoryNameAndGroup")] + [parameter(Mandatory = $false, ParameterSetName = "ByRepositoryNameAndUser")] + [parameter(Mandatory = $false, ParameterSetName = "ByRepositoryIdAndDescriptor")] + [parameter(Mandatory = $false, ParameterSetName = "ByRepositoryNameAndDescriptor")] [string]$BranchName, - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndDescriptor")] - [parameter(Mandatory=$true,ParameterSetName="ByRepositoryIdAndDescriptor")] - [parameter(Mandatory=$true,ParameterSetName="ByRepositoryNameAndDescriptor")] + [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndDescriptor")] + [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryIdAndDescriptor")] + [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryNameAndDescriptor")] [string]$Descriptor, - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndGroup")] - [parameter(Mandatory=$true,ParameterSetName="ByRepositoryIdAndGroup")] - [parameter(Mandatory=$true,ParameterSetName="ByRepositoryNameAndGroup")] + [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndGroup")] + [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryIdAndGroup")] + [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryNameAndGroup")] [VSTeamGroup]$Group, - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndUser")] - [parameter(Mandatory=$true,ParameterSetName="ByRepositoryIdAndUser")] - [parameter(Mandatory=$true,ParameterSetName="ByRepositoryNameAndUser")] + [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndUser")] + [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryIdAndUser")] + [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryNameAndUser")] [VSTeamUser]$User, - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndDescriptor")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndGroup")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndUser")] - [parameter(Mandatory=$true,ParameterSetName="ByRepositoryIdAndGroup")] - [parameter(Mandatory=$true,ParameterSetName="ByRepositoryIdAndUser")] - [parameter(Mandatory=$true,ParameterSetName="ByRepositoryNameAndGroup")] - [parameter(Mandatory=$true,ParameterSetName="ByRepositoryNameAndUser")] - [parameter(Mandatory=$true,ParameterSetName="ByRepositoryIdAndDescriptor")] - [parameter(Mandatory=$true,ParameterSetName="ByRepositoryNameAndDescriptor")] + [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndDescriptor")] + [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndGroup")] + [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndUser")] + [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryIdAndGroup")] + [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryIdAndUser")] + [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryNameAndGroup")] + [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryNameAndUser")] + [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryIdAndDescriptor")] + [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryNameAndDescriptor")] [VSTeamGitRepositoryPermissions]$Allow, - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndDescriptor")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndGroup")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndUser")] - [parameter(Mandatory=$true,ParameterSetName="ByRepositoryIdAndGroup")] - [parameter(Mandatory=$true,ParameterSetName="ByRepositoryIdAndUser")] - [parameter(Mandatory=$true,ParameterSetName="ByRepositoryNameAndGroup")] - [parameter(Mandatory=$true,ParameterSetName="ByRepositoryNameAndUser")] - [parameter(Mandatory=$true,ParameterSetName="ByRepositoryIdAndDescriptor")] - [parameter(Mandatory=$true,ParameterSetName="ByRepositoryNameAndDescriptor")] + [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndDescriptor")] + [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndGroup")] + [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndUser")] + [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryIdAndGroup")] + [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryIdAndUser")] + [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryNameAndGroup")] + [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryNameAndUser")] + [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryIdAndDescriptor")] + [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryNameAndDescriptor")] [VSTeamGitRepositoryPermissions]$Deny ) @@ -77,38 +77,32 @@ function Add-VSTeamGitRepositoryPermission { $securityNamespaceId = "2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87" # Resolve Repository Name to ID - if ($RepositoryName) - { + if ($RepositoryName) { $repo = Get-VSTeamGitRepository -ProjectName $Project.Name -Name $RepositoryName - if (!$repo) - { + if (!$repo) { throw "Repository not found" } $RepositoryId = $repo.ID } - # Resolve Group to Descriptor - if ($Group) - { - $Descriptor = _getDescriptorForACL -Group $Group - } + # Resolve Group to Descriptor + if ($Group) { + $Descriptor = _getDescriptorForACL -Group $Group + } - # Resolve User to Descriptor - if ($User) - { - $Descriptor = _getDescriptorForACL -User $User - } + # Resolve User to Descriptor + if ($User) { + $Descriptor = _getDescriptorForACL -User $User + } $token = "repoV2/$($Project.ID)" - if ($RepositoryId) - { + if ($RepositoryId) { $token += "/$($RepositoryId)" } - if ($BranchName) - { + if ($BranchName) { $branchHex = _convertToHex($BranchName) $token += "/refs/heads/$($branchHex)" } diff --git a/Source/Public/Add-VSTeamKubernetesEndpoint.ps1 b/Source/Public/Add-VSTeamKubernetesEndpoint.ps1 index 997413d52..6dbdde1bf 100644 --- a/Source/Public/Add-VSTeamKubernetesEndpoint.ps1 +++ b/Source/Public/Add-VSTeamKubernetesEndpoint.ps1 @@ -6,29 +6,27 @@ function Add-VSTeamKubernetesEndpoint { [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [string] $kubeconfig, - + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [string] $kubernetesUrl, - + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [string] $clientCertificateData, - + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [string] $clientKeyData, - + [switch] $acceptUntrustedCerts, - - [switch] $generatePfx + + [switch] $generatePfx, + + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [string] $ProjectName ) - - DynamicParam { - _buildProjectNameDynamicParam - } - - Process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - + + process { # Process switch parameters $untrustedCerts = $false if ($acceptUntrustedCerts.IsPresent) { diff --git a/Source/Public/Add-VSTeamNuGetEndpoint.ps1 b/Source/Public/Add-VSTeamNuGetEndpoint.ps1 index f21e926a3..0eb50055f 100644 --- a/Source/Public/Add-VSTeamNuGetEndpoint.ps1 +++ b/Source/Public/Add-VSTeamNuGetEndpoint.ps1 @@ -4,35 +4,35 @@ function Add-VSTeamNuGetEndpoint { param( [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [string] $EndpointName, - + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [string] $NuGetUrl, - + [Parameter(ParameterSetName = 'ClearToken', Mandatory = $true, HelpMessage = 'Personal Access Token')] [string] $PersonalAccessToken, - + [Parameter(ParameterSetName = 'ClearApiKey', Mandatory = $true, HelpMessage = 'ApiKey')] [string] $ApiKey, - + [Parameter(ParameterSetName = 'SecurePassword', Mandatory = $true, HelpMessage = 'Username')] [string] $Username, - + [Parameter(ParameterSetName = 'SecureToken', Mandatory = $true, HelpMessage = 'Personal Access Token')] [securestring] $SecurePersonalAccessToken, - + [Parameter(ParameterSetName = 'SecureApiKey', Mandatory = $true, HelpMessage = 'ApiKey')] [securestring] $SecureApiKey, - + [Parameter(ParameterSetName = 'SecurePassword', Mandatory = $true, HelpMessage = 'Password')] - [securestring] $SecurePassword + [securestring] $SecurePassword, + + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [string] $ProjectName ) - - DynamicParam { - _buildProjectNameDynamicParam - } - - Process { - + + process { if ($PersonalAccessToken) { $Authentication = 'Token' $token = $PersonalAccessToken @@ -57,11 +57,8 @@ function Add-VSTeamNuGetEndpoint { $token = $credential.GetNetworkCredential().Password } - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters['ProjectName'] - $obj = @{ - data = @{} + data = @{ } url = $NuGetUrl } @@ -97,4 +94,4 @@ function Add-VSTeamNuGetEndpoint { -endpointType 'externalnugetfeed' ` -object $obj } -} \ No newline at end of file +} diff --git a/Source/Public/Add-VSTeamPolicy.ps1 b/Source/Public/Add-VSTeamPolicy.ps1 index 718bee0be..a0dc11b05 100644 --- a/Source/Public/Add-VSTeamPolicy.ps1 +++ b/Source/Public/Add-VSTeamPolicy.ps1 @@ -1,42 +1,40 @@ -function Add-VSTeamPolicy { - [CmdletBinding()] - param( - [Parameter(Mandatory = $true)] - [guid] $type, - - [switch] $enabled, - - [switch] $blocking, - - [Parameter(Mandatory = $true)] - [hashtable] $settings - ) - - DynamicParam { - _buildProjectNameDynamicParam -mandatory $true - } - - process { - $ProjectName = $PSBoundParameters["ProjectName"] - - $body = @{ - isEnabled = $enabled.IsPresent; - isBlocking = $blocking.IsPresent; - type = @{ - id = $type - }; - settings = $settings - } | ConvertTo-Json -Depth 10 -Compress - - try { - # Call the REST API - $resp = _callAPI -ProjectName $ProjectName -Area 'policy' -Resource 'configurations' ` - -Method Post -ContentType 'application/json' -Body $body -Version $(_getApiVersion Git) - - Write-Output $resp - } - catch { - _handleException $_ - } - } -} \ No newline at end of file +function Add-VSTeamPolicy { + [CmdletBinding()] + param( + [Parameter(Mandatory = $true)] + [guid] $type, + + [switch] $enabled, + + [switch] $blocking, + + [Parameter(Mandatory = $true)] + [hashtable] $settings, + + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [string] $ProjectName + ) + process { + $body = @{ + isEnabled = $enabled.IsPresent; + isBlocking = $blocking.IsPresent; + type = @{ + id = $type + }; + settings = $settings + } | ConvertTo-Json -Depth 10 -Compress + + try { + # Call the REST API + $resp = _callAPI -ProjectName $ProjectName -Area 'policy' -Resource 'configurations' ` + -Method Post -ContentType 'application/json' -Body $body -Version $(_getApiVersion Git) + + Write-Output $resp + } + catch { + _handleException $_ + } + } +} diff --git a/Source/Public/Add-VSTeamProject.ps1 b/Source/Public/Add-VSTeamProject.ps1 index 01449539a..4c4f07a76 100644 --- a/Source/Public/Add-VSTeamProject.ps1 +++ b/Source/Public/Add-VSTeamProject.ps1 @@ -1,57 +1,52 @@ -function Add-VSTeamProject { - param( - [parameter(Mandatory = $true)] - [Alias('Name')] - [string] $ProjectName, - - [string] $Description, - - [switch] $TFVC - ) - - DynamicParam { - [VSTeamProcessCache]::timestamp = -1 - - _buildProcessNameDynamicParam -ParameterName 'ProcessTemplate' -Mandatory $false - } - - process { - # Bind the parameter to a friendly variable - $ProcessTemplate = $PSBoundParameters["ProcessTemplate"] - - if ($TFVC.IsPresent) { - $srcCtrl = "Tfvc" - } - else { - $srcCtrl = 'Git' - } - - if ($ProcessTemplate) { - Write-Verbose "Finding $ProcessTemplate id" - $templateTypeId = (Get-VSTeamProcess -Name $ProcessTemplate).Id - } - else { - # Default to Scrum Process Template - $ProcessTemplate = 'Scrum' - $templateTypeId = '6b724908-ef14-45cf-84f8-768b5384da45' - } - - $body = '{"name": "' + $ProjectName + '", "description": "' + $Description + '", "capabilities": {"versioncontrol": { "sourceControlType": "' + $srcCtrl + '"}, "processTemplate":{"templateTypeId": "' + $templateTypeId + '"}}}' - - try { - # Call the REST API - $resp = _callAPI -Area 'projects' ` - -Method Post -ContentType 'application/json' -body $body -Version $(_getApiVersion Core) - - _trackProjectProgress -resp $resp -title 'Creating team project' -msg "Name: $($ProjectName), Template: $($processTemplate), Src: $($srcCtrl)" - - # Invalidate any cache of projects. - [VSTeamProjectCache]::timestamp = -1 - - return Get-VSTeamProject $ProjectName - } - catch { - _handleException $_ - } - } -} \ No newline at end of file +function Add-VSTeamProject { + param( + [parameter(Mandatory = $true)] + [Alias('Name')] + [string] $ProjectName, + + [string] $Description, + + [switch] $TFVC, + + [ProcessValidateAttribute()] + [ArgumentCompleter([ProcessTemplateCompleter])] + [string] $ProcessTemplate + ) + + process { + if ($TFVC.IsPresent) { + $srcCtrl = "Tfvc" + } + else { + $srcCtrl = 'Git' + } + + if ($ProcessTemplate) { + Write-Verbose "Finding $ProcessTemplate id" + $templateTypeId = (Get-VSTeamProcess -Name $ProcessTemplate).Id + } + else { + # Default to Scrum Process Template + $ProcessTemplate = 'Scrum' + $templateTypeId = '6b724908-ef14-45cf-84f8-768b5384da45' + } + + $body = '{"name": "' + $ProjectName + '", "description": "' + $Description + '", "capabilities": {"versioncontrol": { "sourceControlType": "' + $srcCtrl + '"}, "processTemplate":{"templateTypeId": "' + $templateTypeId + '"}}}' + + try { + # Call the REST API + $resp = _callAPI -Area 'projects' ` + -Method Post -ContentType 'application/json' -body $body -Version $(_getApiVersion Core) + + _trackProjectProgress -resp $resp -title 'Creating team project' -msg "Name: $($ProjectName), Template: $($processTemplate), Src: $($srcCtrl)" + + # Invalidate any cache of projects. + [VSTeamProjectCache]::timestamp = -1 + + return Get-VSTeamProject $ProjectName + } + catch { + _handleException $_ + } + } +} diff --git a/Source/Public/Add-VSTeamPullRequest.ps1 b/Source/Public/Add-VSTeamPullRequest.ps1 index c637f529c..0bf33ccff 100644 --- a/Source/Public/Add-VSTeamPullRequest.ps1 +++ b/Source/Public/Add-VSTeamPullRequest.ps1 @@ -22,21 +22,18 @@ function Add-VSTeamPullRequest { [Parameter()] [switch] $Draft, - # Forces the command without confirmation [Parameter()] - [switch] $Force - ) + [switch] $Force, - DynamicParam { - _buildProjectNameDynamicParam - } + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [string] $ProjectName + ) process { Write-Verbose "Add-VSTeamPullRequest" - - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - + $body = '{"sourceRefName": "' + $SourceRefName + '", "targetRefName": "' + $TargetRefName + '", "title": "' + $Title + '", "description": "' + $Description + '", "isDraft": ' + $Draft.ToString().ToLower() + '}' Write-Verbose $body diff --git a/Source/Public/Add-VSTeamRelease.ps1 b/Source/Public/Add-VSTeamRelease.ps1 index b9127f86c..b8ecdbf1f 100644 --- a/Source/Public/Add-VSTeamRelease.ps1 +++ b/Source/Public/Add-VSTeamRelease.ps1 @@ -1,105 +1,70 @@ -function Add-VSTeamRelease { - [CmdletBinding(DefaultParameterSetName = 'ById', SupportsShouldProcess = $true, ConfirmImpact = "Medium")] - param( - [Parameter(ParameterSetName = 'ById', Mandatory = $true)] - [int] $DefinitionId, - - [Parameter(Mandatory = $false)] - [string] $Description, - - [Parameter(ParameterSetName = 'ById', Mandatory = $true)] - [string] $ArtifactAlias, - - [Parameter()] - [string] $Name, - - [Parameter(ParameterSetName = 'ById', Mandatory = $true)] - [string] $BuildId, - - [Parameter()] - [string] $SourceBranch, - - # Forces the command without confirmation - [switch] $Force - ) - - DynamicParam { - $dp = _buildProjectNameDynamicParam - - # If they have not set the default project you can't find the - # validateset so skip that check. However, we still need to give - # the option to pass by name. - if ($Global:PSDefaultParameterValues["*:projectName"]) { - $defs = Get-VSTeamReleaseDefinition -ProjectName $Global:PSDefaultParameterValues["*:projectName"] -expand artifacts - $arrSet = $defs.name - } - else { - Write-Verbose 'Call Set-VSTeamDefaultProject for Tab Complete of DefinitionName' - $defs = $null - $arrSet = $null - } - - $ParameterName = 'DefinitionName' - $rp = _buildDynamicParam -ParameterName $ParameterName -arrSet $arrSet -ParameterSetName 'ByName' -Mandatory $true - $dp.Add($ParameterName, $rp) - - if ($Global:PSDefaultParameterValues["*:projectName"]) { - $builds = Get-VSTeamBuild -ProjectName $Global:PSDefaultParameterValues["*:projectName"] - $arrSet = $builds.name - } - else { - Write-Verbose 'Call Set-VSTeamDefaultProject for Tab Complete of BuildName' - $builds = $null - $arrSet = $null - } - - $ParameterName = 'BuildNumber' - $rp = _buildDynamicParam -ParameterName $ParameterName -arrSet $arrSet -ParameterSetName 'ByName' -Mandatory $true - $dp.Add($ParameterName, $rp) - - $dp - } - - process { - Write-Debug 'Add-VSTeamRelease Process' - - # Bind the parameter to a friendly variable - $BuildNumber = $PSBoundParameters["BuildNumber"] - $ProjectName = $PSBoundParameters["ProjectName"] - $DefinitionName = $PSBoundParameters["DefinitionName"] - - #Write-Verbose $builds - - if ($builds -and -not $buildId) { - $buildId = $builds | Where-Object {$_.name -eq $BuildNumber} | Select-Object -ExpandProperty id - } - - if ($defs -and -not $artifactAlias) { - $def = $defs | Where-Object {$_.name -eq $DefinitionName} - $DefinitionId = $def | Select-Object -ExpandProperty id - - $artifactAlias = $def.artifacts[0].alias - } - - $body = '{"definitionId": ' + $DefinitionId + ', "description": "' + $description + '", "artifacts": [{"alias": "' + $artifactAlias + '", "instanceReference": {"id": "' + $buildId + '", "name": "' + $Name + '", "sourceBranch": "' + $SourceBranch + '"}}]}' - - Write-Verbose $body - - # Call the REST API - if ($force -or $pscmdlet.ShouldProcess($description, "Add Release")) { - - try { - Write-Debug 'Add-VSTeamRelease Call the REST API' - $resp = _callAPI -SubDomain 'vsrm' -ProjectName $ProjectName -Area 'release' -Resource 'releases' ` - -Method Post -ContentType 'application/json' -Body $body -Version $(_getApiVersion Release) - - _applyTypesToRelease $resp - - Write-Output $resp - } - catch { - _handleException $_ - } - } - } -} \ No newline at end of file +function Add-VSTeamRelease { + [CmdletBinding(DefaultParameterSetName = 'ById', SupportsShouldProcess = $true, ConfirmImpact = "Medium")] + param( + [Parameter(ParameterSetName = 'ById', Mandatory = $true)] + [int] $DefinitionId, + + [Parameter(Mandatory = $false)] + [string] $Description, + + [Parameter(ParameterSetName = 'ById', Mandatory = $true)] + [string] $ArtifactAlias, + + [Parameter()] + [string] $Name, + + [Parameter(ParameterSetName = 'ById', Mandatory = $true)] + [string] $BuildId, + + [ArgumentCompleter([BuildCompleter])] + [Parameter(ParameterSetName = 'ByName', Mandatory = $true)] + [string] $BuildNumber, + + [Parameter()] + [string] $SourceBranch, + + [switch] $Force, + + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [string] $ProjectName, + + [ArgumentCompleter([ReleaseDefinitionCompleter])] + [string] $DefinitionName + ) + + begin { + if ($BuildNumber) { + $buildID = (Get-VSTeamBuild -ProjectName $ProjectName -BuildNumber $BuildNumber).id + if (-not $buildID) { throw "'$BuildnNumber' is not a valid build Use Get-VsTeamBuild to get a list of valid build numbers." } + } + + if ($DefinitionName -and -not $artifactAlias) { + $def = Get-VSTeamReleaseDefinition -ProjectName $ProjectName | Where-Object { $_.name -eq $DefinitionName } + $DefinitionId = $def.id + $artifactAlias = $def.artifacts[0].alias + } + } + + process { + $body = '{"definitionId": ' + $DefinitionId + ', "description": "' + $description + '", "artifacts": [{"alias": "' + $artifactAlias + '", "instanceReference": {"id": "' + $buildId + '", "name": "' + $Name + '", "sourceBranch": "' + $SourceBranch + '"}}]}' + Write-Verbose $body + + # Call the REST API + if ($force -or $pscmdlet.ShouldProcess($description, "Add Release")) { + try { + Write-Debug 'Add-VSTeamRelease Call the REST API' + $resp = _callAPI -SubDomain 'vsrm' -ProjectName $ProjectName -Area 'release' -Resource 'releases' ` + -Method Post -ContentType 'application/json' -Body $body -Version $(_getApiVersion Release) + + _applyTypesToRelease $resp + + Write-Output $resp + } + catch { + _handleException $_ + } + } + } +} diff --git a/Source/Public/Add-VSTeamReleaseDefinition.ps1 b/Source/Public/Add-VSTeamReleaseDefinition.ps1 index 5311e0399..df0980841 100644 --- a/Source/Public/Add-VSTeamReleaseDefinition.ps1 +++ b/Source/Public/Add-VSTeamReleaseDefinition.ps1 @@ -1,23 +1,19 @@ -function Add-VSTeamReleaseDefinition { - [CmdletBinding()] - param( - [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [string] $inFile - ) - - DynamicParam { - _buildProjectNameDynamicParam - } - - process { - Write-Debug 'Add-VSTeamReleaseDefinition Process' - - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - - $resp = _callAPI -Method Post -subDomain vsrm -Area release -Resource definitions -ProjectName $ProjectName ` - -Version $(_getApiVersion Release) -inFile $inFile -ContentType 'application/json' - - Write-Output $resp - } -} \ No newline at end of file +function Add-VSTeamReleaseDefinition { + [CmdletBinding()] + param( + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [string] $inFile, + + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [string] $ProjectName + ) + + process { + $resp = _callAPI -Method Post -subDomain vsrm -Area release -Resource definitions -ProjectName $ProjectName ` + -Version $(_getApiVersion Release) -inFile $inFile -ContentType 'application/json' + + Write-Output $resp + } +} diff --git a/Source/Public/Add-VSTeamServiceEndpoint.ps1 b/Source/Public/Add-VSTeamServiceEndpoint.ps1 index 16374818e..aba543848 100644 --- a/Source/Public/Add-VSTeamServiceEndpoint.ps1 +++ b/Source/Public/Add-VSTeamServiceEndpoint.ps1 @@ -1,35 +1,32 @@ -function Add-VSTeamServiceEndpoint { - [CmdletBinding(DefaultParameterSetName = 'Secure')] - param( - [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [string] $endpointName, - - [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [string] $endpointType, - - [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [hashtable] $object - ) - - DynamicParam { - _buildProjectNameDynamicParam - } - - Process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - - $object['name'] = $endpointName - $object['type'] = $endpointType - - $body = $object | ConvertTo-Json - - # Call the REST API - $resp = _callAPI -ProjectName $projectName -Area 'distributedtask' -Resource 'serviceendpoints' ` - -Method Post -ContentType 'application/json' -body $body -Version $(_getApiVersion DistributedTask) - - _trackServiceEndpointProgress -projectName $projectName -resp $resp -title 'Creating Service Endpoint' -msg "Creating $endpointName" - - return Get-VSTeamServiceEndpoint -ProjectName $ProjectName -id $resp.id - } -} \ No newline at end of file +function Add-VSTeamServiceEndpoint { + [CmdletBinding(DefaultParameterSetName = 'Secure')] + param( + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [string] $endpointName, + + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [string] $endpointType, + + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [hashtable] $object, + + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName + ) + process { + $object['name'] = $endpointName + $object['type'] = $endpointType + + $body = $object | ConvertTo-Json + + # Call the REST API + $resp = _callAPI -ProjectName $projectName -Area 'distributedtask' -Resource 'serviceendpoints' ` + -Method Post -ContentType 'application/json' -body $body -Version $(_getApiVersion DistributedTask) + + _trackServiceEndpointProgress -projectName $projectName -resp $resp -title 'Creating Service Endpoint' -msg "Creating $endpointName" + + return Get-VSTeamServiceEndpoint -ProjectName $ProjectName -id $resp.id + } +} diff --git a/Source/Public/Add-VSTeamServiceFabricEndpoint.ps1 b/Source/Public/Add-VSTeamServiceFabricEndpoint.ps1 index 930d21cf4..acc1e4543 100644 --- a/Source/Public/Add-VSTeamServiceFabricEndpoint.ps1 +++ b/Source/Public/Add-VSTeamServiceFabricEndpoint.ps1 @@ -4,7 +4,7 @@ function Add-VSTeamServiceFabricEndpoint { [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [Alias('displayName')] [string] $endpointName, - + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [string] $url, @@ -28,20 +28,18 @@ function Add-VSTeamServiceFabricEndpoint { [string] $clusterSpn, [Parameter(ParameterSetName = 'None', Mandatory = $false, ValueFromPipelineByPropertyName = $true)] - [bool] $useWindowsSecurity - ) - - DynamicParam { - _buildProjectNameDynamicParam - } + [bool] $useWindowsSecurity, - Process { + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName + ) + + process { # This will throw if this account does not support ServiceFabricEndpoint _supportsServiceFabricEndpoint - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - switch ($PSCmdlet.ParameterSetName) { "Certificate" { # copied securestring usage from Set-VSTeamAccount diff --git a/Source/Public/Add-VSTeamSonarQubeEndpoint.ps1 b/Source/Public/Add-VSTeamSonarQubeEndpoint.ps1 index a66f6ef49..cfd2caafc 100644 --- a/Source/Public/Add-VSTeamSonarQubeEndpoint.ps1 +++ b/Source/Public/Add-VSTeamSonarQubeEndpoint.ps1 @@ -11,15 +11,14 @@ function Add-VSTeamSonarQubeEndpoint { [string] $personalAccessToken, [parameter(ParameterSetName = 'Secure', Mandatory = $true, HelpMessage = 'Personal Access Token')] - [securestring] $securePersonalAccessToken - ) - - DynamicParam { - _buildProjectNameDynamicParam - } - - Process { + [securestring] $securePersonalAccessToken, + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName + ) + process { if ($personalAccessToken) { $token = $personalAccessToken } @@ -39,7 +38,7 @@ function Add-VSTeamSonarQubeEndpoint { }; scheme = 'UsernamePassword' }; - data = @{}; + data = @{ }; url = $sonarqubeUrl } diff --git a/Source/Public/Add-VSTeamTaskGroup.ps1 b/Source/Public/Add-VSTeamTaskGroup.ps1 index 0788b9aa1..0bc1b8517 100644 --- a/Source/Public/Add-VSTeamTaskGroup.ps1 +++ b/Source/Public/Add-VSTeamTaskGroup.ps1 @@ -1,28 +1,25 @@ -function Add-VSTeamTaskGroup { - [CmdletBinding()] - param( - [Parameter(ParameterSetName = 'ByFile', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [string] $InFile, - - [Parameter(ParameterSetName = 'ByBody', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [string] $Body - ) - - DynamicParam { - _buildProjectNameDynamicParam - } - - process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - - if ($InFile) { - $resp = _callAPI -Method Post -ProjectName $ProjectName -Area distributedtask -Resource taskgroups -Version $(_getApiVersion TaskGroups) -InFile $InFile -ContentType 'application/json' - } - else { - $resp = _callAPI -Method Post -ProjectName $ProjectName -Area distributedtask -Resource taskgroups -Version $(_getApiVersion TaskGroups) -ContentType 'application/json' -Body $Body - } - - return $resp - } -} \ No newline at end of file +function Add-VSTeamTaskGroup { + [CmdletBinding()] + param( + [Parameter(ParameterSetName = 'ByFile', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [string] $InFile, + + [Parameter(ParameterSetName = 'ByBody', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [string] $Body, + + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName + ) + process { + if ($InFile) { + $resp = _callAPI -Method Post -ProjectName $ProjectName -Area distributedtask -Resource taskgroups -Version $(_getApiVersion TaskGroups) -InFile $InFile -ContentType 'application/json' + } + else { + $resp = _callAPI -Method Post -ProjectName $ProjectName -Area distributedtask -Resource taskgroups -Version $(_getApiVersion TaskGroups) -ContentType 'application/json' -Body $Body + } + + return $resp + } +} diff --git a/Source/Public/Add-VSTeamUserEntitlement.ps1 b/Source/Public/Add-VSTeamUserEntitlement.ps1 index e654911ae..b3b04822c 100644 --- a/Source/Public/Add-VSTeamUserEntitlement.ps1 +++ b/Source/Public/Add-VSTeamUserEntitlement.ps1 @@ -4,31 +4,28 @@ function Add-VSTeamUserEntitlement { [Parameter(Mandatory = $true)] [Alias('UserEmail')] [string]$Email, - + [ValidateSet('Advanced', 'EarlyAdopter', 'Express', 'None', 'Professional', 'StakeHolder')] [string]$License = 'EarlyAdopter', - + [ValidateSet('Custom', 'ProjectAdministrator', 'ProjectContributor', 'ProjectReader', 'ProjectStakeholder')] [string]$Group = 'ProjectContributor', - + [ValidateSet('account', 'auto', 'msdn', 'none', 'profile', 'trial')] [string]$LicensingSource = "account", - - [ValidateSet('eligible', 'enterprise', 'none', 'platforms', 'premium', 'professional', 'testProfessional', 'ultimate')] - [string]$MSDNLicenseType = "none" - ) - DynamicParam { - _buildProjectNameDynamicParam -Mandatory $false - } + [ValidateSet('eligible', 'enterprise', 'none', 'platforms', 'premium', 'professional', 'testProfessional', 'ultimate')] + [string]$MSDNLicenseType = "none", + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName + ) process { # Thi swill throw if this account does not support MemberEntitlementManagement _supportsMemberEntitlementManagement - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - $obj = @{ accessLevel = @{ accountLicenseType = $License diff --git a/Source/Public/Add-VSTeamVariableGroup.ps1 b/Source/Public/Add-VSTeamVariableGroup.ps1 index 6b1d14e5f..96cce5640 100644 --- a/Source/Public/Add-VSTeamVariableGroup.ps1 +++ b/Source/Public/Add-VSTeamVariableGroup.ps1 @@ -1,62 +1,63 @@ -function Add-VSTeamVariableGroup { - param( - [Parameter(ParameterSetName = 'ByHashtable', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [string] $Name, - - [Parameter(ParameterSetName = 'ByHashtable', Mandatory = $false, ValueFromPipelineByPropertyName = $true)] - [string] $Description, - - [Parameter(ParameterSetName = 'ByHashtable', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [hashtable] $Variables, - - [Parameter(ParameterSetName = 'ByBody', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [string] $Body - ) - - DynamicParam { - $dp = _buildProjectNameDynamicParam - - if ([VSTeamVersions]::Version -ne "TFS2017" -and $PSCmdlet.ParameterSetName -eq "ByHashtable") { - $ParameterName = 'Type' - $rp = _buildDynamicParam -ParameterName $ParameterName -arrSet ('Vsts', 'AzureKeyVault') -Mandatory $true - $dp.Add($ParameterName, $rp) - - $ParameterName = 'ProviderData' - $rp = _buildDynamicParam -ParameterName $ParameterName -Mandatory $false -ParameterType ([hashtable]) - $dp.Add($ParameterName, $rp) - } - - return $dp - } - - Process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - - if ([string]::IsNullOrWhiteSpace($Body)) - { - $bodyAsHashtable = @{ - name = $Name - description = $Description - variables = $Variables - } - if ([VSTeamVersions]::Version -ne "TFS2017") { - $Type = $PSBoundParameters['Type'] - $bodyAsHashtable.Add("type", $Type) - - $ProviderData = $PSBoundParameters['ProviderData'] - if ($null -ne $ProviderData) { - $bodyAsHashtable.Add("providerData", $ProviderData) - } - } - - $body = $bodyAsHashtable | ConvertTo-Json - } - - # Call the REST API - $resp = _callAPI -ProjectName $projectName -Area 'distributedtask' -Resource 'variablegroups' ` - -Method Post -ContentType 'application/json' -body $body -Version $(_getApiVersion VariableGroups) - - return Get-VSTeamVariableGroup -ProjectName $ProjectName -id $resp.id - } +function Add-VSTeamVariableGroup { + param( + [Parameter(ParameterSetName = 'ByHashtable', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [string] $Name, + + [Parameter(ParameterSetName = 'ByHashtable', Mandatory = $false, ValueFromPipelineByPropertyName = $true)] + [string] $Description, + + [Parameter(ParameterSetName = 'ByHashtable', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [hashtable] $Variables, + + [Parameter(ParameterSetName = 'ByBody', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [string] $Body, + + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName + ) + DynamicParam { + $dp = New-Object System.Management.Automation.RuntimeDefinedParameterDictionary + + if ([VSTeamVersions]::Version -ne "TFS2017" -and $PSCmdlet.ParameterSetName -eq "ByHashtable") { + $ParameterName = 'Type' + $rp = _buildDynamicParam -ParameterName $ParameterName -arrSet ('Vsts', 'AzureKeyVault') -Mandatory $true + $dp.Add($ParameterName, $rp) + + $ParameterName = 'ProviderData' + $rp = _buildDynamicParam -ParameterName $ParameterName -Mandatory $false -ParameterType ([hashtable]) + $dp.Add($ParameterName, $rp) + } + + return $dp + } + + Process { + if ([string]::IsNullOrWhiteSpace($Body)) + { + $bodyAsHashtable = @{ + name = $Name + description = $Description + variables = $Variables + } + if ([VSTeamVersions]::Version -ne "TFS2017") { + $Type = $PSBoundParameters['Type'] + $bodyAsHashtable.Add("type", $Type) + + $ProviderData = $PSBoundParameters['ProviderData'] + if ($null -ne $ProviderData) { + $bodyAsHashtable.Add("providerData", $ProviderData) + } + } + + $body = $bodyAsHashtable | ConvertTo-Json + } + + # Call the REST API + $resp = _callAPI -ProjectName $projectName -Area 'distributedtask' -Resource 'variablegroups' ` + -Method Post -ContentType 'application/json' -body $body -Version $(_getApiVersion VariableGroups) + + return Get-VSTeamVariableGroup -ProjectName $ProjectName -id $resp.id + } } \ No newline at end of file diff --git a/Source/Public/Add-VSTeamWorkItem.ps1 b/Source/Public/Add-VSTeamWorkItem.ps1 index f2459cca2..17320edfa 100644 --- a/Source/Public/Add-VSTeamWorkItem.ps1 +++ b/Source/Public/Add-VSTeamWorkItem.ps1 @@ -1,125 +1,109 @@ -function Add-VSTeamWorkItem { - [CmdletBinding()] - param( - [Parameter(Mandatory = $true)] - [string]$Title, - - [Parameter(Mandatory = $false)] - [string]$Description, - - [Parameter(Mandatory = $false)] - [string]$IterationPath, - - [Parameter(Mandatory = $false)] - [string]$AssignedTo, - - [Parameter(Mandatory = $false)] - [int]$ParentId, - - [Parameter(Mandatory = $false)] - [hashtable]$AdditionalFields - ) - - DynamicParam { - $dp = _buildProjectNameDynamicParam -mandatory $true - - # If they have not set the default project you can't find the - # validateset so skip that check. However, we still need to give - # the option to pass a WorkItemType to use. - if ($Global:PSDefaultParameterValues["*:projectName"]) { - $wittypes = _getWorkItemTypes -ProjectName $Global:PSDefaultParameterValues["*:projectName"] - $arrSet = $wittypes - } - else { - Write-Verbose 'Call Set-VSTeamDefaultProject for Tab Complete of WorkItemType' - $wittypes = $null - $arrSet = $null - } - - $ParameterName = 'WorkItemType' - $rp = _buildDynamicParam -ParameterName $ParameterName -arrSet $arrSet -Mandatory $true - $dp.Add($ParameterName, $rp) - - $dp - } - - Process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - - # The type has to start with a $ - $WorkItemType = "`$$($PSBoundParameters["WorkItemType"])" - - # Constructing the contents to be send. - # Empty parameters will be skipped when converting to json. - [Array]$body = @( - @{ - op = "add" - path = "/fields/System.Title" - value = $Title - } - @{ - op = "add" - path = "/fields/System.Description" - value = $Description - } - @{ - op = "add" - path = "/fields/System.IterationPath" - value = $IterationPath - } - @{ - op = "add" - path = "/fields/System.AssignedTo" - value = $AssignedTo - }) | Where-Object { $_.value } - - if ($ParentId) { - $parentUri = _buildRequestURI -ProjectName $ProjectName -Area 'wit' -Resource 'workitems' -id $ParentId - $body += @{ - op = "add" - path = "/relations/-" - value = @{ - "rel" = "System.LinkTypes.Hierarchy-Reverse" - "url" = $parentURI - } - } - } - - #this loop must always come after the main work item fields defined in the function parameters - if ($AdditionalFields) { - foreach ($fieldName in $AdditionalFields.Keys) { - - #check that main properties are not added into the additional fields hashtable - $foundFields = $body | Where-Object { $null -ne $_ -and $_.path -like "*$fieldName" } - if ($null -ne $foundFields) { - throw "Found duplicate field '$fieldName' in parameter AdditionalFields, which is already a parameter. Please remove it." - } - else { - $body += @{ - op = "add" - path = "/fields/$fieldName" - value = $AdditionalFields[$fieldName] - } - } - } - } - - # It is very important that even if the user only provides - # a single value above that the item is an array and not - # a single object or the call will fail. - # You must call ConvertTo-Json passing in the value and not - # not using pipeline. - # https://stackoverflow.com/questions/18662967/convertto-json-an-array-with-a-single-item - $json = ConvertTo-Json @($body) -Compress - - # Call the REST API - $resp = _callAPI -ProjectName $ProjectName -Area 'wit' -Resource 'workitems' ` - -Version $(_getApiVersion Core) -id $WorkItemType -Method Post ` - -ContentType 'application/json-patch+json' -Body $json - - _applyTypesToWorkItem -item $resp - - return $resp - } +function Add-VSTeamWorkItem { + [CmdletBinding()] + param( + [Parameter(Mandatory = $true)] + [string] $Title, + + [Parameter(Mandatory = $false)] + [string] $Description, + + [Parameter(Mandatory = $false)] + [string] $IterationPath, + + [Parameter(Mandatory = $false)] + [string] $AssignedTo, + + [Parameter(Mandatory = $false)] + [int] $ParentId, + + [Parameter(Mandatory = $false)] + [hashtable] $AdditionalFields, + + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName, + + [Parameter(Mandatory = $true)] + [WorkItemTypeValidateAttribute()] + [ArgumentCompleter([WorkItemTypeCompleter])] + [string] $WorkItemType + ) + + Process { + # The type has to start with a $ + $WorkItemType = '$' + $WorkItemType + + # Constructing the contents to be send. + # Empty parameters will be skipped when converting to json. + [Array]$body = @( + @{ + op = "add" + path = "/fields/System.Title" + value = $Title + } + @{ + op = "add" + path = "/fields/System.Description" + value = $Description + } + @{ + op = "add" + path = "/fields/System.IterationPath" + value = $IterationPath + } + @{ + op = "add" + path = "/fields/System.AssignedTo" + value = $AssignedTo + }) | Where-Object { $_.value } + + if ($ParentId) { + $parentUri = _buildRequestURI -ProjectName $ProjectName -Area 'wit' -Resource 'workitems' -id $ParentId + $body += @{ + op = "add" + path = "/relations/-" + value = @{ + "rel" = "System.LinkTypes.Hierarchy-Reverse" + "url" = $parentURI + } + } + } + + #this loop must always come after the main work item fields defined in the function parameters + if ($AdditionalFields) { + foreach ($fieldName in $AdditionalFields.Keys) { + + #check that main properties are not added into the additional fields hashtable + $foundFields = $body | Where-Object { $null -ne $_ -and $_.path -like "*$fieldName" } + if ($null -ne $foundFields) { + throw "Found duplicate field '$fieldName' in parameter AdditionalFields, which is already a parameter. Please remove it." + } + else { + $body += @{ + op = "add" + path = "/fields/$fieldName" + value = $AdditionalFields[$fieldName] + } + } + } + } + + # It is very important that even if the user only provides + # a single value above that the item is an array and not + # a single object or the call will fail. + # You must call ConvertTo-Json passing in the value and not + # not using pipeline. + # https://stackoverflow.com/questions/18662967/convertto-json-an-array-with-a-single-item + $json = ConvertTo-Json @($body) -Compress + + # Call the REST API + $resp = _callAPI -ProjectName $ProjectName -Area 'wit' -Resource 'workitems' ` + -Version $(_getApiVersion Core) -id $WorkItemType -Method Post ` + -ContentType 'application/json-patch+json' -Body $json + + _applyTypesToWorkItem -item $resp + + return $resp + } } \ No newline at end of file diff --git a/Source/Public/Clear-VSTeamDefaultProject.ps1 b/Source/Public/Clear-VSTeamDefaultProject.ps1 index 339889c89..36c365e6a 100644 --- a/Source/Public/Clear-VSTeamDefaultProject.ps1 +++ b/Source/Public/Clear-VSTeamDefaultProject.ps1 @@ -2,6 +2,7 @@ function Clear-VSTeamDefaultProject { [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseDeclaredVarsMoreThanAssignments", "")] [CmdletBinding()] param() + DynamicParam { # # Only add these options on Windows Machines if (_isOnWindows) { @@ -67,7 +68,7 @@ function Clear-VSTeamDefaultProject { } [VSTeamVersions]::DefaultProject = '' - $Global:PSDefaultParameterValues.Remove("*:projectName") + $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") Write-Output "Removed default project" } diff --git a/Source/Public/Get-VSTeam.ps1 b/Source/Public/Get-VSTeam.ps1 index 79642b746..45d628ebe 100644 --- a/Source/Public/Get-VSTeam.ps1 +++ b/Source/Public/Get-VSTeam.ps1 @@ -1,68 +1,66 @@ -function Get-VSTeam { - [CmdletBinding(DefaultParameterSetName = 'List')] - param ( - [Parameter(ParameterSetName = 'List')] - [int] $Top, - - [Parameter(ParameterSetName = 'List')] - [int] $Skip, - - [Parameter(ParameterSetName = 'ByID')] - [Alias('TeamId')] - [string[]] $Id, - - [Parameter(ParameterSetName = 'ByName')] - [Alias('TeamName')] - [string[]] $Name - ) - - DynamicParam { - _buildProjectNameDynamicParam - } - - process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - - if ($Id) { - foreach ($item in $Id) { - # Call the REST API - $resp = _callAPI -Area 'projects' -Resource "$ProjectName/teams" -id $item ` - -Version $(_getApiVersion Core) - - $team = [VSTeamTeam]::new($resp, $ProjectName) - - Write-Output $team - } - } - elseif ($Name) { - foreach ($item in $Name) { - # Call the REST API - $resp = _callAPI -Area 'projects' -Resource "$ProjectName/teams" -id $item ` - -Version $(_getApiVersion Core) - - $team = [VSTeamTeam]::new($resp, $ProjectName) - - Write-Output $team - } - } - else { - # Call the REST API - $resp = _callAPI -Area 'projects' -Resource "$ProjectName/teams" ` - -Version $(_getApiVersion Core) ` - -QueryString @{ - '$top' = $top - '$skip' = $skip - } - - $obj = @() - - # Create an instance for each one - foreach ($item in $resp.value) { - $obj += [VSTeamTeam]::new($item, $ProjectName) - } - - Write-Output $obj - } - } +function Get-VSTeam { + [CmdletBinding(DefaultParameterSetName = 'List')] + param ( + [Parameter(ParameterSetName = 'List')] + [int] $Top, + + [Parameter(ParameterSetName = 'List')] + [int] $Skip, + + [Parameter(ParameterSetName = 'ByID')] + [Alias('TeamId')] + [string[]] $Id, + + [Parameter(ParameterSetName = 'ByName')] + [Alias('TeamName')] + [string[]] $Name, + + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName + ) + + process { + if ($Id) { + foreach ($item in $Id) { + # Call the REST API + $resp = _callAPI -Area 'projects' -Resource "$ProjectName/teams" -id $item ` + -Version $(_getApiVersion Core) + + $team = [VSTeamTeam]::new($resp, $ProjectName) + + Write-Output $team + } + } + elseif ($Name) { + foreach ($item in $Name) { + # Call the REST API + $resp = _callAPI -Area 'projects' -Resource "$ProjectName/teams" -id $item ` + -Version $(_getApiVersion Core) + + $team = [VSTeamTeam]::new($resp, $ProjectName) + + Write-Output $team + } + } + else { + # Call the REST API + $resp = _callAPI -Area 'projects' -Resource "$ProjectName/teams" ` + -Version $(_getApiVersion Core) ` + -QueryString @{ + '$top' = $top + '$skip' = $skip + } + + $obj = @() + + # Create an instance for each one + foreach ($item in $resp.value) { + $obj += [VSTeamTeam]::new($item, $ProjectName) + } + + Write-Output $obj + } + } } \ No newline at end of file diff --git a/Source/Public/Get-VSTeamAPIVersion.ps1 b/Source/Public/Get-VSTeamAPIVersion.ps1 index f9fb5dd53..1bcce407a 100644 --- a/Source/Public/Get-VSTeamAPIVersion.ps1 +++ b/Source/Public/Get-VSTeamAPIVersion.ps1 @@ -4,20 +4,20 @@ function Get-VSTeamAPIVersion { param() return @{ - Version = $([VSTeamVersions]::Version) - Build = $([VSTeamVersions]::Build) - Release = $([VSTeamVersions]::Release) - Core = $([VSTeamVersions]::Core) - Git = $([VSTeamVersions]::Git) - DistributedTask = $([VSTeamVersions]::DistributedTask) - VariableGroups = $([VSTeamVersions]::VariableGroups) - Tfvc = $([VSTeamVersions]::Tfvc) + Version = $(_getApiVersion -Target) + Build = $(_getApiVersion Build) + Release = $(_getApiVersion Release) + Core = $(_getApiVersion Core) + Git = $(_getApiVersion Git) + DistributedTask = $(_getApiVersion DistributedTask) + VariableGroups = $(_getApiVersion VariableGroups) + Tfvc = $(_getApiVersion Tfvc) Packaging = $(_getApiVersion Packaging) - TaskGroups = $([VSTeamVersions]::TaskGroups) - MemberEntitlementManagement = $([VSTeamVersions]::MemberEntitlementManagement) - ExtensionsManagement = $([VSTeamVersions]::ExtensionsManagement) - ServiceFabricEndpoint = $([VSTeamVersions]::ServiceFabricEndpoint) - Graph = $([VSTeamVersions]::Graph) - Policy = $([VSTeamVersions]::Policy) + TaskGroups = $(_getApiVersion TaskGroups) + MemberEntitlementManagement = $(_getApiVersion MemberEntitlementManagement) + ExtensionsManagement = $(_getApiVersion ExtensionsManagement) + ServiceFabricEndpoint = $(_getApiVersion ServiceFabricEndpoint) + Graph = $(_getApiVersion Graph) + Policy = $(_getApiVersion Policy) } } \ No newline at end of file diff --git a/Source/Public/Get-VSTeamAccessControlList.ps1 b/Source/Public/Get-VSTeamAccessControlList.ps1 index dd0e0f912..122dc1ec5 100644 --- a/Source/Public/Get-VSTeamAccessControlList.ps1 +++ b/Source/Public/Get-VSTeamAccessControlList.ps1 @@ -26,25 +26,21 @@ function Get-VSTeamAccessControlList { ) process { - if ($SecurityNamespace) - { + if ($SecurityNamespace) { $SecurityNamespaceId = $SecurityNamespace.ID } - $queryString = @{} + $queryString = @{ } - if ($Token) - { + if ($Token) { $queryString.token = $Token } - if ($Descriptors -and $Descriptors.Length -gt 0) - { + if ($Descriptors -and $Descriptors.Length -gt 0) { $queryString.descriptors = $Descriptors -join "," } - if ($IncludeExtendedInfo.IsPresent) - { + if ($IncludeExtendedInfo.IsPresent) { $queryString.includeExtendedInfo = $true } diff --git a/Source/Public/Get-VSTeamApproval.ps1 b/Source/Public/Get-VSTeamApproval.ps1 index 18857acc1..35a2e4723 100644 --- a/Source/Public/Get-VSTeamApproval.ps1 +++ b/Source/Public/Get-VSTeamApproval.ps1 @@ -1,56 +1,54 @@ -function Get-VSTeamApproval { - [CmdletBinding()] - param( - [ValidateSet('Approved', 'ReAssigned', 'Rejected', 'Canceled', 'Pending', 'Rejected', 'Skipped', 'Undefined')] - [string] $StatusFilter, - - [Alias('ReleaseIdFilter')] - [int[]] $ReleaseIdsFilter, - - [string] $AssignedToFilter - ) - - DynamicParam { - _buildProjectNameDynamicParam - } - - Process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - - try { - # Build query string and determine if the includeMyGroupApprovals should be added. - $queryString = @{statusFilter = $StatusFilter; assignedtoFilter = $AssignedToFilter; releaseIdsFilter = ($ReleaseIdsFilter -join ',')} - - # The support in TFS and VSTS are not the same. - $instance = $(_getInstance) - if (_isVSTS $instance) { - if ([string]::IsNullOrEmpty($AssignedToFilter) -eq $false) { - $queryString.includeMyGroupApprovals = 'true'; - } - } - else { - # For TFS all three parameters must be set before you can add - # includeMyGroupApprovals. - if ([string]::IsNullOrEmpty($AssignedToFilter) -eq $false -and - [string]::IsNullOrEmpty($ReleaseIdsFilter) -eq $false -and - $StatusFilter -eq 'Pending') { - $queryString.includeMyGroupApprovals = 'true'; - } - } - - # Call the REST API - $resp = _callAPI -ProjectName $ProjectName -Area release -Resource approvals -SubDomain vsrm -Version $(_getApiVersion Release) -QueryString $queryString - - # Apply a Type Name so we can use custom format view and custom type extensions - foreach ($item in $resp.value) { - _applyTypesToApproval -item $item - } - - Write-Output $resp.value - } - catch { - _handleException $_ - } - } +function Get-VSTeamApproval { + [CmdletBinding()] + param( + [ValidateSet('Approved', 'ReAssigned', 'Rejected', 'Canceled', 'Pending', 'Rejected', 'Skipped', 'Undefined')] + [string] $StatusFilter, + + [Alias('ReleaseIdFilter')] + [int[]] $ReleaseIdsFilter, + + [string] $AssignedToFilter, + + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName + ) + + process { + try { + # Build query string and determine if the includeMyGroupApprovals should be added. + $queryString = @{statusFilter = $StatusFilter; assignedtoFilter = $AssignedToFilter; releaseIdsFilter = ($ReleaseIdsFilter -join ',') } + + # The support in TFS and VSTS are not the same. + $instance = $(_getInstance) + if (_isVSTS $instance) { + if ([string]::IsNullOrEmpty($AssignedToFilter) -eq $false) { + $queryString.includeMyGroupApprovals = 'true'; + } + } + else { + # For TFS all three parameters must be set before you can add + # includeMyGroupApprovals. + if ([string]::IsNullOrEmpty($AssignedToFilter) -eq $false -and + [string]::IsNullOrEmpty($ReleaseIdsFilter) -eq $false -and + $StatusFilter -eq 'Pending') { + $queryString.includeMyGroupApprovals = 'true'; + } + } + + # Call the REST API + $resp = _callAPI -ProjectName $ProjectName -Area release -Resource approvals -SubDomain vsrm -Version $(_getApiVersion Release) -QueryString $queryString + + # Apply a Type Name so we can use custom format view and custom type extensions + foreach ($item in $resp.value) { + _applyTypesToApproval -item $item + } + + Write-Output $resp.value + } + catch { + _handleException $_ + } + } } \ No newline at end of file diff --git a/Source/Public/Get-VSTeamBuild.ps1 b/Source/Public/Get-VSTeamBuild.ps1 index 39c4968fd..223ee846e 100644 --- a/Source/Public/Get-VSTeamBuild.ps1 +++ b/Source/Public/Get-VSTeamBuild.ps1 @@ -1,91 +1,91 @@ -function Get-VSTeamBuild { - [CmdletBinding(DefaultParameterSetName = 'List')] - param ( - [Parameter(ParameterSetName = 'List')] - [int] $Top, - - [Parameter(ParameterSetName = 'List')] - [ValidateSet('succeeded', 'partiallySucceeded', 'failed', 'canceled')] - [string] $ResultFilter, - - [Parameter(ParameterSetName = 'List')] - [ValidateSet('manual', 'individualCI', 'batchedCI', 'schedule', 'userCreated', 'validateShelveset', 'checkInShelveset', 'triggered', 'all')] - [string] $ReasonFilter, - - [Parameter(ParameterSetName = 'List')] - [ValidateSet('inProgress', 'completed', 'cancelling', 'postponed', 'notStarted', 'all')] - [string] $StatusFilter, - - [Parameter(ParameterSetName = 'List')] - [int[]] $Queues, - - [Parameter(ParameterSetName = 'List')] - [int[]] $Definitions, - - [Parameter(ParameterSetName = 'List')] - [string] $BuildNumber, - - [Parameter(ParameterSetName = 'List')] - [ValidateSet('build', 'xaml')] - [string] $Type, - - [Parameter(ParameterSetName = 'List')] - [int] $MaxBuildsPerDefinition, - - [Parameter(ParameterSetName = 'List')] - [string[]] $Properties, - - [Parameter(ParameterSetName = 'ByID', ValueFromPipeline = $true)] - [Alias('BuildID')] - [int[]] $Id - ) - - DynamicParam { - _buildProjectNameDynamicParam - } - - process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - try { - if ($id) { - foreach ($item in $id) { - # Build the url to return the single build - $resp = _callAPI -ProjectName $projectName -Area 'build' -Resource 'builds' -id $item ` - -Version $(_getApiVersion Build) - - _applyTypesToBuild -item $resp - - Write-Output $resp - } - } - else { - # Build the url to list the builds - $resp = _callAPI -ProjectName $projectName -Area 'build' -Resource 'builds' ` - -Version $(_getApiVersion Build) ` - -Querystring @{ - '$top' = $top - 'type' = $type - 'buildNumber' = $buildNumber - 'resultFilter' = $resultFilter - 'statusFilter' = $statusFilter - 'reasonFilter' = $reasonFilter - 'maxBuildsPerDefinition' = $maxBuildsPerDefinition - 'queues' = ($queues -join ',') - 'properties' = ($properties -join ',') - 'definitions' = ($definitions -join ',') - } - - # Apply a Type Name so we can use custom format view and custom type extensions - foreach ($item in $resp.value) { - _applyTypesToBuild -item $item - } - - Write-Output $resp.value - } - } - catch { - _handleException $_ - } - } +function Get-VSTeamBuild { + [CmdletBinding(DefaultParameterSetName = 'List')] + param ( + [Parameter(ParameterSetName = 'List')] + [int] $Top, + + [Parameter(ParameterSetName = 'List')] + [ValidateSet('succeeded', 'partiallySucceeded', 'failed', 'canceled')] + [string] $ResultFilter, + + [Parameter(ParameterSetName = 'List')] + [ValidateSet('manual', 'individualCI', 'batchedCI', 'schedule', 'userCreated', 'validateShelveset', 'checkInShelveset', 'triggered', 'all')] + [string] $ReasonFilter, + + [Parameter(ParameterSetName = 'List')] + [ValidateSet('inProgress', 'completed', 'cancelling', 'postponed', 'notStarted', 'all')] + [string] $StatusFilter, + + [Parameter(ParameterSetName = 'List')] + [int[]] $Queues, + + [Parameter(ParameterSetName = 'List')] + [int[]] $Definitions, + + [Parameter(ParameterSetName = 'List')] + [string] $BuildNumber, + + [Parameter(ParameterSetName = 'List')] + [ValidateSet('build', 'xaml')] + [string] $Type, + + [Parameter(ParameterSetName = 'List')] + [int] $MaxBuildsPerDefinition, + + [Parameter(ParameterSetName = 'List')] + [string[]] $Properties, + + [Parameter(ParameterSetName = 'ByID', ValueFromPipeline = $true)] + [Alias('BuildID')] + + [int[]] $Id, + + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName + ) + + process { + try { + if ($id) { + foreach ($item in $id) { + # Build the url to return the single build + $resp = _callAPI -ProjectName $projectName -Area 'build' -Resource 'builds' -id $item ` + -Version $(_getApiVersion Build) + + _applyTypesToBuild -item $resp + + Write-Output $resp + } + } + else { + # Build the url to list the builds + $resp = _callAPI -ProjectName $projectName -Area 'build' -Resource 'builds' ` + -Version $(_getApiVersion Build) ` + -Querystring @{ + '$top' = $top + 'type' = $type + 'buildNumber' = $buildNumber + 'resultFilter' = $resultFilter + 'statusFilter' = $statusFilter + 'reasonFilter' = $reasonFilter + 'maxBuildsPerDefinition' = $maxBuildsPerDefinition + 'queues' = ($queues -join ',') + 'properties' = ($properties -join ',') + 'definitions' = ($definitions -join ',') + } + + # Apply a Type Name so we can use custom format view and custom type extensions + foreach ($item in $resp.value) { + _applyTypesToBuild -item $item + } + + Write-Output $resp.value + } + } + catch { + _handleException $_ + } + } } \ No newline at end of file diff --git a/Source/Public/Get-VSTeamBuildArtifact.ps1 b/Source/Public/Get-VSTeamBuildArtifact.ps1 index 2f2f35e13..4fcdb6e10 100644 --- a/Source/Public/Get-VSTeamBuildArtifact.ps1 +++ b/Source/Public/Get-VSTeamBuildArtifact.ps1 @@ -1,24 +1,22 @@ -function Get-VSTeamBuildArtifact { - param( - [parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [Alias('BuildID')] - [int] $Id - ) - - DynamicParam { - _buildProjectNameDynamicParam - } - - Process { - $ProjectName = $PSBoundParameters["ProjectName"] - - $resp = _callAPI -ProjectName $projectName -Area 'build' -Resource "builds/$Id/artifacts" ` - -Version $(_getApiVersion Build) - - foreach ($item in $resp.value) { - _applyArtifactTypes -item $item - } - - Write-Output $resp.value - } +function Get-VSTeamBuildArtifact { + param( + [parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [Alias('BuildID')] + [int] $Id, + + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName + ) + process { + $resp = _callAPI -ProjectName $projectName -Area 'build' -Resource "builds/$Id/artifacts" ` + -Version $(_getApiVersion Build) + + foreach ($item in $resp.value) { + _applyArtifactTypes -item $item + } + + Write-Output $resp.value + } } \ No newline at end of file diff --git a/Source/Public/Get-VSTeamBuildDefinition.ps1 b/Source/Public/Get-VSTeamBuildDefinition.ps1 index ddea8063b..797e5ab58 100644 --- a/Source/Public/Get-VSTeamBuildDefinition.ps1 +++ b/Source/Public/Get-VSTeamBuildDefinition.ps1 @@ -1,70 +1,68 @@ -function Get-VSTeamBuildDefinition { - [CmdletBinding(DefaultParameterSetName = 'List')] - param( - [Parameter(ParameterSetName = 'List')] - [string] $Filter, - - [Parameter(ParameterSetName = 'List')] - [ValidateSet('build', 'xaml', 'All')] - [string] $Type = 'All', - - [Parameter(Position = 0, Mandatory = $true, ParameterSetName = 'ByIdRaw')] - [Parameter(Position = 0, Mandatory = $true, ParameterSetName = 'ByIdJson')] - [Parameter(Position = 0, ParameterSetName = 'ByID', Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [Alias('BuildDefinitionID')] - [int[]] $Id, - - [Parameter(ParameterSetName = 'ByIdRaw')] - [Parameter(ParameterSetName = 'ByIdJson')] - [Parameter(ParameterSetName = 'ByID')] - [int] $Revision, - - [Parameter(Mandatory = $true, ParameterSetName = 'ByIdJson')] - [switch]$JSON, - - [Parameter(Mandatory = $true, ParameterSetName = 'ByIdRaw')] - [switch]$raw - ) - - DynamicParam { - _buildProjectNameDynamicParam - } - - process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - - if ($id) { - foreach ($item in $id) { - $resp = _callAPI -ProjectName $ProjectName -Id $item -Area build -Resource definitions -Version $(_getApiVersion Build) ` - -QueryString @{revision = $revision } - - if ($JSON.IsPresent) { - $resp | ConvertTo-Json -Depth 99 - } - else { - if (-not $raw.IsPresent) { - $item = [VSTeamBuildDefinition]::new($resp, $ProjectName) - - Write-Output $item - } - else { - Write-Output $resp - } - } - } - } - else { - $resp = _callAPI -ProjectName $ProjectName -Area build -Resource definitions -Version $(_getApiVersion Build) ` - -QueryString @{type = $type; name = $filter; includeAllProperties = $true } - - $objs = @() - - foreach ($item in $resp.value) { - $objs += [VSTeamBuildDefinition]::new($item, $ProjectName) - } - - Write-Output $objs - } - } +function Get-VSTeamBuildDefinition { + [CmdletBinding(DefaultParameterSetName = 'List')] + param( + [Parameter(ParameterSetName = 'List')] + [string] $Filter, + + [ValidateSet('build', 'xaml', 'All')] + [Parameter(ParameterSetName = 'List')] + [string] $Type = 'All', + + [Alias('BuildDefinitionID')] + [Parameter(Position = 0, Mandatory = $true, ParameterSetName = 'ByIdRaw')] + [Parameter(Position = 0, Mandatory = $true, ParameterSetName = 'ByIdJson')] + [Parameter(Position = 0, ParameterSetName = 'ByID', Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [int[]] $Id, + + [Parameter(ParameterSetName = 'ByID')] + [Parameter(ParameterSetName = 'ByIdRaw')] + [Parameter(ParameterSetName = 'ByIdJson')] + [int] $Revision, + + [Parameter(Mandatory = $true, ParameterSetName = 'ByIdJson')] + [switch] $JSON, + + [Parameter(Mandatory = $true, ParameterSetName = 'ByIdRaw')] + [switch] $raw, + + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [string] $ProjectName + ) + + process { + if ($id) { + foreach ($item in $id) { + $resp = _callAPI -ProjectName $ProjectName -Id $item -Area build -Resource definitions -Version $(_getApiVersion Build) ` + -QueryString @{revision = $revision } + + if ($JSON.IsPresent) { + $resp | ConvertTo-Json -Depth 99 + } + else { + if (-not $raw.IsPresent) { + $item = [VSTeamBuildDefinition]::new($resp, $ProjectName) + + Write-Output $item + } + else { + Write-Output $resp + } + } + } + } + else { + $resp = _callAPI -ProjectName $ProjectName -Area build -Resource definitions -Version $(_getApiVersion Build) ` + -QueryString @{type = $type; name = $filter; includeAllProperties = $true } + + $objs = @() + + foreach ($item in $resp.value) { + $objs += [VSTeamBuildDefinition]::new($item, $ProjectName) + } + + Write-Output $objs + } + } } \ No newline at end of file diff --git a/Source/Public/Get-VSTeamBuildLog.ps1 b/Source/Public/Get-VSTeamBuildLog.ps1 index 31858a0e0..d2419836a 100644 --- a/Source/Public/Get-VSTeamBuildLog.ps1 +++ b/Source/Public/Get-VSTeamBuildLog.ps1 @@ -1,40 +1,38 @@ -function Get-VSTeamBuildLog { - [CmdletBinding(DefaultParameterSetName = 'ByID')] - param ( - [Parameter(Mandatory = $true, ParameterSetName = 'ByID', ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [Alias('BuildID')] - [int[]] $Id, - [int] $Index - ) - - DynamicParam { - _buildProjectNameDynamicParam - } - - process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - - foreach ($item in $id) { - if (-not $Index) { - # Build the url to return the logs of the build - # Call the REST API to get the number of logs for the build - $resp = _callAPI -ProjectName $projectName -Area 'build' -Resource "builds/$item/logs" ` - -Version $(_getApiVersion Build) - - $fullLogIndex = $($resp.count - 1) - } - else { - $fullLogIndex = $Index - } - - # Now call REST API with the index for the fullLog - # Build the url to return the single build - # Call the REST API to get the number of logs for the build - $resp = _callAPI -ProjectName $projectName -Area 'build' -Resource "builds/$item/logs" -id $fullLogIndex ` - -Version $(_getApiVersion Build) - - Write-Output $resp - } - } +function Get-VSTeamBuildLog { + [CmdletBinding(DefaultParameterSetName = 'ByID')] + param ( + [Parameter(Mandatory = $true, ParameterSetName = 'ByID', ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [Alias('BuildID')] + [int[]] $Id, + + [int] $Index, + + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [string] $ProjectName + ) + process { + foreach ($item in $id) { + if (-not $Index) { + # Build the url to return the logs of the build + # Call the REST API to get the number of logs for the build + $resp = _callAPI -ProjectName $projectName -Area 'build' -Resource "builds/$item/logs" ` + -Version $(_getApiVersion Build) + + $fullLogIndex = $($resp.count - 1) + } + else { + $fullLogIndex = $Index + } + + # Now call REST API with the index for the fullLog + # Build the url to return the single build + # Call the REST API to get the number of logs for the build + $resp = _callAPI -ProjectName $projectName -Area 'build' -Resource "builds/$item/logs" -id $fullLogIndex ` + -Version $(_getApiVersion Build) + + Write-Output $resp + } + } } \ No newline at end of file diff --git a/Source/Public/Get-VSTeamBuildTag.ps1 b/Source/Public/Get-VSTeamBuildTag.ps1 index ee828741e..59513b922 100644 --- a/Source/Public/Get-VSTeamBuildTag.ps1 +++ b/Source/Public/Get-VSTeamBuildTag.ps1 @@ -1,21 +1,19 @@ -function Get-VSTeamBuildTag { - param( - [parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [Alias('BuildID')] - [int] $Id - ) - - DynamicParam { - _buildProjectNameDynamicParam - } - - Process { - $ProjectName = $PSBoundParameters["ProjectName"] - - # Call the REST API - $resp = _callAPI -ProjectName $projectName -Area 'build' -Resource "builds/$Id/tags" ` - -Version $(_getApiVersion Build) - - return $resp.value - } -} \ No newline at end of file +function Get-VSTeamBuildTag { + param( + [parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [Alias('BuildID')] + [int] $Id, + + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName + ) + process { + # Call the REST API + $resp = _callAPI -ProjectName $projectName -Area 'build' -Resource "builds/$Id/tags" ` + -Version $(_getApiVersion Build) + + return $resp.value + } +} diff --git a/Source/Public/Get-VSTeamClassificationNode.ps1 b/Source/Public/Get-VSTeamClassificationNode.ps1 index ff00dbee7..3c2d30f6e 100644 --- a/Source/Public/Get-VSTeamClassificationNode.ps1 +++ b/Source/Public/Get-VSTeamClassificationNode.ps1 @@ -1,86 +1,84 @@ -function Get-VSTeamClassificationNode { - [CmdletBinding(DefaultParameterSetName = 'ByIds')] - param( - [ValidateSet("areas", "iterations")] - [Parameter(Mandatory = $true, ParameterSetName="ByPath")] - [string] $StructureGroup, - - [Parameter(Mandatory = $false, ParameterSetName="ByPath")] - [string] $Path, - - [Parameter(Mandatory = $false, ParameterSetName="ByIds")] - [int[]] $Ids, - - [Parameter(Mandatory = $false, ParameterSetName="ByPath")] - [Parameter(Mandatory = $false, ParameterSetName="ByIds")] - [int] $Depth - ) - - DynamicParam { - _buildProjectNameDynamicParam -Mandatory $true - } - - process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - $id = $StructureGroup - - $Path = [uri]::UnescapeDataString($Path) - - if ($Path) - { - $Path = [uri]::EscapeUriString($Path) - $Path = $Path.TrimStart("/") - $id += "/$Path" - } - - $queryString = @{} - if ($Depth) - { - $queryString.Add("`$Depth", $Depth) - } - - if ($Ids) - { - $queryString.Add("Ids", $Ids -join ",") - } - - if ($queryString.Count -gt 0) - { - # Call the REST API - $resp = _callAPI -ProjectName $ProjectName -Area 'wit' -Resource "classificationnodes" -id $id ` - -Version $(_getApiVersion Core) ` - -QueryString $queryString - } else { - # Call the REST API - $resp = _callAPI -ProjectName $ProjectName -Area 'wit' -Resource "classificationnodes" -id $id ` - -Version $(_getApiVersion Core) ` - } - - if ([bool]($resp.PSobject.Properties.name -match "value")) - { - try { - $objs = @() - - foreach ($item in $resp.value) { - $objs += [VSTeamClassificationNode]::new($item, $ProjectName) - } - - Write-Output $objs - } - catch { - # I catch because using -ErrorAction Stop on the Invoke-RestMethod - # was still running the foreach after and reporting useless errors. - # This casuses the first error to terminate this execution. - _handleException $_ - } - } else { - # Storing the object before you return it cleaned up the pipeline. - # When I just write the object from the constructor each property - # seemed to be written - $classificationNode = [VSTeamClassificationNode]::new($resp, $ProjectName) - - Write-Output $classificationNode - } - } +function Get-VSTeamClassificationNode { + [CmdletBinding(DefaultParameterSetName = 'ByIds')] + param( + [ValidateSet("areas", "iterations")] + [Parameter(Mandatory = $true, ParameterSetName = "ByPath")] + [string] $StructureGroup, + + [Parameter(Mandatory = $false, ParameterSetName = "ByPath")] + [string] $Path, + + [Parameter(Mandatory = $false, ParameterSetName = "ByIds")] + [int[]] $Ids, + + [Parameter(Mandatory = $false, ParameterSetName = "ByPath")] + [Parameter(Mandatory = $false, ParameterSetName = "ByIds")] + [int] $Depth, + + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName + ) + + process { + $id = $StructureGroup + + $Path = [uri]::UnescapeDataString($Path) + + if ($Path) { + $Path = [uri]::EscapeUriString($Path) + $Path = $Path.TrimStart("/") + $id += "/$Path" + } + + $queryString = @{ } + + if ($Depth) { + $queryString.Add("`$Depth", $Depth) + } + + if ($Ids) { + $queryString.Add("Ids", $Ids -join ",") + } + + if ($queryString.Count -gt 0) { + # Call the REST API + $resp = _callAPI -ProjectName $ProjectName -Area 'wit' -Resource "classificationnodes" -id $id ` + -Version $(_getApiVersion Core) ` + -QueryString $queryString + } + else { + # Call the REST API + $resp = _callAPI -ProjectName $ProjectName -Area 'wit' -Resource "classificationnodes" -id $id ` + -Version $(_getApiVersion Core) ` + + } + + if ([bool]($resp.PSobject.Properties.name -match "value")) { + try { + $objs = @() + + foreach ($item in $resp.value) { + $objs += [VSTeamClassificationNode]::new($item, $ProjectName) + } + + Write-Output $objs + } + catch { + # I catch because using -ErrorAction Stop on the Invoke-RestMethod + # was still running the foreach after and reporting useless errors. + # This casuses the first error to terminate this execution. + _handleException $_ + } + } + else { + # Storing the object before you return it cleaned up the pipeline. + # When I just write the object from the constructor each property + # seemed to be written + $classificationNode = [VSTeamClassificationNode]::new($resp, $ProjectName) + + Write-Output $classificationNode + } + } } \ No newline at end of file diff --git a/Source/Public/Get-VSTeamCloudSubscription.ps1 b/Source/Public/Get-VSTeamCloudSubscription.ps1 index 29451ddbe..ee3763768 100644 --- a/Source/Public/Get-VSTeamCloudSubscription.ps1 +++ b/Source/Public/Get-VSTeamCloudSubscription.ps1 @@ -1,15 +1,15 @@ -function Get-VSTeamCloudSubscription { - [CmdletBinding()] - param() - - # Call the REST API - $resp = _callAPI -Area 'distributedtask' -Resource 'serviceendpointproxy/azurermsubscriptions' ` - -Version $(_getApiVersion DistributedTask) -NoProject - - # Apply a Type Name so we can use custom format view and custom type extensions - foreach ($item in $resp.value) { - _applyTypesToAzureSubscription -item $item - } - - Write-Output $resp.value -} \ No newline at end of file +function Get-VSTeamCloudSubscription { + [CmdletBinding()] + param() + + # Call the REST API + $resp = _callAPI -Area 'distributedtask' -Resource 'serviceendpointproxy/azurermsubscriptions' ` + -Version $(_getApiVersion DistributedTask) -NoProject + + # Apply a Type Name so we can use custom format view and custom type extensions + foreach ($item in $resp.value) { + _applyTypesToAzureSubscription -item $item + } + + Write-Output $resp.value +} diff --git a/Source/Public/Get-VSTeamDescriptor.ps1 b/Source/Public/Get-VSTeamDescriptor.ps1 index 0a8e7aff4..61c6244d7 100644 --- a/Source/Public/Get-VSTeamDescriptor.ps1 +++ b/Source/Public/Get-VSTeamDescriptor.ps1 @@ -1,24 +1,24 @@ -function Get-VSTeamDescriptor { - [CmdletBinding(DefaultParameterSetName = 'ByStorageKey')] - param( - [Parameter(ParameterSetName = 'ByStorageKey', Mandatory = $true)] - [string] $StorageKey - ) - - process { - # This will throw if this account does not support the graph API - _supportsGraph - - # Call the REST API - $resp = _callAPI -Area 'graph' -Resource 'descriptors' -id $StorageKey ` - -Version $(_getApiVersion Graph) ` - -SubDomain 'vssps' -NoProject - - # Storing the object before you return it cleaned up the pipeline. - # When I just write the object from the constructor each property - # seemed to be written - $descriptor = [VSTeamDescriptor]::new($resp) - - Write-Output $descriptor - } -} \ No newline at end of file +function Get-VSTeamDescriptor { + [CmdletBinding(DefaultParameterSetName = 'ByStorageKey')] + param( + [Parameter(ParameterSetName = 'ByStorageKey', Mandatory = $true)] + [string] $StorageKey + ) + + process { + # This will throw if this account does not support the graph API + _supportsGraph + + # Call the REST API + $resp = _callAPI -Area 'graph' -Resource 'descriptors' -id $StorageKey ` + -Version $(_getApiVersion Graph) ` + -SubDomain 'vssps' -NoProject + + # Storing the object before you return it cleaned up the pipeline. + # When I just write the object from the constructor each property + # seemed to be written + $descriptor = [VSTeamDescriptor]::new($resp) + + Write-Output $descriptor + } +} diff --git a/Source/Public/Get-VSTeamExtension.ps1 b/Source/Public/Get-VSTeamExtension.ps1 index 6f68c9edc..90e02d8df 100644 --- a/Source/Public/Get-VSTeamExtension.ps1 +++ b/Source/Public/Get-VSTeamExtension.ps1 @@ -15,6 +15,7 @@ function Get-VSTeamExtension { [Parameter(ParameterSetName = 'GetById', Mandatory = $true)] [string] $ExtensionId ) + Process { if ($PublisherId -and $ExtensionId) { diff --git a/Source/Public/Get-VSTeamFeed.ps1 b/Source/Public/Get-VSTeamFeed.ps1 index 2548fd130..9fde66284 100644 --- a/Source/Public/Get-VSTeamFeed.ps1 +++ b/Source/Public/Get-VSTeamFeed.ps1 @@ -1,36 +1,36 @@ -function Get-VSTeamFeed { - [CmdletBinding(DefaultParameterSetName = 'List')] - param ( - [Parameter(ParameterSetName = 'ByID', Position = 0)] - [Alias('FeedId')] - [string[]] $Id - ) - - process { - # Thi swill throw if this account does not support feeds - _supportsFeeds - - if ($id) { - foreach ($item in $id) { - $resp = _callAPI -NoProject -subDomain feeds -Id $item -Area packaging -Resource feeds -Version $(_getApiVersion Packaging) - - Write-Verbose $resp - $item = [VSTeamFeed]::new($resp) - - Write-Output $item - } - } - else { - $resp = _callAPI -NoProject -subDomain feeds -Area packaging -Resource feeds -Version $(_getApiVersion Packaging) - - $objs = @() - - foreach ($item in $resp.value) { - Write-Verbose $item - $objs += [VSTeamFeed]::new($item) - } - - Write-Output $objs - } - } +function Get-VSTeamFeed { + [CmdletBinding(DefaultParameterSetName = 'List')] + param ( + [Parameter(ParameterSetName = 'ByID', Position = 0)] + [Alias('FeedId')] + [string[]] $Id + ) + + process { + # Thi swill throw if this account does not support feeds + _supportsFeeds + + if ($id) { + foreach ($item in $id) { + $resp = _callAPI -NoProject -subDomain feeds -Id $item -Area packaging -Resource feeds -Version $(_getApiVersion Packaging) + + Write-Verbose $resp + $item = [VSTeamFeed]::new($resp) + + Write-Output $item + } + } + else { + $resp = _callAPI -NoProject -subDomain feeds -Area packaging -Resource feeds -Version $(_getApiVersion Packaging) + + $objs = @() + + foreach ($item in $resp.value) { + Write-Verbose $item + $objs += [VSTeamFeed]::new($item) + } + + Write-Output $objs + } + } } \ No newline at end of file diff --git a/Source/Public/Get-VSTeamGitCommit.ps1 b/Source/Public/Get-VSTeamGitCommit.ps1 index 466a2afe4..c56904568 100644 --- a/Source/Public/Get-VSTeamGitCommit.ps1 +++ b/Source/Public/Get-VSTeamGitCommit.ps1 @@ -1,5 +1,5 @@ function Get-VSTeamGitCommit { - [CmdletBinding(DefaultParameterSetName='All')] + [CmdletBinding(DefaultParameterSetName = 'All')] param ( [Parameter(ParameterSetName = 'All', ValueFromPipelineByPropertyName = $true, Mandatory = $true, Position = 0)] [Parameter(ParameterSetName = 'ItemVersion', ValueFromPipelineByPropertyName = $true, Mandatory = $true, Position = 0)] @@ -8,130 +8,144 @@ function Get-VSTeamGitCommit { [Parameter(ParameterSetName = 'ItemPath', ValueFromPipelineByPropertyName = $true, Mandatory = $true, Position = 0)] [Alias('Id')] [Guid] $RepositoryID, - [Parameter(ParameterSetName = 'All', HelpMessage="FromDate, in UTC")] - [Parameter(ParameterSetName = 'ItemVersion', HelpMessage="FromDate, in UTC")] - [Parameter(ParameterSetName = 'CompareVersion', HelpMessage="FromDate, in UTC")] - [Parameter(ParameterSetName = 'ItemPath', HelpMessage="FromDate, in UTC")] + + [Parameter(ParameterSetName = 'All', HelpMessage = "FromDate, in UTC")] + [Parameter(ParameterSetName = 'ItemVersion', HelpMessage = "FromDate, in UTC")] + [Parameter(ParameterSetName = 'CompareVersion', HelpMessage = "FromDate, in UTC")] + [Parameter(ParameterSetName = 'ItemPath', HelpMessage = "FromDate, in UTC")] [DateTime] $FromDate, - [Parameter(ParameterSetName = 'All', HelpMessage="ToDate, in UTC")] - [Parameter(ParameterSetName = 'ItemVersion', HelpMessage="ToDate, in UTC")] - [Parameter(ParameterSetName = 'CompareVersion', HelpMessage="ToDate, in UTC")] - [Parameter(ParameterSetName = 'ItemPath', HelpMessage="ToDate, in UTC")] + + [Parameter(ParameterSetName = 'All', HelpMessage = "ToDate, in UTC")] + [Parameter(ParameterSetName = 'ItemVersion', HelpMessage = "ToDate, in UTC")] + [Parameter(ParameterSetName = 'CompareVersion', HelpMessage = "ToDate, in UTC")] + [Parameter(ParameterSetName = 'ItemPath', HelpMessage = "ToDate, in UTC")] [DateTime] $ToDate, + [Parameter(ParameterSetName = 'All')] [Parameter(ParameterSetName = 'ItemVersion', Mandatory = $true)] [Parameter(ParameterSetName = 'CompareVersion')] [Parameter(ParameterSetName = 'ItemPath')] [ValidateSet('branch', 'commit', 'tag')] [string] $ItemVersionVersionType, + [Parameter(ParameterSetName = 'All')] [Parameter(ParameterSetName = 'ItemVersion', Mandatory = $true)] [Parameter(ParameterSetName = 'CompareVersion')] [Parameter(ParameterSetName = 'ItemPath')] [string] $ItemVersionVersion, + [Parameter(ParameterSetName = 'All')] [Parameter(ParameterSetName = 'ItemVersion', Mandatory = $false)] [Parameter(ParameterSetName = 'CompareVersion')] [Parameter(ParameterSetName = 'ItemPath')] [ValidateSet('firstParent', 'none', 'previousChange')] [string] $ItemVersionVersionOptions, + [Parameter(ParameterSetName = 'All')] [Parameter(ParameterSetName = 'CompareVersion', Mandatory = $true)] [Parameter(ParameterSetName = 'ItemVersion')] [Parameter(ParameterSetName = 'ItemPath')] [ValidateSet('branch', 'commit', 'tag')] [string] $CompareVersionVersionType, + [Parameter(ParameterSetName = 'All')] [Parameter(ParameterSetName = 'CompareVersion', Mandatory = $true)] [Parameter(ParameterSetName = 'ItemVersion')] [Parameter(ParameterSetName = 'ItemPath')] [string] $CompareVersionVersion, + [Parameter(ParameterSetName = 'All')] [Parameter(ParameterSetName = 'CompareVersion', Mandatory = $false)] [Parameter(ParameterSetName = 'ItemVersion')] [Parameter(ParameterSetName = 'ItemPath')] [ValidateSet('firstParent', 'none', 'previousChange')] [string] $CompareVersionVersionOptions, + [Parameter(ParameterSetName = 'All')] [Parameter(ParameterSetName = 'ItemVersion')] [Parameter(ParameterSetName = 'CompareVersion')] [Parameter(ParameterSetName = 'ItemPath')] [string] $FromCommitId, + [Parameter(ParameterSetName = 'All')] [Parameter(ParameterSetName = 'ItemVersion')] [Parameter(ParameterSetName = 'CompareVersion')] [Parameter(ParameterSetName = 'ItemPath')] [string] $ToCommitId, + [Parameter(ParameterSetName = 'All')] [Parameter(ParameterSetName = 'ItemVersion')] [Parameter(ParameterSetName = 'CompareVersion')] [Parameter(ParameterSetName = 'ItemPath')] [string] $Author, + [Parameter(ParameterSetName = "ByIds")] [string[]] $Ids, + [Parameter(ParameterSetName = 'All')] [Parameter(ParameterSetName = 'ItemPath', Mandatory = $true)] [string] $ItemPath, + [Parameter(ParameterSetName = 'ItemPath')] [switch] $ExcludeDeletes, + [Parameter(ParameterSetName = 'All')] [Parameter(ParameterSetName = 'ItemVersion')] [Parameter(ParameterSetName = 'CompareVersion')] [Parameter(ParameterSetName = 'ItemPath')] [int] $Top, + [Parameter(ParameterSetName = 'All')] [Parameter(ParameterSetName = 'ItemVersion')] [Parameter(ParameterSetName = 'CompareVersion')] [Parameter(ParameterSetName = 'ItemPath')] [int] $Skip, + [Parameter(ParameterSetName = 'ItemPath')] - [ValidateSet('firstParent','fullHistory','fullHistorySimplifyMerges','simplifiedHistory')] + [ValidateSet('firstParent', 'fullHistory', 'fullHistorySimplifyMerges', 'simplifiedHistory')] [string] $HistoryMode, + [Parameter(ParameterSetName = 'All')] [Parameter(ParameterSetName = 'ItemVersion')] [Parameter(ParameterSetName = 'CompareVersion')] [Parameter(ParameterSetName = 'ItemPath')] - [string] $User + [string] $User, + + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName ) - DynamicParam { - _buildProjectNameDynamicParam - } - process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - - if (($ItemVersionVersionType -eq "commit") -and ($null -eq $ItemVersionVersion -or $ItemVersionVersion -eq '')) - { + if (($ItemVersionVersionType -eq "commit") -and ($null -eq $ItemVersionVersion -or $ItemVersionVersion -eq '')) { throw "If you have a -ItemVersionVersionType of 'commit' you need to set a commit id as -ItemVersionVersion"; } - if (($CompareVersionVersionType -eq "commit") -and ($null -eq $CompareVersionVersion -or $CompareVersionVersion -eq '')) - { + if (($CompareVersionVersionType -eq "commit") -and ($null -eq $CompareVersionVersion -or $CompareVersionVersion -eq '')) { throw "If you have a -CompareVersionVersionType of 'commit' you need to set a commit id as -CompareVersionVersion"; } try { $queryString = @{ - 'searchCriteria.fromDate' = if ($FromDate) { $FromDate.ToString('yyyy-MM-ddTHH:mm:ssZ') } else { $null } - 'searchCriteria.toDate' = if ($ToDate) { $ToDate.ToString('yyyy-MM-ddTHH:mm:ssZ') } else { $null } - 'searchCriteria.itemVersion.versionType' = $ItemVersionVersionType - 'searchCriteria.itemVersion.version' = $ItemVersionVersion - 'searchCriteria.itemVersion.versionOptions' = $ItemVersionVersionOptions - 'searchCriteria.compareVersion.versionType' = $CompareVersionVersionType - 'searchCriteria.compareVersion.version' = $CompareVersionVersion - 'searchCriteria.compareVersion.versionOptions' = $CompareVersionVersionOptions - 'searchCriteria.fromCommitId' = $FromCommitId - 'searchCriteria.toCommitId' = $ToCommitId - 'searchCriteria.author' = $Author - 'searchCriteria.ids' = $Ids - 'searchCriteria.itemPath' = $ItemPath - 'searchCriteria.excludeDeletes' = $ExcludeDeletes - 'searchCriteria.historyMode' = $HistoryMode - 'searchCriteria.$top' = $Top - 'searchCriteria.$skip' = $Skip - 'searchCriteria.user' = $User + 'searchCriteria.fromDate' = if ($FromDate) { $FromDate.ToString('yyyy-MM-ddTHH:mm:ssZ') } else { $null } + 'searchCriteria.toDate' = if ($ToDate) { $ToDate.ToString('yyyy-MM-ddTHH:mm:ssZ') } else { $null } + 'searchCriteria.itemVersion.versionType' = $ItemVersionVersionType + 'searchCriteria.itemVersion.version' = $ItemVersionVersion + 'searchCriteria.itemVersion.versionOptions' = $ItemVersionVersionOptions + 'searchCriteria.compareVersion.versionType' = $CompareVersionVersionType + 'searchCriteria.compareVersion.version' = $CompareVersionVersion + 'searchCriteria.compareVersion.versionOptions' = $CompareVersionVersionOptions + 'searchCriteria.fromCommitId' = $FromCommitId + 'searchCriteria.toCommitId' = $ToCommitId + 'searchCriteria.author' = $Author + 'searchCriteria.ids' = $Ids + 'searchCriteria.itemPath' = $ItemPath + 'searchCriteria.excludeDeletes' = $ExcludeDeletes + 'searchCriteria.historyMode' = $HistoryMode + 'searchCriteria.$top' = $Top + 'searchCriteria.$skip' = $Skip + 'searchCriteria.user' = $User } $resp = _callAPI -ProjectName $ProjectName -Id "$RepositoryID/commits" -Area git -Resource repositories -Version $(_getApiVersion Git) -QueryString $queryString diff --git a/Source/Public/Get-VSTeamGitRef.ps1 b/Source/Public/Get-VSTeamGitRef.ps1 index f04543290..43823df01 100644 --- a/Source/Public/Get-VSTeamGitRef.ps1 +++ b/Source/Public/Get-VSTeamGitRef.ps1 @@ -1,49 +1,46 @@ -function Get-VSTeamGitRef { - [CmdletBinding()] - param ( - [Parameter(ValueFromPipelineByPropertyName = $true, Mandatory = $true)] - [Alias('Id')] - [guid] $RepositoryID, - [Parameter()] - [string] $Filter, - [Parameter()] - [string] $FilterContains, - [Parameter()] - [int] $Top, - [Parameter()] - [string] $ContinuationToken - ) - - DynamicParam { - _buildProjectNameDynamicParam - } - - process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - - try { - - $queryString = @{ - '$top' = $Top - 'filter' = $Filter - 'filterContains' = $FilterContains - 'continuationToken' = $continuationToken - } - - $url = _buildRequestURI -Area git -Resource repositories -Version $(_getApiVersion Git) -ProjectName $ProjectName -Id "$RepositoryID/refs" - $resp = _callAPI -url $url -QueryString $queryString - - $obj = @() - - foreach ($item in $resp.value) { - $obj += [VSTeamRef]::new($item, $ProjectName) - } - - Write-Output $obj - } - catch { - throw $_ - } - } -} \ No newline at end of file +function Get-VSTeamGitRef { + [CmdletBinding()] + param ( + [Parameter(ValueFromPipelineByPropertyName = $true, Mandatory = $true, Position = 0)] + [Alias('Id')] + [guid] $RepositoryID, + + [string] $Filter, + + [string] $FilterContains, + + [int] $Top, + + [string] $ContinuationToken, + + [Parameter(Mandatory = $true, Position = 1, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName + ) + process { + try { + + $queryString = @{ + '$top' = $Top + 'filter' = $Filter + 'filterContains' = $FilterContains + 'continuationToken' = $continuationToken + } + + $url = _buildRequestURI -Area git -Resource repositories -Version $(_getApiVersion Git) -ProjectName $ProjectName -Id "$RepositoryID/refs" + $resp = _callAPI -url $url -QueryString $queryString + + $obj = @() + + foreach ($item in $resp.value) { + $obj += [VSTeamRef]::new($item, $ProjectName) + } + + Write-Output $obj + } + catch { + throw $_ + } + } +} diff --git a/Source/Public/Get-VSTeamGitRepository.ps1 b/Source/Public/Get-VSTeamGitRepository.ps1 index dda6af3d6..cef9991a2 100644 --- a/Source/Public/Get-VSTeamGitRepository.ps1 +++ b/Source/Public/Get-VSTeamGitRepository.ps1 @@ -1,70 +1,68 @@ -function Get-VSTeamGitRepository { - [CmdletBinding(DefaultParameterSetName = 'ByID')] - param ( - [Parameter(ParameterSetName = 'ByID', ValueFromPipeline = $true)] - [Alias('RepositoryID')] - [guid[]] $Id, - - [Parameter(ParameterSetName = 'ByName', ValueFromPipeline = $true)] - [string[]] $Name - ) - - DynamicParam { - _buildProjectNameDynamicParam -mandatory $false - } - - process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - - if ($id) { - foreach ($item in $id) { - try { - $resp = _callAPI -ProjectName $ProjectName -Id $item -Area git -Resource repositories -Version $(_getApiVersion Git) - - # Storing the object before you return it cleaned up the pipeline. - # When I just write the object from the constructor each property - # seemed to be written - $item = [VSTeamGitRepository]::new($resp, $ProjectName) - - Write-Output $item - } - catch { - throw $_ - } - } - } - elseif ($Name) { - foreach ($item in $Name) { - try { - $resp = _callAPI -ProjectName $ProjectName -Id $item -Area git -Resource repositories -Version $(_getApiVersion Git) - - # Storing the object before you return it cleaned up the pipeline. - # When I just write the object from the constructor each property - # seemed to be written - $item = [VSTeamGitRepository]::new($resp, $ProjectName) - - Write-Output $item - } - catch { - throw $_ - } - } - } - else { - if($ProjectName) { - $resp = _callAPI -ProjectName $ProjectName -Area git -Resource repositories -Version $(_getApiVersion Git) - } else { - $resp = _callAPI -Area git -Resource repositories -Version $(_getApiVersion Git) - } - - $objs = @() - - foreach ($item in $resp.value) { - $objs += [VSTeamGitRepository]::new($item, $ProjectName) - } - - Write-Output $objs - } - } +function Get-VSTeamGitRepository { + [CmdletBinding(DefaultParameterSetName = 'ByID')] + param ( + [Parameter(ParameterSetName = 'ByID', ValueFromPipeline = $true)] + [Alias('RepositoryID')] + [guid[]] $Id, + + [Parameter(ParameterSetName = 'ByName', ValueFromPipeline = $true)] + [string[]] $Name, + + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName + ) + + process { + if ($id) { + foreach ($item in $id) { + try { + $resp = _callAPI -ProjectName $ProjectName -Id $item -Area git -Resource repositories -Version $(_getApiVersion Git) + + # Storing the object before you return it cleaned up the pipeline. + # When I just write the object from the constructor each property + # seemed to be written + $item = [VSTeamGitRepository]::new($resp, $ProjectName) + + Write-Output $item + } + catch { + throw $_ + } + } + } + elseif ($Name) { + foreach ($item in $Name) { + try { + $resp = _callAPI -ProjectName $ProjectName -Id $item -Area git -Resource repositories -Version $(_getApiVersion Git) + + # Storing the object before you return it cleaned up the pipeline. + # When I just write the object from the constructor each property + # seemed to be written + $item = [VSTeamGitRepository]::new($resp, $ProjectName) + + Write-Output $item + } + catch { + throw $_ + } + } + } + else { + if($ProjectName) { + $resp = _callAPI -ProjectName $ProjectName -Area git -Resource repositories -Version $(_getApiVersion Git) + } else { + $resp = _callAPI -Area git -Resource repositories -Version $(_getApiVersion Git) + } + + $objs = @() + + foreach ($item in $resp.value) { + $objs += [VSTeamGitRepository]::new($item, $ProjectName) + } + + Write-Output $objs + } + } } \ No newline at end of file diff --git a/Source/Public/Get-VSTeamGitStat.ps1 b/Source/Public/Get-VSTeamGitStat.ps1 index f2adb880b..e21c41fdd 100644 --- a/Source/Public/Get-VSTeamGitStat.ps1 +++ b/Source/Public/Get-VSTeamGitStat.ps1 @@ -19,17 +19,15 @@ function Get-VSTeamGitStat { [Parameter(ParameterSetName = 'ByVersion', Mandatory = $true)] [ValidateSet("branch", "commit", "tag")] - [string] $VersionType + [string] $VersionType, + + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName ) - DynamicParam { - _buildProjectNameDynamicParam -Mandatory $true - } - process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - if (($VersionType -eq "commit") -and ($null -eq $Version -or $Version -eq '')) { throw "If you have a -VersionType of 'commit' you need to set a commit id as -Version"; } diff --git a/Source/Public/Get-VSTeamGroup.ps1 b/Source/Public/Get-VSTeamGroup.ps1 index 11dbbf5e9..736e43bcb 100644 --- a/Source/Public/Get-VSTeamGroup.ps1 +++ b/Source/Public/Get-VSTeamGroup.ps1 @@ -1,83 +1,77 @@ -function Get-VSTeamGroup { - [CmdletBinding(DefaultParameterSetName = 'List')] - param( - [Parameter(ParameterSetName = 'List')] - [Parameter(ParameterSetName = 'ListByProjectName')] - [ValidateSet('vssgp','aadgp')] - [string[]] $SubjectTypes, - - [Parameter(ParameterSetName = 'List')] - [string] $ScopeDescriptor, - - [Parameter(ParameterSetName = 'ByGroupDescriptor', Mandatory = $true)] - [Alias('GroupDescriptor')] - [string] $Descriptor - ) - - DynamicParam { - # Get-VSTeamGroup should never use cache - [VSTeamProjectCache]::timestamp = -1 - - _buildProjectNameDynamicParam -ParameterSetName 'ListByProjectName' -ParameterName 'ProjectName' - } - - process { - # This will throw if this account does not support the graph API - _supportsGraph - - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - - if ($Descriptor) { - # Call the REST API - $resp = _callAPI -NoProject -Area 'graph' -Resource 'groups' -id $Descriptor ` - -Version $(_getApiVersion Graph) ` - -SubDomain 'vssps' - - # Storing the object before you return it cleaned up the pipeline. - # When I just write the object from the constructor each property - # seemed to be written - $group = [VSTeamGroup]::new($resp) - - Write-Output $group - } - else { - if ($ProjectName) { - $project = Get-VSTeamProject -Name $ProjectName - $ScopeDescriptor = Get-VSTeamDescriptor -StorageKey $project.id | Select-Object -ExpandProperty Descriptor - } - - $queryString = @{} - if ($ScopeDescriptor) { - $queryString.scopeDescriptor = $ScopeDescriptor - } - - if ($SubjectTypes -and $SubjectTypes.Length -gt 0) - { - $queryString.subjectTypes = $SubjectTypes -join ',' - } - - try { - # Call the REST API - $resp = _callAPI -NoProject -Area 'graph' -id 'groups' ` - -Version $(_getApiVersion Graph) ` - -QueryString $queryString ` - -SubDomain 'vssps' - - $objs = @() - - foreach ($item in $resp.value) { - $objs += [VSTeamGroup]::new($item) - } - - Write-Output $objs - } - catch { - # I catch because using -ErrorAction Stop on the Invoke-RestMethod - # was still running the foreach after and reporting useless errors. - # This casuses the first error to terminate this execution. - _handleException $_ - } - } - } +function Get-VSTeamGroup { + [CmdletBinding(DefaultParameterSetName = 'List')] + param( + [Parameter(ParameterSetName = 'List')] + [Parameter(ParameterSetName = 'ListByProjectName')] + [ValidateSet('vssgp', 'aadgp')] + [string[]] $SubjectTypes, + + [Parameter(ParameterSetName = 'List')] + [string] $ScopeDescriptor, + + [Parameter(ParameterSetName = 'ByGroupDescriptor', Mandatory = $true)] + [Alias('GroupDescriptor')] + [string] $Descriptor, + + [Parameter(ParameterSetName = 'ListByProjectName', Mandatory = $true)] + [UncachedProjectValidateAttribute()] + [ArgumentCompleter([UncachedProjectCompleter])] + [string] $ProjectName + ) + + process { + # This will throw if this account does not support the graph API + _supportsGraph + + if ($Descriptor) { + # Call the REST API + $resp = _callAPI -NoProject -Area 'graph' -Resource 'groups' -id $Descriptor ` + -Version $(_getApiVersion Graph) ` + -SubDomain 'vssps' + + # Storing the object before you return it cleaned up the pipeline. + # When I just write the object from the constructor each property + # seemed to be written + $group = [VSTeamGroup]::new($resp) + + Write-Output $group + } + else { + if ($ProjectName) { + $project = Get-VSTeamProject -Name $ProjectName + $ScopeDescriptor = Get-VSTeamDescriptor -StorageKey $project.id | Select-Object -ExpandProperty Descriptor + } + + $queryString = @{ } + if ($ScopeDescriptor) { + $queryString.scopeDescriptor = $ScopeDescriptor + } + + if ($SubjectTypes -and $SubjectTypes.Length -gt 0) { + $queryString.subjectTypes = $SubjectTypes -join ',' + } + + try { + # Call the REST API + $resp = _callAPI -NoProject -Area 'graph' -id 'groups' ` + -Version $(_getApiVersion Graph) ` + -QueryString $queryString ` + -SubDomain 'vssps' + + $objs = @() + + foreach ($item in $resp.value) { + $objs += [VSTeamGroup]::new($item) + } + + Write-Output $objs + } + catch { + # I catch because using -ErrorAction Stop on the Invoke-RestMethod + # was still running the foreach after and reporting useless errors. + # This casuses the first error to terminate this execution. + _handleException $_ + } + } + } } \ No newline at end of file diff --git a/Source/Public/Get-VSTeamInfo.ps1 b/Source/Public/Get-VSTeamInfo.ps1 index 27475b4ed..16bdcd26d 100644 --- a/Source/Public/Get-VSTeamInfo.ps1 +++ b/Source/Public/Get-VSTeamInfo.ps1 @@ -1,8 +1,8 @@ function Get-VSTeamInfo { return @{ - Account = [VSTeamVersions]::Account - Version = [VSTeamVersions]::Version + Account = _getInstance + Version = $(_getApiVersion -Target) ModuleVersion = [VSTeamVersions]::ModuleVersion - DefaultProject = $Global:PSDefaultParameterValues['*:projectName'] + DefaultProject = $Global:PSDefaultParameterValues['*-vsteam*:projectName'] } } \ No newline at end of file diff --git a/Source/Public/Get-VSTeamJobRequest.ps1 b/Source/Public/Get-VSTeamJobRequest.ps1 index 0e0f271cd..db5192518 100644 --- a/Source/Public/Get-VSTeamJobRequest.ps1 +++ b/Source/Public/Get-VSTeamJobRequest.ps1 @@ -20,7 +20,7 @@ function Get-VSTeamJobRequest { } } else { - $body = @{agentid = $AgentID} + $body = @{agentid = $AgentID } } $resp = _callAPI -Area "distributedtask/pools/$PoolId" -Resource "jobrequests" ` diff --git a/Source/Public/Get-VSTeamMember.ps1 b/Source/Public/Get-VSTeamMember.ps1 index e2c44a52c..2b16a8fe2 100644 --- a/Source/Public/Get-VSTeamMember.ps1 +++ b/Source/Public/Get-VSTeamMember.ps1 @@ -1,34 +1,31 @@ -function Get-VSTeamMember { - [CmdletBinding()] - param ( - [Parameter()] - [int] $Top, - - [Parameter()] - [int] $Skip, - - [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [Alias('Name')] - [Alias('Id')] - [string] $TeamId - ) - - DynamicParam { - _buildProjectNameDynamicParam - } - - process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - - $resp = _callAPI -Id "$TeamId/members" -Area 'projects' -Resource "$ProjectName/teams" -Version $(_getApiVersion Core) ` - -QueryString @{'$top' = $top; '$skip' = $skip} - - # Apply a Type Name so we can use custom format view and custom type extensions - foreach ($item in $resp.value) { - _applyTypesToTeamMember -item $item -team $TeamId -ProjectName $ProjectName - } - - Write-Output $resp.value - } +function Get-VSTeamMember { + [CmdletBinding()] + param ( + [Parameter()] + [int] $Top, + + [Parameter()] + [int] $Skip, + + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [Alias('Name')] + [Alias('Id')] + [string] $TeamId, + + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true )] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName + ) + process { + $resp = _callAPI -Id "$TeamId/members" -Area 'projects' -Resource "$ProjectName/teams" -Version $(_getApiVersion Core) ` + -QueryString @{'$top' = $top; '$skip' = $skip} + + # Apply a Type Name so we can use custom format view and custom type extensions + foreach ($item in $resp.value) { + _applyTypesToTeamMember -item $item -team $TeamId -ProjectName $ProjectName + } + + Write-Output $resp.value + } } \ No newline at end of file diff --git a/Source/Public/Get-VSTeamMembership.ps1 b/Source/Public/Get-VSTeamMembership.ps1 index fadca6010..36b2ab329 100644 --- a/Source/Public/Get-VSTeamMembership.ps1 +++ b/Source/Public/Get-VSTeamMembership.ps1 @@ -1,16 +1,17 @@ function Get-VSTeamMembership { [CmdletBinding()] param( - [Parameter(Mandatory = $true, ValueFromPipeline, ValueFromPipelineByPropertyName,ParameterSetName="ByContainerId")] + [Parameter(Mandatory = $true, ValueFromPipeline, ValueFromPipelineByPropertyName, ParameterSetName = "ByContainerId")] [string] $ContainerDescriptor, - [Parameter(Mandatory = $true, ValueFromPipeline, ValueFromPipelineByPropertyName,ParameterSetName="ByMemberId")] + [Parameter(Mandatory = $true, ValueFromPipeline, ValueFromPipelineByPropertyName, ParameterSetName = "ByMemberId")] [string] $MemberDescriptor ) process { if ($MemberDescriptor) { return _callMembershipAPI -Id $MemberDescriptor -Method Get -Direction Up - } else { + } + else { return _callMembershipAPI -Id $ContainerDescriptor -Method Get -Direction Down } } diff --git a/Source/Public/Get-VSTeamPermissionInheritance.ps1 b/Source/Public/Get-VSTeamPermissionInheritance.ps1 index e9c345c12..037d3cc7f 100644 --- a/Source/Public/Get-VSTeamPermissionInheritance.ps1 +++ b/Source/Public/Get-VSTeamPermissionInheritance.ps1 @@ -7,16 +7,15 @@ [Parameter(Mandatory)] [ValidateSet('Repository', 'BuildDefinition', 'ReleaseDefinition')] - [string] $resourceType - ) + [string] $resourceType, - DynamicParam { - _buildProjectNameDynamicParam -mandatory $true - } + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName + ) process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] Write-Verbose "Creating VSTeamPermissionInheritance" $item = [VSTeamPermissionInheritance]::new($ProjectName, $Name, $resourceType) $token = $item.Token diff --git a/Source/Public/Get-VSTeamPolicy.ps1 b/Source/Public/Get-VSTeamPolicy.ps1 index 3dffae7c6..0541c1590 100644 --- a/Source/Public/Get-VSTeamPolicy.ps1 +++ b/Source/Public/Get-VSTeamPolicy.ps1 @@ -1,45 +1,43 @@ -function Get-VSTeamPolicy { - [CmdletBinding()] - param ( - [Parameter(ValueFromPipeline = $true)] - [int[]] $Id - ) - - DynamicParam { - _buildProjectNameDynamicParam -mandatory $true - } - - process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - if ($id) { - foreach ($item in $id) { - try { - $resp = _callAPI -ProjectName $ProjectName -Id $item -Area policy -Resource configurations -Version $(_getApiVersion Git) - - _applyTypesToPolicy -item $resp - - Write-Output $resp - } - catch { - throw $_ - } - } - } - else { - try { - $resp = _callAPI -ProjectName $ProjectName -Area policy -Resource configurations -Version $(_getApiVersion Git) - - # Apply a Type Name so we can use custom format view and custom type extensions - foreach ($item in $resp.value) { - _applyTypesToPolicy -item $item - } - - Write-Output $resp.value - } - catch { - throw $_ - } - } - } +function Get-VSTeamPolicy { + [CmdletBinding()] + param ( + [Parameter(ValueFromPipeline = $true)] + [int[]] $Id, + + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName + ) + process { + if ($id) { + foreach ($item in $id) { + try { + $resp = _callAPI -ProjectName $ProjectName -Id $item -Area policy -Resource configurations -Version $(_getApiVersion Git) + + _applyTypesToPolicy -item $resp + + Write-Output $resp + } + catch { + throw $_ + } + } + } + else { + try { + $resp = _callAPI -ProjectName $ProjectName -Area policy -Resource configurations -Version $(_getApiVersion Git) + + # Apply a Type Name so we can use custom format view and custom type extensions + foreach ($item in $resp.value) { + _applyTypesToPolicy -item $item + } + + Write-Output $resp.value + } + catch { + throw $_ + } + } + } } \ No newline at end of file diff --git a/Source/Public/Get-VSTeamPolicyType.ps1 b/Source/Public/Get-VSTeamPolicyType.ps1 index d7f8e004a..03354e59f 100644 --- a/Source/Public/Get-VSTeamPolicyType.ps1 +++ b/Source/Public/Get-VSTeamPolicyType.ps1 @@ -1,46 +1,44 @@ -function Get-VSTeamPolicyType { - [CmdletBinding()] - param ( - [Parameter(ValueFromPipeline = $true)] - [guid[]] $Id - ) - - DynamicParam { - _buildProjectNameDynamicParam -mandatory $true - } - - process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - - if ($id) { - foreach ($item in $id) { - try { - $resp = _callAPI -ProjectName $ProjectName -Id $item -Area policy -Resource types -Version $(_getApiVersion Policy) - - _applyTypesToPolicyType -item $resp - - Write-Output $resp - } - catch { - throw $_ - } - } - } - else { - try { - $resp = _callAPI -ProjectName $ProjectName -Area policy -Resource types -Version $(_getApiVersion Policy) - - # Apply a Type Name so we can use custom format view and custom type extensions - foreach ($item in $resp.value) { - _applyTypesToPolicyType -item $item - } - - Write-Output $resp.value - } - catch { - throw $_ - } - } - } +function Get-VSTeamPolicyType { + [CmdletBinding()] + param ( + [Parameter(ValueFromPipeline = $true)] + [guid[]] $Id, + + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName + ) + + process { + if ($id) { + foreach ($item in $id) { + try { + $resp = _callAPI -ProjectName $ProjectName -Id $item -Area policy -Resource types -Version $(_getApiVersion Policy) + + _applyTypesToPolicyType -item $resp + + Write-Output $resp + } + catch { + throw $_ + } + } + } + else { + try { + $resp = _callAPI -ProjectName $ProjectName -Area policy -Resource types -Version $(_getApiVersion Policy) + + # Apply a Type Name so we can use custom format view and custom type extensions + foreach ($item in $resp.value) { + _applyTypesToPolicyType -item $item + } + + Write-Output $resp.value + } + catch { + throw $_ + } + } + } } \ No newline at end of file diff --git a/Source/Public/Get-VSTeamProcess.ps1 b/Source/Public/Get-VSTeamProcess.ps1 index d78235c84..d9f670137 100644 --- a/Source/Public/Get-VSTeamProcess.ps1 +++ b/Source/Public/Get-VSTeamProcess.ps1 @@ -1,68 +1,63 @@ -function Get-VSTeamProcess { - [CmdletBinding(DefaultParameterSetName = 'List')] - param( - [Parameter(ParameterSetName = 'List')] - [int] $Top = 100, - - [Parameter(ParameterSetName = 'List')] - [int] $Skip = 0, - - [Parameter(ParameterSetName = 'ByID')] - [Alias('ProcessTemplateID')] - [string] $Id - ) - - DynamicParam { - [VSTeamProcessCache]::timestamp = -1 - - _buildProcessNameDynamicParam -ParameterSetName 'ByName' -ParameterName 'Name' - } - - process { - # Bind the parameter to a friendly variable - $ProcessName = $PSBoundParameters["Name"] - - if ($id) { - $queryString = @{ } - - # Call the REST API - $resp = _callAPI -Area 'process/processes' -id $id ` - -Version $(_getApiVersion Core) ` - -QueryString $queryString - - $project = [VSTeamProcess]::new($resp) - - Write-Output $project - } - elseif ($ProcessName) { - # Lookup Process ID by Name - Get-VSTeamProcess | where-object { $_.name -eq $ProcessName } - } - else { - # Return list of processes - try { - # Call the REST API - $resp = _callAPI -Area 'process/processes' ` - -Version $(_getApiVersion Core) ` - -QueryString @{ - '$top' = $top - '$skip' = $skip - } - - $objs = @() - - foreach ($item in $resp.value) { - $objs += [VSTeamProcess]::new($item) - } - - Write-Output $objs - } - catch { - # I catch because using -ErrorAction Stop on the Invoke-RestMethod - # was still running the foreach after and reporting useless errors. - # This casuses the first error to terminate this execution. - _handleException $_ - } - } - } -} \ No newline at end of file +function Get-VSTeamProcess { + [CmdletBinding(DefaultParameterSetName = 'List')] + param( + [Parameter(ParameterSetName = 'List')] + [int] $Top = 100, + + [Parameter(ParameterSetName = 'List')] + [int] $Skip = 0, + + [Parameter(ParameterSetName = 'ByID')] + [Alias('ProcessTemplateID')] + [string] $Id, + + [Parameter(ParameterSetName = 'ByName', Mandatory = $true)] + [ProcessValidateAttribute()] + [ArgumentCompleter([ProcessTemplateCompleter])] + [string] $Name + ) + process { + if ($id) { + $queryString = @{ } + + # Call the REST API + $resp = _callAPI -area 'process' -resource 'processes' -id $id ` + -Version $(_getApiVersion Core) ` + -QueryString $queryString -NoProject + + $project = [VSTeamProcess]::new($resp) + + Write-Output $project + } + elseif ($Name) { + # Lookup Process ID by Name + Get-VSTeamProcess | where-object { $_.name -eq $Name } + } + else { + # Return list of processes + try { + # Call the REST API + $resp = _callAPI -area 'process' -resource 'processes' ` + -Version $(_getApiVersion Core) -NoProject ` + -QueryString @{ + '$top' = $top + '$skip' = $skip + } + + $objs = @() + + foreach ($item in $resp.value) { + $objs += [VSTeamProcess]::new($item) + } + + Write-Output $objs + } + catch { + # I catch because using -ErrorAction Stop on the Invoke-RestMethod + # was still running the foreach after and reporting useless errors. + # This casuses the first error to terminate this execution. + _handleException $_ + } + } + } +} diff --git a/Source/Public/Get-VSTeamProject.ps1 b/Source/Public/Get-VSTeamProject.ps1 index 5e7940794..8401e6b34 100644 --- a/Source/Public/Get-VSTeamProject.ps1 +++ b/Source/Public/Get-VSTeamProject.ps1 @@ -1,81 +1,79 @@ -function Get-VSTeamProject { - [CmdletBinding(DefaultParameterSetName = 'List')] - param( - [Parameter(ParameterSetName = 'List')] - [ValidateSet('WellFormed', 'CreatePending', 'Deleting', 'New', 'All')] - [string] $StateFilter = 'WellFormed', - - [Parameter(ParameterSetName = 'List')] - [int] $Top = 100, - - [Parameter(ParameterSetName = 'List')] - [int] $Skip = 0, - - [Parameter(ParameterSetName = 'ByID')] - [Alias('ProjectID')] - [string] $Id, - - [switch] $IncludeCapabilities - ) - - DynamicParam { - # Get-VSTeamProject should never use cache - [VSTeamProjectCache]::timestamp = -1 - - _buildProjectNameDynamicParam -ParameterSetName 'ByName' -ParameterName 'Name' - } - - process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["Name"] - - if ($id) { - $ProjectName = $id - } - - if ($ProjectName) { - $queryString = @{} - if ($includeCapabilities.IsPresent) { - $queryString.includeCapabilities = $true - } - - # Call the REST API - $resp = _callAPI -Area 'projects' -NoProject -id $ProjectName ` - -Version $(_getApiVersion Core) ` - -QueryString $queryString - - # Storing the object before you return it cleaned up the pipeline. - # When I just write the object from the constructor each property - # seemed to be written - $project = [VSTeamProject]::new($resp) - - Write-Output $project - } - else { - try { - # Call the REST API - $resp = _callAPI -Area 'projects' -NoProject ` - -Version $(_getApiVersion Core) ` - -QueryString @{ - stateFilter = $stateFilter - '$top' = $top - '$skip' = $skip - } - - $objs = @() - - foreach ($item in $resp.value) { - $objs += [VSTeamProject]::new($item) - } - - Write-Output $objs - } - catch { - # I catch because using -ErrorAction Stop on the Invoke-RestMethod - # was still running the foreach after and reporting useless errors. - # This casuses the first error to terminate this execution. - _handleException $_ - } - } - } -} \ No newline at end of file +function Get-VSTeamProject { + [CmdletBinding(DefaultParameterSetName = 'List')] + param( + [Parameter(ParameterSetName = 'List')] + [ValidateSet('WellFormed', 'CreatePending', 'Deleting', 'New', 'All')] + [string] $StateFilter = 'WellFormed', + + [Parameter(ParameterSetName = 'List')] + [int] $Top = 100, + + [Parameter(ParameterSetName = 'List')] + [int] $Skip = 0, + + [Parameter(ParameterSetName = 'ByID')] + [Alias('ProjectID')] + [string] $Id, + + [switch] $IncludeCapabilities, + + [Parameter(ParameterSetName = 'ByName', Mandatory = $true, Position = 0)] + [UncachedProjectValidateAttribute()] + [ArgumentCompleter([UncachedProjectCompleter])] + [string] $Name + ) + + process { + # Bind the parameter to a friendly variable + $ProjectName = $PSBoundParameters["Name"] + + if ($id) { + $ProjectName = $id + } + + if ($ProjectName) { + $queryString = @{ } + if ($includeCapabilities.IsPresent) { + $queryString.includeCapabilities = $true + } + + # Call the REST API + $resp = _callAPI -Area 'projects' -id $ProjectName ` + -Version $(_getApiVersion Core) -IgnoreDefaultProject ` + -QueryString $queryString + + # Storing the object before you return it cleaned up the pipeline. + # When I just write the object from the constructor each property + # seemed to be written + $project = [VSTeamProject]::new($resp) + + Write-Output $project + } + else { + try { + # Call the REST API + $resp = _callAPI -Area 'projects' ` + -Version $(_getApiVersion Core) -IgnoreDefaultProject ` + -QueryString @{ + stateFilter = $stateFilter + '$top' = $top + '$skip' = $skip + } + + $objs = @() + + foreach ($item in $resp.value) { + $objs += [VSTeamProject]::new($item) + } + + Write-Output $objs + } + catch { + # I catch because using -ErrorAction Stop on the Invoke-RestMethod + # was still running the foreach after and reporting useless errors. + # This casuses the first error to terminate this execution. + _handleException $_ + } + } + } +} diff --git a/Source/Public/Get-VSTeamPullRequest.ps1 b/Source/Public/Get-VSTeamPullRequest.ps1 index af09cda73..96b5c4ae1 100644 --- a/Source/Public/Get-VSTeamPullRequest.ps1 +++ b/Source/Public/Get-VSTeamPullRequest.ps1 @@ -36,17 +36,15 @@ function Get-VSTeamPullRequest { [Parameter(ParameterSetName = "SearchCriteriaWithAll")] [Parameter(ParameterSetName = "SearchCriteriaWithStatus")] - [int] $Skip - ) - - DynamicParam { - _buildProjectNameDynamicParam -Mandatory $false - } - - Process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] + [int] $Skip, + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName + ) + + process { try { if ($Id) { if ($ProjectName) { @@ -101,4 +99,5 @@ function Get-VSTeamPullRequest { _handleException $_ } } -} \ No newline at end of file +} + diff --git a/Source/Public/Get-VSTeamQueue.ps1 b/Source/Public/Get-VSTeamQueue.ps1 index d7823b950..18cfc9c72 100644 --- a/Source/Public/Get-VSTeamQueue.ps1 +++ b/Source/Public/Get-VSTeamQueue.ps1 @@ -1,43 +1,43 @@ -function Get-VSTeamQueue { - [CmdletBinding(DefaultParameterSetName = 'List')] - param( - [Parameter(ParameterSetName = 'List')] - [string] $queueName, - [Parameter(ParameterSetName = 'List')] - [ValidateSet('None', 'Manage', 'Use')] - [string] $actionFilter, - [Parameter(ParameterSetName = 'ByID')] - [Alias('QueueID')] - [string] $id - ) - - DynamicParam { - _buildProjectNameDynamicParam - } - - process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - - if ($id) { - $resp = _callAPI -ProjectName $ProjectName -Id $id -Area distributedtask -Resource queues ` - -Version $(_getApiVersion DistributedTask) - - $item = [VSTeamQueue]::new($resp, $ProjectName) - - Write-Output $item - } - else { - $resp = _callAPI -ProjectName $projectName -Area distributedtask -Resource queues ` - -QueryString @{ queueName = $queueName; actionFilter = $actionFilter } -Version $(_getApiVersion DistributedTask) - - $objs = @() - - foreach ($item in $resp.value) { - $objs += [VSTeamQueue]::new($item, $ProjectName) - } - - Write-Output $objs - } - } -} \ No newline at end of file +function Get-VSTeamQueue { + [CmdletBinding(DefaultParameterSetName = 'List')] + param( + [Parameter(ParameterSetName = 'List')] + [string] $queueName, + + [Parameter(ParameterSetName = 'List')] + [ValidateSet('None', 'Manage', 'Use')] + [string] $actionFilter, + + [Parameter(ParameterSetName = 'ByID')] + [Alias('QueueID')] + [string] $id, + + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName + ) + + process { + if ($id) { + $resp = _callAPI -ProjectName $ProjectName -Id $id -Area distributedtask -Resource queues ` + -Version $(_getApiVersion DistributedTask) + + $item = [VSTeamQueue]::new($resp, $ProjectName) + + Write-Output $item + } + else { + $resp = _callAPI -ProjectName $projectName -Area distributedtask -Resource queues ` + -QueryString @{ queueName = $queueName; actionFilter = $actionFilter } -Version $(_getApiVersion DistributedTask) + + $objs = @() + + foreach ($item in $resp.value) { + $objs += [VSTeamQueue]::new($item, $ProjectName) + } + + Write-Output $objs + } + } +} diff --git a/Source/Public/Get-VSTeamRelease.ps1 b/Source/Public/Get-VSTeamRelease.ps1 index 46ea7e40f..966fb5813 100644 --- a/Source/Public/Get-VSTeamRelease.ps1 +++ b/Source/Public/Get-VSTeamRelease.ps1 @@ -1,105 +1,106 @@ -function Get-VSTeamRelease { - [CmdletBinding(DefaultParameterSetName = 'List')] - param( - [ValidateSet('environments', 'artifacts', 'approvals', 'none')] - [string] $expand, - - [Parameter(ParameterSetName = 'List')] - [ValidateSet('Draft', 'Active', 'Abandoned')] - [string] $statusFilter, - - [Parameter(ParameterSetName = 'List')] - [int] $definitionId, - - [Parameter(ParameterSetName = 'List')] - [int] $top, - - [Parameter(ParameterSetName = 'List')] - [string] $createdBy, - - [Parameter(ParameterSetName = 'List')] - [DateTime] $minCreatedTime, - - [Parameter(ParameterSetName = 'List')] - [DateTime] $maxCreatedTime, - - [Parameter(ParameterSetName = 'List')] - [ValidateSet('ascending', 'descending')] - [string] $queryOrder, - - [Parameter(ParameterSetName = 'List')] - [string] $continuationToken, - - [Parameter(Position = 0, Mandatory = $true, ParameterSetName = 'ByIdRaw')] - [Parameter(Position = 0, Mandatory = $true, ParameterSetName = 'ByIdJson')] - [Parameter(Position = 0, Mandatory = $true, ParameterSetName = 'ByID', ValueFromPipelineByPropertyName = $true)] - [Alias('ReleaseID')] - [int[]] $id, - - [Parameter(Mandatory = $true, ParameterSetName = 'ByIdJson')] - [switch]$JSON, - - [Parameter(Mandatory = $true, ParameterSetName = 'ByIdRaw')] - [switch]$raw - ) - - DynamicParam { - _buildProjectNameDynamicParam -Mandatory $false -Position 1 - } - - process { - Write-Debug 'Get-VSTeamRelease Process' - - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - - if ($id) { - foreach ($item in $id) { - $resp = _callAPI -SubDomain vsrm -ProjectName $ProjectName -Area release -id $item -Resource releases -Version $(_getApiVersion Release) - - if ($JSON.IsPresent) { - $resp | ConvertTo-Json -Depth 99 - } - else { - if (-not $raw.IsPresent) { - - # Apply a Type Name so we can use custom format view and custom type extensions - _applyTypesToRelease -item $resp - } - - Write-Output $resp - } - } - } - else { - if ($ProjectName) { - $listurl = _buildRequestURI -SubDomain vsrm -ProjectName $ProjectName -Area release -Resource releases -Version $(_getApiVersion Release) - } - else { - $listurl = _buildRequestURI -SubDomain vsrm -Area release -Resource releases -Version $(_getApiVersion Release) - } - - $QueryString = @{ - '$top' = $top - '$expand' = $expand - 'createdBy' = $createdBy - 'queryOrder' = $queryOrder - 'statusFilter' = $statusFilter - 'definitionId' = $definitionId - 'minCreatedTime' = $minCreatedTime - 'maxCreatedTime' = $maxCreatedTime - 'continuationToken' = $continuationToken - } - - # Call the REST API - $resp = _callAPI -url $listurl -QueryString $QueryString - - # Apply a Type Name so we can use custom format view and custom type extensions - foreach ($item in $resp.value) { - _applyTypesToRelease -item $item - } - - Write-Output $resp.value - } - } -} \ No newline at end of file +function Get-VSTeamRelease { + [CmdletBinding(DefaultParameterSetName = 'List')] + param( + [Parameter(Position = 0, Mandatory = $true, ParameterSetName = 'ByIdRaw')] + [Parameter(Position = 0, Mandatory = $true, ParameterSetName = 'ByIdJson')] + [Parameter(Position = 0, Mandatory = $true, ParameterSetName = 'ByID', ValueFromPipelineByPropertyName = $true)] + [Alias('ReleaseID')] + [int[]] $id, + + [Parameter(ParameterSetName = 'List')] + [string] $searchText, + + [Parameter(ParameterSetName = 'List')] + [ValidateSet('Draft', 'Active', 'Abandoned')] + [string] $statusFilter, + + [ValidateSet('environments', 'artifacts', 'approvals', 'none')] + [string] $expand, + + [Parameter(ParameterSetName = 'List')] + [int] $definitionId, + + [Parameter(ParameterSetName = 'List')] + [int] $top, + + [Parameter(ParameterSetName = 'List')] + [string] $createdBy, + + [Parameter(ParameterSetName = 'List')] + [DateTime] $minCreatedTime, + + [Parameter(ParameterSetName = 'List')] + [DateTime] $maxCreatedTime, + + [Parameter(ParameterSetName = 'List')] + [ValidateSet('ascending', 'descending')] + + [string] $queryOrder, + [Parameter(ParameterSetName = 'List')] + + [string] $continuationToken, + [Parameter(Mandatory = $true, ParameterSetName = 'ByIdJson')] + + [switch] $JSON, + [Parameter(Mandatory = $true, ParameterSetName = 'ByIdRaw')] + + [switch] $raw, + + [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName + ) + + process { + if ($id) { + foreach ($item in $id) { + $resp = _callAPI -SubDomain vsrm -ProjectName $ProjectName -Area release -id $item -Resource releases -Version $(_getApiVersion Release) + + if ($JSON.IsPresent) { + $resp | ConvertTo-Json -Depth 99 + } + else { + if (-not $raw.IsPresent) { + # Apply a Type Name so we can use custom format view and custom type extensions + _applyTypesToRelease -item $resp + } + + Write-Output $resp + } + } + } + else { + if ($ProjectName) { + $listurl = _buildRequestURI -SubDomain vsrm -ProjectName $ProjectName -Area release -Resource releases -Version $(_getApiVersion Release) + } + else { + $listurl = _buildRequestURI -SubDomain vsrm -Area release -Resource releases -Version $(_getApiVersion Release) + } + + $QueryString = @{ + '$top' = $top + '$expand' = $expand + 'createdBy' = $createdBy + 'queryOrder' = $queryOrder + 'searchText' = $searchText + 'statusFilter' = $statusFilter + 'definitionId' = $definitionId + 'minCreatedTime' = $minCreatedTime + 'maxCreatedTime' = $maxCreatedTime + 'continuationToken' = $continuationToken + + } + + # Call the REST API + $resp = _callAPI -url $listurl -QueryString $QueryString + + # Apply a Type Name so we can use custom format view and custom type extensions + foreach ($item in $resp.value) { + _applyTypesToRelease -item $item + } + + Write-Output $resp.value + } + } +} diff --git a/Source/Public/Get-VSTeamReleaseDefinition.ps1 b/Source/Public/Get-VSTeamReleaseDefinition.ps1 index ea245de97..ee030376d 100644 --- a/Source/Public/Get-VSTeamReleaseDefinition.ps1 +++ b/Source/Public/Get-VSTeamReleaseDefinition.ps1 @@ -1,69 +1,64 @@ -function Get-VSTeamReleaseDefinition { - [CmdletBinding(DefaultParameterSetName = 'List')] - param( - [Parameter(ParameterSetName = 'List')] - [ValidateSet('environments', 'artifacts', 'none')] - [string] $Expand = 'none', - - [Parameter(Mandatory = $true, ParameterSetName = 'ByIdRaw', ValueFromPipelineByPropertyName = $true)] - [Parameter(Mandatory = $true, ParameterSetName = 'ByIdJson', ValueFromPipelineByPropertyName = $true)] - [Parameter(Mandatory = $true, ParameterSetName = 'ByID', ValueFromPipelineByPropertyName = $true)] - [Alias('ReleaseDefinitionID')] - [int[]] $Id, - - [Parameter(Mandatory = $true, ParameterSetName = 'ByIdJson')] - [switch]$JSON, - - [Parameter(Mandatory = $true, ParameterSetName = 'ByIdRaw')] - [switch]$raw - ) - - DynamicParam { - _buildProjectNameDynamicParam - } - - process { - Write-Debug 'Get-VSTeamReleaseDefinition Process' - - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - - if ($id) { - foreach ($item in $id) { - $resp = _callAPI -subDomain vsrm -Area release -resource definitions -Version $(_getApiVersion Release) -projectName $projectName -id $item - - if ($JSON.IsPresent) { - $resp | ConvertTo-Json -Depth 99 - } - else { - if (-not $raw.IsPresent) { - $item = [VSTeamReleaseDefinition]::new($resp, $ProjectName) - - Write-Output $item - } - else { - Write-Output $resp - } - } - } - } - else { - $listurl = _buildRequestURI -subDomain vsrm -Area release -resource 'definitions' -Version $(_getApiVersion Release) -projectName $ProjectName - - if ($expand -ne 'none') { - $listurl += "&`$expand=$($expand)" - } - - # Call the REST API - $resp = _callAPI -url $listurl - - $objs = @() - - foreach ($item in $resp.value) { - $objs += [VSTeamReleaseDefinition]::new($item, $ProjectName) - } - - Write-Output $objs - } - } -} \ No newline at end of file +function Get-VSTeamReleaseDefinition { + [CmdletBinding(DefaultParameterSetName = 'List')] + param( + [Parameter(ParameterSetName = 'List')] + [ValidateSet('environments', 'artifacts', 'none')] + [string] $Expand = 'none', + + [Parameter(Mandatory = $true, ParameterSetName = 'ByIdRaw', ValueFromPipelineByPropertyName = $true)] + [Parameter(Mandatory = $true, ParameterSetName = 'ByIdJson', ValueFromPipelineByPropertyName = $true)] + [Parameter(Mandatory = $true, ParameterSetName = 'ByID', ValueFromPipelineByPropertyName = $true)] + [Alias('ReleaseDefinitionID')] + [int[]] $Id, + + [Parameter(Mandatory = $true, ParameterSetName = 'ByIdJson')] + [switch]$JSON, + + [Parameter(Mandatory = $true, ParameterSetName = 'ByIdRaw')] + [switch]$raw, + + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName + ) + process { + if ($id) { + foreach ($item in $id) { + $resp = _callAPI -subDomain vsrm -Area release -resource definitions -Version $(_getApiVersion Release) -projectName $projectName -id $item + + if ($JSON.IsPresent) { + $resp | ConvertTo-Json -Depth 99 + } + else { + if (-not $raw.IsPresent) { + $item = [VSTeamReleaseDefinition]::new($resp, $ProjectName) + + Write-Output $item + } + else { + Write-Output $resp + } + } + } + } + else { + $listurl = _buildRequestURI -subDomain vsrm -Area release -resource 'definitions' -Version $(_getApiVersion Release) -projectName $ProjectName + + if ($expand -ne 'none') { + $listurl += "&`$expand=$($expand)" + } + + # Call the REST API + $resp = _callAPI -url $listurl + + $objs = @() + + foreach ($item in $resp.value) { + $objs += [VSTeamReleaseDefinition]::new($item, $ProjectName) + } + + Write-Output $objs + } + } +} diff --git a/Source/Public/Get-VSTeamSecurityNamespace.ps1 b/Source/Public/Get-VSTeamSecurityNamespace.ps1 index 41e8748cd..1591bc98f 100644 --- a/Source/Public/Get-VSTeamSecurityNamespace.ps1 +++ b/Source/Public/Get-VSTeamSecurityNamespace.ps1 @@ -1,73 +1,76 @@ -function Get-VSTeamSecurityNamespace { - [CmdletBinding(DefaultParameterSetName = 'List')] - param( - [Parameter(ParameterSetName = 'ByNamespaceName', Mandatory = $true)] - [string] $Name, - - [Parameter(ParameterSetName = 'ByNamespaceId', Mandatory = $true)] - [guid] $Id, - - [Parameter(ParameterSetName = 'List', Mandatory = $false)] - [switch] $LocalOnly - ) - - process { - _supportsSecurityNamespace - - if ($Id) { - # Call the REST API - $resp = _callAPI -Area 'securitynamespaces' -id $Id ` - -Version $(_getApiVersion Core) -NoProject ` - } else { - $queryString = @{} - if ($LocalOnly.IsPresent) - { - $queryString.localOnly = $true - } - - $resp = _callAPI -Area 'securitynamespaces' ` - -Version $(_getApiVersion Core) -NoProject ` - -QueryString $queryString - } - - Write-Verbose $resp | Select-Object -ExpandProperty value - - if ($resp.count -le 0) { - Write-Output $null - } - - if ($resp.count -gt 1) { - # If we only need to find one specific by name - if ($Name) { - $selected = $resp.value | Where-Object {$_.name -eq $Name} - if ($selected) { - return [VSTeamSecurityNamespace]::new($selected) - } else { - return $null - } - } - - try { - $objs = @() - foreach ($item in $resp.value) { - $objs += [VSTeamSecurityNamespace]::new($item) - } - - Write-Output $objs - } - catch { - # I catch because using -ErrorAction Stop on the Invoke-RestMethod - # was still running the foreach after and reporting useless errors. - # This casuses the first error to terminate this execution. - _handleException $_ - } - } else { - # Storing the object before you return it cleaned up the pipeline. - # When I just write the object from the constructor each property - # seemed to be written - $acl = [VSTeamSecurityNamespace]::new($resp.value) - - Write-Output $acl - } - } +function Get-VSTeamSecurityNamespace { + [CmdletBinding(DefaultParameterSetName = 'List')] + param( + [Parameter(ParameterSetName = 'ByNamespaceName', Mandatory = $true)] + [string] $Name, + + [Parameter(ParameterSetName = 'ByNamespaceId', Mandatory = $true)] + [guid] $Id, + + [Parameter(ParameterSetName = 'List', Mandatory = $false)] + [switch] $LocalOnly + ) + + process { + _supportsSecurityNamespace + + if ($Id) { + # Call the REST API + $resp = _callAPI -Area 'securitynamespaces' -id $Id ` + -Version $(_getApiVersion Core) -NoProject ` + + } + else { + $queryString = @{ } + if ($LocalOnly.IsPresent) { + $queryString.localOnly = $true + } + + $resp = _callAPI -Area 'securitynamespaces' ` + -Version $(_getApiVersion Core) -NoProject ` + -QueryString $queryString + } + + Write-Verbose $resp | Select-Object -ExpandProperty value + + if ($resp.count -le 0) { + Write-Output $null + } + + if ($resp.count -gt 1) { + # If we only need to find one specific by name + if ($Name) { + $selected = $resp.value | Where-Object { $_.name -eq $Name } + if ($selected) { + return [VSTeamSecurityNamespace]::new($selected) + } + else { + return $null + } + } + + try { + $objs = @() + foreach ($item in $resp.value) { + $objs += [VSTeamSecurityNamespace]::new($item) + } + + Write-Output $objs + } + catch { + # I catch because using -ErrorAction Stop on the Invoke-RestMethod + # was still running the foreach after and reporting useless errors. + # This casuses the first error to terminate this execution. + _handleException $_ + } + } + else { + # Storing the object before you return it cleaned up the pipeline. + # When I just write the object from the constructor each property + # seemed to be written + $acl = [VSTeamSecurityNamespace]::new($resp.value) + + Write-Output $acl + } + } } \ No newline at end of file diff --git a/Source/Public/Get-VSTeamServiceEndpoint.ps1 b/Source/Public/Get-VSTeamServiceEndpoint.ps1 index d35952a72..89b99124b 100644 --- a/Source/Public/Get-VSTeamServiceEndpoint.ps1 +++ b/Source/Public/Get-VSTeamServiceEndpoint.ps1 @@ -1,38 +1,35 @@ -function Get-VSTeamServiceEndpoint { - [CmdletBinding(DefaultParameterSetName = 'List')] - param( - [Parameter(ParameterSetName = 'ByID', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [string] $id - ) - - DynamicParam { - _buildProjectNameDynamicParam - } - - Process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - - if ($id) { - # Call the REST API - $resp = _callAPI -Area 'distributedtask' -Resource 'serviceendpoints' -Id $id ` - -Version $(_getApiVersion DistributedTask) -ProjectName $ProjectName - - _applyTypesToServiceEndpoint -item $resp - - Write-Output $resp - } - else { - # Call the REST API - $resp = _callAPI -ProjectName $ProjectName -Area 'distributedtask' -Resource 'serviceendpoints' ` - -Version $(_getApiVersion DistributedTask) - - # Apply a Type Name so we can use custom format view and custom type extensions - foreach ($item in $resp.value) { - _applyTypesToServiceEndpoint -item $item - } - - return $resp.value - } - } -} \ No newline at end of file +function Get-VSTeamServiceEndpoint { + [CmdletBinding(DefaultParameterSetName = 'List')] + param( + [Parameter(ParameterSetName = 'ByID', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [string] $id, + + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName + ) + process { + if ($id) { + # Call the REST API + $resp = _callAPI -Area 'distributedtask' -Resource 'serviceendpoints' -Id $id ` + -Version $(_getApiVersion DistributedTask) -ProjectName $ProjectName + + _applyTypesToServiceEndpoint -item $resp + + Write-Output $resp + } + else { + # Call the REST API + $resp = _callAPI -ProjectName $ProjectName -Area 'distributedtask' -Resource 'serviceendpoints' ` + -Version $(_getApiVersion DistributedTask) + + # Apply a Type Name so we can use custom format view and custom type extensions + foreach ($item in $resp.value) { + _applyTypesToServiceEndpoint -item $item + } + + return $resp.value + } + } +} diff --git a/Source/Public/Get-VSTeamServiceEndpointType.ps1 b/Source/Public/Get-VSTeamServiceEndpointType.ps1 index e8e9afdc9..0d58d0fc5 100644 --- a/Source/Public/Get-VSTeamServiceEndpointType.ps1 +++ b/Source/Public/Get-VSTeamServiceEndpointType.ps1 @@ -1,50 +1,50 @@ -function Get-VSTeamServiceEndpointType { - [CmdletBinding()] - param( - [Parameter(ParameterSetName = 'ByType')] - [string] $Type, - - [Parameter(ParameterSetName = 'ByType')] - [string] $Scheme - ) - - Process { - - if ($Type -ne '' -or $Scheme -ne '') { - - if ($Type -ne '' -and $Scheme -ne '') { - $body = @{ - type = $Type - scheme = $Scheme - } - } - elseif ($Type -ne '') { - $body = @{ - type = $Type - } - } - else { - $body = @{ - scheme = $Scheme - } - } - - # Call the REST API - $resp = _callAPI -Area 'distributedtask' -Resource 'serviceendpointtypes' ` - -Version $(_getApiVersion DistributedTask) -body $body - } - else { - # Call the REST API - $resp = _callAPI -Area 'distributedtask' -Resource 'serviceendpointtypes' ` - -Version $(_getApiVersion DistributedTask) - } - - - # Apply a Type Name so we can use custom format view and custom type extensions - foreach ($item in $resp.value) { - _applyTypesToServiceEndpointType -item $item - } - - return $resp.value - } +function Get-VSTeamServiceEndpointType { + [CmdletBinding()] + param( + [Parameter(ParameterSetName = 'ByType')] + [string] $Type, + + [Parameter(ParameterSetName = 'ByType')] + [string] $Scheme + ) + + Process { + + if ($Type -ne '' -or $Scheme -ne '') { + + if ($Type -ne '' -and $Scheme -ne '') { + $body = @{ + type = $Type + scheme = $Scheme + } + } + elseif ($Type -ne '') { + $body = @{ + type = $Type + } + } + else { + $body = @{ + scheme = $Scheme + } + } + + # Call the REST API + $resp = _callAPI -Area 'distributedtask' -Resource 'serviceendpointtypes' ` + -Version $(_getApiVersion DistributedTask) -body $body + } + else { + # Call the REST API + $resp = _callAPI -Area 'distributedtask' -Resource 'serviceendpointtypes' ` + -Version $(_getApiVersion DistributedTask) + } + + + # Apply a Type Name so we can use custom format view and custom type extensions + foreach ($item in $resp.value) { + _applyTypesToServiceEndpointType -item $item + } + + return $resp.value + } } \ No newline at end of file diff --git a/Source/Public/Get-VSTeamTaskGroup.ps1 b/Source/Public/Get-VSTeamTaskGroup.ps1 index 1e955a4ca..c70d2b0ac 100644 --- a/Source/Public/Get-VSTeamTaskGroup.ps1 +++ b/Source/Public/Get-VSTeamTaskGroup.ps1 @@ -1,50 +1,47 @@ - -function Get-VSTeamTaskGroup { - [CmdletBinding(DefaultParameterSetName = 'List')] - param( - [Parameter(ParameterSetName = 'ByID', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [string] $Id, - - [Parameter(ParameterSetName = 'ByName', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [string] $Name - ) - - DynamicParam { - _buildProjectNameDynamicParam - } - - process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - - if ($Id) { - $resp = _callAPI -ProjectName $ProjectName -Area distributedtask -Resource taskgroups -Version $(_getApiVersion TaskGroups) -Id $Id -Method Get - - Write-Output $resp.value - } - else { - $resp = _callAPI -ProjectName $ProjectName -Area distributedtask -Resource taskgroups -Version $(_getApiVersion TaskGroups) -Method Get - - if ($Name) { - if ($resp.value) { - foreach ($item in $resp.value) { - if ($item.PSObject.Properties.name -contains "name") { - if ($Name -eq $item.name) { - return $item - } - } - } - return $null - } - else { - return $null - } - } - else { - foreach ($item in $resp.value) { - Write-Output $item - } - } - } - } -} \ No newline at end of file +function Get-VSTeamTaskGroup { + [CmdletBinding(DefaultParameterSetName = 'List')] + param( + [Parameter(ParameterSetName = 'ByID', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [string] $Id, + + [Parameter(ParameterSetName = 'ByName', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [string] $Name, + + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName + ) + + process { + if ($Id) { + $resp = _callAPI -ProjectName $ProjectName -Area distributedtask -Resource taskgroups -Version $(_getApiVersion TaskGroups) -Id $Id -Method Get + + Write-Output $resp.value + } + else { + $resp = _callAPI -ProjectName $ProjectName -Area distributedtask -Resource taskgroups -Version $(_getApiVersion TaskGroups) -Method Get + + if ($Name) { + if ($resp.value) { + foreach ($item in $resp.value) { + if ($item.PSObject.Properties.name -contains "name") { + if ($Name -eq $item.name) { + return $item + } + } + } + return $null + } + else { + return $null + } + } + else { + foreach ($item in $resp.value) { + Write-Output $item + } + } + } + } +} diff --git a/Source/Public/Get-VSTeamTfvcBranch.ps1 b/Source/Public/Get-VSTeamTfvcBranch.ps1 index 237e27dc3..4edff24c5 100644 --- a/Source/Public/Get-VSTeamTfvcBranch.ps1 +++ b/Source/Public/Get-VSTeamTfvcBranch.ps1 @@ -1,32 +1,32 @@ -function Get-VSTeamTfvcBranch { - [CmdletBinding()] - param( - [parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [string[]] $Path, - - [parameter(Mandatory = $false)] - [switch] $IncludeChildren = $false, - - [parameter(Mandatory = $false)] - [switch] $IncludeParent = $false, - - [parameter(Mandatory = $false)] - [switch] $IncludeDeleted = $false - ) - - process { - foreach ($item in $Path) { - $queryString = [ordered]@{ - includeChildren = $IncludeChildren; - includeParent = $IncludeParent; - includeDeleted = $IncludeDeleted; - } - - $resp = _callAPI -Area tfvc -Resource branches -Id $item -QueryString $queryString -Version $(_getApiVersion Tfvc) - - _applyTypesToTfvcBranch -item $resp - - Write-Output $resp - } - } +function Get-VSTeamTfvcBranch { + [CmdletBinding()] + param( + [parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [string[]] $Path, + + [parameter(Mandatory = $false)] + [switch] $IncludeChildren = $false, + + [parameter(Mandatory = $false)] + [switch] $IncludeParent = $false, + + [parameter(Mandatory = $false)] + [switch] $IncludeDeleted = $false + ) + + process { + foreach ($item in $Path) { + $queryString = [ordered]@{ + includeChildren = $IncludeChildren; + includeParent = $IncludeParent; + includeDeleted = $IncludeDeleted; + } + + $resp = _callAPI -Area tfvc -Resource branches -Id $item -QueryString $queryString -Version $(_getApiVersion Tfvc) + + _applyTypesToTfvcBranch -item $resp + + Write-Output $resp + } + } } \ No newline at end of file diff --git a/Source/Public/Get-VSTeamTfvcRootBranch.ps1 b/Source/Public/Get-VSTeamTfvcRootBranch.ps1 index d21cb6a94..74bca13a9 100644 --- a/Source/Public/Get-VSTeamTfvcRootBranch.ps1 +++ b/Source/Public/Get-VSTeamTfvcRootBranch.ps1 @@ -1,32 +1,32 @@ -function Get-VSTeamTfvcRootBranch { - [CmdletBinding()] - param( - [parameter(Mandatory = $false)] - [switch] $IncludeChildren = $false, - - [parameter(Mandatory = $false)] - [switch] $IncludeDeleted = $false - ) - - process { - $queryString = [ordered]@{ - includeChildren = $IncludeChildren; - includeDeleted = $IncludeDeleted; - } - - $resp = _callAPI -Area tfvc -Resource branches -QueryString $queryString -Version $(_getApiVersion Tfvc) - - if ($resp | Get-Member -Name value -MemberType Properties) { - foreach ($item in $resp.value) { - _applyTypesToTfvcBranch -item $item - } - - Write-Output $resp.value - } - else { - _applyTypesToTfvcBranch -item $resp - - Write-Output $resp - } - } +function Get-VSTeamTfvcRootBranch { + [CmdletBinding()] + param( + [parameter(Mandatory = $false)] + [switch] $IncludeChildren = $false, + + [parameter(Mandatory = $false)] + [switch] $IncludeDeleted = $false + ) + + process { + $queryString = [ordered]@{ + includeChildren = $IncludeChildren; + includeDeleted = $IncludeDeleted; + } + + $resp = _callAPI -Area tfvc -Resource branches -QueryString $queryString -Version $(_getApiVersion Tfvc) + + if ($resp | Get-Member -Name value -MemberType Properties) { + foreach ($item in $resp.value) { + _applyTypesToTfvcBranch -item $item + } + + Write-Output $resp.value + } + else { + _applyTypesToTfvcBranch -item $resp + + Write-Output $resp + } + } } \ No newline at end of file diff --git a/Source/Public/Get-VSTeamUser.ps1 b/Source/Public/Get-VSTeamUser.ps1 index 250fa517e..2f02d032a 100644 --- a/Source/Public/Get-VSTeamUser.ps1 +++ b/Source/Public/Get-VSTeamUser.ps1 @@ -1,60 +1,59 @@ -function Get-VSTeamUser { - [CmdletBinding(DefaultParameterSetName = 'List')] - param( - [Parameter(ParameterSetName = 'List')] - [ValidateSet('msa','aad','svc','imp','vss')] - [string[]] $SubjectTypes, - - [Parameter(ParameterSetName = 'ByUserDescriptor', Mandatory = $true)] - [Alias('UserDescriptor')] - [string] $Descriptor - ) - - process { - # This will throw if this account does not support the graph API - _supportsGraph - - if ($Descriptor) { - # Call the REST API - $resp = _callAPI -Area 'graph' -Resource 'users' -id $Descriptor ` - -Version $(_getApiVersion Graph) ` - -SubDomain 'vssps' -NoProject - - # Storing the object before you return it cleaned up the pipeline. - # When I just write the object from the constructor each property - # seemed to be written - $user = [VSTeamUser]::new($resp) - - Write-Output $user - } - else { - $queryString = @{} - if ($SubjectTypes -and $SubjectTypes.Length -gt 0) - { - $queryString.subjectTypes = $SubjectTypes -join ',' - } - - try { - # Call the REST API - $resp = _callAPI -Area 'graph' -id 'users' ` - -Version $(_getApiVersion Graph) ` - -QueryString $queryString ` - -SubDomain 'vssps' -NoProject - - $objs = @() - - foreach ($item in $resp.value) { - $objs += [VSTeamUser]::new($item) - } - - Write-Output $objs - } - catch { - # I catch because using -ErrorAction Stop on the Invoke-RestMethod - # was still running the foreach after and reporting useless errors. - # This casuses the first error to terminate this execution. - _handleException $_ - } - } - } +function Get-VSTeamUser { + [CmdletBinding(DefaultParameterSetName = 'List')] + param( + [Parameter(ParameterSetName = 'List')] + [ValidateSet('msa', 'aad', 'svc', 'imp', 'vss')] + [string[]] $SubjectTypes, + + [Parameter(ParameterSetName = 'ByUserDescriptor', Mandatory = $true)] + [Alias('UserDescriptor')] + [string] $Descriptor + ) + + process { + # This will throw if this account does not support the graph API + _supportsGraph + + if ($Descriptor) { + # Call the REST API + $resp = _callAPI -Area 'graph' -Resource 'users' -id $Descriptor ` + -Version $(_getApiVersion Graph) ` + -SubDomain 'vssps' -NoProject + + # Storing the object before you return it cleaned up the pipeline. + # When I just write the object from the constructor each property + # seemed to be written + $user = [VSTeamUser]::new($resp) + + Write-Output $user + } + else { + $queryString = @{ } + if ($SubjectTypes -and $SubjectTypes.Length -gt 0) { + $queryString.subjectTypes = $SubjectTypes -join ',' + } + + try { + # Call the REST API + $resp = _callAPI -Area 'graph' -id 'users' ` + -Version $(_getApiVersion Graph) ` + -QueryString $queryString ` + -SubDomain 'vssps' -NoProject + + $objs = @() + + foreach ($item in $resp.value) { + $objs += [VSTeamUser]::new($item) + } + + Write-Output $objs + } + catch { + # I catch because using -ErrorAction Stop on the Invoke-RestMethod + # was still running the foreach after and reporting useless errors. + # This casuses the first error to terminate this execution. + _handleException $_ + } + } + } } \ No newline at end of file diff --git a/Source/Public/Get-VSTeamUserEntitlement.ps1 b/Source/Public/Get-VSTeamUserEntitlement.ps1 index c396a6788..0fb95e4a7 100644 --- a/Source/Public/Get-VSTeamUserEntitlement.ps1 +++ b/Source/Public/Get-VSTeamUserEntitlement.ps1 @@ -1,55 +1,55 @@ -function Get-VSTeamUserEntitlement { - [CmdletBinding(DefaultParameterSetName = 'List')] - param ( - [Parameter(ParameterSetName = 'List')] - [int] $Top = 100, - - [Parameter(ParameterSetName = 'List')] - [int] $Skip = 0, - - [Parameter(ParameterSetName = 'List')] - [ValidateSet('Projects', 'Extensions', 'Grouprules')] - [string[]] $Select, - - [Parameter(ParameterSetName = 'ByID')] - [Alias('UserId')] - [string[]] $Id - ) - - process { - # Thi swill throw if this account does not support MemberEntitlementManagement - _supportsMemberEntitlementManagement - - if ($Id) { - foreach ($item in $Id) { - # Build the url to return the single build - # Call the REST API - $resp = _callAPI -SubDomain 'vsaex' -Version $(_getApiVersion MemberEntitlementManagement) -Resource 'userentitlements' -id $item - - _applyTypesToUser -item $resp - - Write-Output $resp - } - } - else { - # Build the url to list the teams - # $listurl = _buildUserURL - $listurl = _buildRequestURI -SubDomain 'vsaex' -Resource 'userentitlements' ` - -Version $(_getApiVersion MemberEntitlementManagement) - - $listurl += _appendQueryString -name "top" -value $top -retainZero - $listurl += _appendQueryString -name "skip" -value $skip -retainZero - $listurl += _appendQueryString -name "select" -value ($select -join ",") - - # Call the REST API - $resp = _callAPI -url $listurl - - # Apply a Type Name so we can use custom format view and custom type extensions - foreach ($item in $resp.members) { - _applyTypesToUser -item $item - } - - Write-Output $resp.members - } - } +function Get-VSTeamUserEntitlement { + [CmdletBinding(DefaultParameterSetName = 'List')] + param ( + [Parameter(ParameterSetName = 'List')] + [int] $Top = 100, + + [Parameter(ParameterSetName = 'List')] + [int] $Skip = 0, + + [Parameter(ParameterSetName = 'List')] + [ValidateSet('Projects', 'Extensions', 'Grouprules')] + [string[]] $Select, + + [Parameter(ParameterSetName = 'ByID')] + [Alias('UserId')] + [string[]] $Id + ) + + process { + # This will throw if this account does not support MemberEntitlementManagement + _supportsMemberEntitlementManagement + + if ($Id) { + foreach ($item in $Id) { + # Build the url to return the single build + # Call the REST API + $resp = _callAPI -SubDomain 'vsaex' -Version $(_getApiVersion MemberEntitlementManagement) -Resource 'userentitlements' -id $item + + _applyTypesToUser -item $resp + + Write-Output $resp + } + } + else { + # Build the url to list the teams + # $listurl = _buildUserURL + $listurl = _buildRequestURI -SubDomain 'vsaex' -Resource 'userentitlements' ` + -Version $(_getApiVersion MemberEntitlementManagement) + + $listurl += _appendQueryString -name "top" -value $top -retainZero + $listurl += _appendQueryString -name "skip" -value $skip -retainZero + $listurl += _appendQueryString -name "select" -value ($select -join ",") + + # Call the REST API + $resp = _callAPI -url $listurl + + # Apply a Type Name so we can use custom format view and custom type extensions + foreach ($item in $resp.members) { + _applyTypesToUser -item $item + } + + Write-Output $resp.members + } + } } \ No newline at end of file diff --git a/Source/Public/Get-VSTeamVariableGroup.ps1 b/Source/Public/Get-VSTeamVariableGroup.ps1 index 39ff56daa..390bbe9c6 100644 --- a/Source/Public/Get-VSTeamVariableGroup.ps1 +++ b/Source/Public/Get-VSTeamVariableGroup.ps1 @@ -1,51 +1,49 @@ -function Get-VSTeamVariableGroup { - [CmdletBinding(DefaultParameterSetName = 'List')] - param( - [Parameter(Position = 0, ParameterSetName = 'ByID', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [string] $Id, - - [Parameter(Position = 0, ParameterSetName = 'ByName', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [string] $Name - ) - - DynamicParam { - _buildProjectNameDynamicParam -Position 1 - } - - Process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - - if ($Id) { - # Call the REST API - $resp = _callAPI -ProjectName $ProjectName -Area 'distributedtask' -Resource 'variablegroups' ` - -Version $(_getApiVersion VariableGroups) -Id $Id - - _applyTypesToVariableGroup -item $resp - - Write-Output $resp - } - else { - if ($Name) { - $resp = _callAPI -ProjectName $ProjectName -Area 'distributedtask' -Resource 'variablegroups' -Version $(_getApiVersion VariableGroups) -Method Get ` - -QueryString @{groupName = $Name } - - _applyTypesToVariableGroup -item $resp.value - - Write-Output $resp.value - } - else { - # Call the REST API - $resp = _callAPI -ProjectName $ProjectName -Area 'distributedtask' -Resource 'variablegroups' ` - -Version $(_getApiVersion VariableGroups) - - # Apply a Type Name so we can use custom format view and custom type extensions - foreach ($item in $resp.value) { - _applyTypesToVariableGroup -item $item - } - - return $resp.value - } - } - } -} +function Get-VSTeamVariableGroup { + [CmdletBinding(DefaultParameterSetName = 'List')] + param( + [Parameter(Position = 0, ParameterSetName = 'ByID', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [string] $Id, + + [Parameter(Position = 0, ParameterSetName = 'ByName', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [string] $Name, + + [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter]) ] + [string] $ProjectName + ) + + process { + if ($Id) { + # Call the REST API + $resp = _callAPI -ProjectName $ProjectName -Area 'distributedtask' -Resource 'variablegroups' ` + -Version $(_getApiVersion VariableGroups) -Id $Id + + _applyTypesToVariableGroup -item $resp + + Write-Output $resp + } + else { + if ($Name) { + $resp = _callAPI -ProjectName $ProjectName -Area 'distributedtask' -Resource 'variablegroups' -Version $(_getApiVersion VariableGroups) -Method Get ` + -QueryString @{groupName = $Name } + + _applyTypesToVariableGroup -item $resp.value + + Write-Output $resp.value + } + else { + # Call the REST API + $resp = _callAPI -ProjectName $ProjectName -Area 'distributedtask' -Resource 'variablegroups' ` + -Version $(_getApiVersion VariableGroups) + + # Apply a Type Name so we can use custom format view and custom type extensions + foreach ($item in $resp.value) { + _applyTypesToVariableGroup -item $item + } + + return $resp.value + } + } + } +} \ No newline at end of file diff --git a/Source/Public/Get-VSTeamWiql.ps1 b/Source/Public/Get-VSTeamWiql.ps1 index 8506c6d6a..00b34dd02 100644 --- a/Source/Public/Get-VSTeamWiql.ps1 +++ b/Source/Public/Get-VSTeamWiql.ps1 @@ -1,80 +1,80 @@ -function Get-VSTeamWiql { - [CmdletBinding(DefaultParameterSetName = 'ByID')] - param( - [Parameter(ParameterSetName = 'ByID', Mandatory = $true, Position = 0)] - [string] $Id, - - [Parameter(ParameterSetName = 'ByQuery', Mandatory = $true, Position = 0)] - [string] $Query, - - [Parameter(Mandatory = $true, Position = 1)] - [string] $Team, - - [int] $Top = 100, - - [Switch] $TimePrecision, - - [Switch] $Expand - ) - DynamicParam { - #$arrSet = Get-VSTeamProject | Select-Object -ExpandProperty Name - _buildProjectNameDynamicParam -mandatory $true #-arrSet $arrSet - } - - Process { - - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - - $QueryString = @{ - '$top' = $Top - timePrecision = $TimePrecision - } - - # Call the REST API - if ($Query) { - - $body = (@{ - query = $Query - }) | ConvertTo-Json - - $resp = _callAPI -ProjectName $ProjectName -Team $Team -Area 'wit' -Resource 'wiql' ` - -method "POST" -ContentType "application/json" ` - -Version $(_getApiVersion Core) ` - -Querystring $QueryString ` - -Body $body - } - else { - $resp = _callAPI -ProjectName $ProjectName -Team $Team -Area 'wit' -Resource 'wiql' ` - -Version $(_getApiVersion Core) -id "$Id" ` - -Querystring $QueryString - } - - if ($Expand) { - - [array]$Ids = $resp.workItems.id - $Fields = $resp.columns.referenceName - - $resp.workItems = @() - #splitting id array by 200, since a maximum of 200 ids are allowed per call - $countIds = $Ids.Count - $resp.workItems = for ($beginRange = 0; $beginRange -lt $countIds; $beginRange += 200) { - - $endRange = ($beginRange + 199) - - if ($endRange -gt $countIds) { - $idArray = $Ids[$beginRange..($countIds - 1)] - } - else { - $idArray = $Ids[$beginRange..($endRange)] - } - - (Get-VSTeamWorkItem -Fields $Fields -Id $idArray).value - } - } - - _applyTypesToWiql -item $resp - - return $resp - } +function Get-VSTeamWiql { + [CmdletBinding(DefaultParameterSetName = 'ByID')] + param( + [Parameter(ParameterSetName = 'ByID', Mandatory = $true, Position = 0)] + [string] $Id, + + [Parameter(ParameterSetName = 'ByQuery', Mandatory = $true, Position = 0)] + [string] $Query, + + [Parameter(Mandatory = $true, Position = 1)] + [string] $Team, + + [int] $Top = 100, + + [Switch] $TimePrecision, + + [Switch] $Expand + ) + DynamicParam { + #$arrSet = Get-VSTeamProject | Select-Object -ExpandProperty Name + _buildProjectNameDynamicParam -mandatory $true #-arrSet $arrSet + } + + Process { + + # Bind the parameter to a friendly variable + $ProjectName = $PSBoundParameters["ProjectName"] + + $QueryString = @{ + '$top' = $Top + timePrecision = $TimePrecision + } + + # Call the REST API + if ($Query) { + + $body = (@{ + query = $Query + }) | ConvertTo-Json + + $resp = _callAPI -ProjectName $ProjectName -Team $Team -Area 'wit' -Resource 'wiql' ` + -method "POST" -ContentType "application/json" ` + -Version $(_getApiVersion Core) ` + -Querystring $QueryString ` + -Body $body + } + else { + $resp = _callAPI -ProjectName $ProjectName -Team $Team -Area 'wit' -Resource 'wiql' ` + -Version $(_getApiVersion Core) -id "$Id" ` + -Querystring $QueryString + } + + if ($Expand) { + + [array]$Ids = $resp.workItems.id + $Fields = $resp.columns.referenceName + + $resp.workItems = @() + #splitting id array by 200, since a maximum of 200 ids are allowed per call + $countIds = $Ids.Count + $resp.workItems = for ($beginRange = 0; $beginRange -lt $countIds; $beginRange += 200) { + + $endRange = ($beginRange + 199) + + if ($endRange -gt $countIds) { + $idArray = $Ids[$beginRange..($countIds - 1)] + } + else { + $idArray = $Ids[$beginRange..($endRange)] + } + + (Get-VSTeamWorkItem -Fields $Fields -Id $idArray).value + } + } + + _applyTypesToWiql -item $resp + + return $resp + } } \ No newline at end of file diff --git a/Source/Public/Get-VSTeamWorkItem.ps1 b/Source/Public/Get-VSTeamWorkItem.ps1 index 0f92c5b8c..c627b66a1 100644 --- a/Source/Public/Get-VSTeamWorkItem.ps1 +++ b/Source/Public/Get-VSTeamWorkItem.ps1 @@ -1,49 +1,49 @@ -function Get-VSTeamWorkItem { - [CmdletBinding(DefaultParameterSetName = 'ByID')] - param( - [Parameter(Mandatory = $true, ValueFromPipeline = $true, Position = 0)] - [int[]] $Id, - - [Parameter(ParameterSetName = 'List')] - [ValidateSet('fail', 'omit')] - [string] $ErrorPolicy = 'omit', - - [ValidateSet('None', 'Relations', 'Fields', 'Links', 'All')] - [string] $Expand = 'None', - - [string[]] $Fields - ) - - Process { - # Call the REST API - if ($Id.Length -gt 1) { - $resp = _callAPI -NoProject -Area 'wit' -Resource 'workitems' ` - -Version $(_getApiVersion Core) ` - -Querystring @{ - '$Expand' = $Expand - fields = ($Fields -join ',') - errorPolicy = $ErrorPolicy - ids = ($Id -join ',') - } - - foreach ($item in $resp.value) { - _applyTypesToWorkItem -item $item - } - - return $resp.value - } - else { - $a = $Id[0] - $resp = _callAPI -NoProject -Area 'wit' -Resource 'workitems' ` - -Version $(_getApiVersion Core) -id "$a" ` - -Querystring @{ - '$Expand' = $Expand - fields = ($Fields -join ',') - } - - _applyTypesToWorkItem -item $resp - - return $resp - } - } +function Get-VSTeamWorkItem { + [CmdletBinding(DefaultParameterSetName = 'ByID')] + param( + [Parameter(Mandatory = $true, ValueFromPipeline = $true, Position = 0)] + [int[]] $Id, + + [Parameter(ParameterSetName = 'List')] + [ValidateSet('fail', 'omit')] + [string] $ErrorPolicy = 'omit', + + [ValidateSet('None', 'Relations', 'Fields', 'Links', 'All')] + [string] $Expand = 'None', + + [string[]] $Fields + ) + + Process { + # Call the REST API + if ($Id.Length -gt 1) { + $resp = _callAPI -NoProject -Area 'wit' -Resource 'workitems' ` + -Version $(_getApiVersion Core) ` + -Querystring @{ + '$Expand' = $Expand + fields = ($Fields -join ',') + errorPolicy = $ErrorPolicy + ids = ($Id -join ',') + } + + foreach ($item in $resp.value) { + _applyTypesToWorkItem -item $item + } + + return $resp.value + } + else { + $a = $Id[0] + $resp = _callAPI -NoProject -Area 'wit' -Resource 'workitems' ` + -Version $(_getApiVersion Core) -id "$a" ` + -Querystring @{ + '$Expand' = $Expand + fields = ($Fields -join ',') + } + + _applyTypesToWorkItem -item $resp + + return $resp + } + } } \ No newline at end of file diff --git a/Source/Public/Get-VSTeamWorkItemType.ps1 b/Source/Public/Get-VSTeamWorkItemType.ps1 index 62818e521..6bacc1cad 100644 --- a/Source/Public/Get-VSTeamWorkItemType.ps1 +++ b/Source/Public/Get-VSTeamWorkItemType.ps1 @@ -1,62 +1,45 @@ -function Get-VSTeamWorkItemType { - [CmdletBinding(DefaultParameterSetName = 'List')] - param() - - DynamicParam { - $dp = _buildProjectNameDynamicParam - - # If they have not set the default project you can't find the - # validateset so skip that check. However, we still need to give - # the option to pass a WorkItemType to use. - if ($Global:PSDefaultParameterValues["*:projectName"]) { - $wittypes = _getWorkItemTypes -ProjectName $Global:PSDefaultParameterValues["*:projectName"] - $arrSet = $wittypes - } - else { - Write-Verbose 'Call Set-VSTeamDefaultProject for Tab Complete of WorkItemType' - $wittypes = $null - $arrSet = $null - } - - $ParameterName = 'WorkItemType' - $rp = _buildDynamicParam -ParameterName $ParameterName -arrSet $arrSet -ParameterSetName 'ByType' - $dp.Add($ParameterName, $rp) - - $dp - } - - Process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - $WorkItemType = $PSBoundParameters["WorkItemType"] - - # Call the REST API - if ($WorkItemType) { - $resp = _callAPI -ProjectName $ProjectName -Area 'wit' -Resource 'workitemtypes' ` - -Version $(_getApiVersion Core) -id $WorkItemType - - # This call returns JSON with "": which causes the ConvertFrom-Json to fail. - # To replace all the "": with "_end": - $resp = $resp.Replace('"":', '"_end":') | ConvertFrom-Json - - _applyTypesWorkItemType -item $resp - - return $resp - } - else { - $resp = _callAPI -ProjectName $ProjectName -Area 'wit' -Resource 'workitemtypes' ` - -Version $(_getApiVersion Core) - - # This call returns JSON with "": which causes the ConvertFrom-Json to fail. - # To replace all the "": with "_end": - $resp = $resp.Replace('"":', '"_end":') | ConvertFrom-Json - - # Apply a Type Name so we can use custom format view and custom type extensions - foreach ($item in $resp.value) { - _applyTypesWorkItemType -item $item - } - - return $resp.value - } - } +function Get-VSTeamWorkItemType { + [CmdletBinding(DefaultParameterSetName = 'List')] + param( + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName, + + [Parameter()] + [WorkItemTypeValidateAttribute()] + [ArgumentCompleter([WorkItemTypeCompleter])] + [string] $WorkItemType + ) + + Process { + # Call the REST API + if ($WorkItemType) { + $resp = _callAPI -ProjectName $ProjectName -Area 'wit' -Resource 'workitemtypes' ` + -Version $(_getApiVersion Core) -id $WorkItemType + + # This call returns JSON with "": which causes the ConvertFrom-Json to fail. + # To replace all the "": with "_end": + $resp = $resp.Replace('"":', '"_end":') | ConvertFrom-Json + + _applyTypesWorkItemType -item $resp + + return $resp + } + else { + $resp = _callAPI -ProjectName $ProjectName -Area 'wit' -Resource 'workitemtypes' ` + -Version $(_getApiVersion Core) + + # This call returns JSON with "": which causes the ConvertFrom-Json to fail. + # To replace all the "": with "_end": + $resp = $resp.Replace('"":', '"_end":') | ConvertFrom-Json + + # Apply a Type Name so we can use custom format view and custom type extensions + foreach ($item in $resp.value) { + _applyTypesWorkItemType -item $item + } + + return $resp.value + } + } } \ No newline at end of file diff --git a/Source/Public/Invoke-VSTeamRequest.ps1 b/Source/Public/Invoke-VSTeamRequest.ps1 index 644552e51..588bd7f3b 100644 --- a/Source/Public/Invoke-VSTeamRequest.ps1 +++ b/Source/Public/Invoke-VSTeamRequest.ps1 @@ -1,26 +1,46 @@ function Invoke-VSTeamRequest { [CmdletBinding()] param( - [string]$resource, - [string]$area, - [string]$id, - [string]$version, - [string]$subDomain, + [string] $resource, + + [string] $area, + + [string] $id, + + [string] $version, + + [string] $subDomain, + [ValidateSet('Get', 'Post', 'Patch', 'Delete', 'Options', 'Put', 'Default', 'Head', 'Merge', 'Trace')] - [string]$method, + [string] $method, + [Parameter(ValueFromPipeline = $true)] - [object]$body, - [string]$InFile, - [string]$OutFile, - [switch]$JSON, - [string]$ContentType, - [string]$Url, - [hashtable]$AdditionalHeaders, - [switch]$UseProjectId - ) - DynamicParam { - _buildProjectNameDynamicParam -Mandatory $false - } + [object] $body, + + [string] $InFile, + + [string] $OutFile, + + [switch] $JSON, + + [string] $ContentType, + + [string] $Url, + + [hashtable] $AdditionalHeaders, + + [object] $QueryString, + + [string] $Team, + + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName, + + [switch] $UseProjectId, + + [switch] $NoProject) process { $params = $PSBoundParameters @@ -37,4 +57,4 @@ function Invoke-VSTeamRequest { $output } } -} \ No newline at end of file +} diff --git a/Source/Public/Remove-VSTeam.ps1 b/Source/Public/Remove-VSTeam.ps1 index 8b90df0cd..bf9e66ac4 100644 --- a/Source/Public/Remove-VSTeam.ps1 +++ b/Source/Public/Remove-VSTeam.ps1 @@ -1,26 +1,25 @@ -function Remove-VSTeam { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High")] - param( - [Parameter(Mandatory = $True, ValueFromPipelineByPropertyName = $true)] - [Alias('Name', 'TeamId', 'TeamName')] - [string]$Id, - - [switch]$Force - ) - DynamicParam { - _buildProjectNameDynamicParam - } - - process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - - if ($Force -or $PSCmdlet.ShouldProcess($Id, "Delete team")) { - # Call the REST API - _callAPI -Area 'projects' -Resource "$ProjectName/teams" -Id $Id ` - -Method Delete -Version $(_getApiVersion Core) | Out-Null - - Write-Output "Deleted team $Id" - } - } -} \ No newline at end of file +function Remove-VSTeam { + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High")] + param( + [Parameter(Mandatory = $True, ValueFromPipelineByPropertyName = $true)] + [Alias('Name', 'TeamId', 'TeamName')] + [string]$Id, + + [switch]$Force, + + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName + ) + + process { + if ($Force -or $PSCmdlet.ShouldProcess($Id, "Delete team")) { + # Call the REST API + _callAPI -Area 'projects' -Resource "$ProjectName/teams" -Id $Id ` + -Method Delete -Version $(_getApiVersion Core) | Out-Null + + Write-Output "Deleted team $Id" + } + } +} diff --git a/Source/Public/Remove-VSTeamAccessControlEntry.ps1 b/Source/Public/Remove-VSTeamAccessControlEntry.ps1 index f24daaf33..60ac82d3e 100644 --- a/Source/Public/Remove-VSTeamAccessControlEntry.ps1 +++ b/Source/Public/Remove-VSTeamAccessControlEntry.ps1 @@ -1,89 +1,85 @@ function Remove-VSTeamAccessControlEntry { - [CmdletBinding(DefaultParameterSetName = 'byNamespace', SupportsShouldProcess=$true, ConfirmImpact = 'High')] - [OutputType([System.String])] - param( - [Parameter(ParameterSetName = 'byNamespace', Mandatory = $true, ValueFromPipeline = $true)] - [VSTeamSecurityNamespace] $securityNamespace, + [CmdletBinding(DefaultParameterSetName = 'byNamespace', SupportsShouldProcess = $true, ConfirmImpact = 'High')] + [OutputType([System.String])] + param( + [Parameter(ParameterSetName = 'byNamespace', Mandatory = $true, ValueFromPipeline = $true)] + [VSTeamSecurityNamespace] $securityNamespace, - [Parameter(ParameterSetName = 'byNamespaceId', Mandatory = $true)] - [guid] $securityNamespaceId, + [Parameter(ParameterSetName = 'byNamespaceId', Mandatory = $true)] + [guid] $securityNamespaceId, - [Parameter(ParameterSetName = 'byNamespace', Mandatory = $true)] - [Parameter(ParameterSetName = 'byNamespaceId', Mandatory = $true)] - [string] $token, + [Parameter(ParameterSetName = 'byNamespace', Mandatory = $true)] + [Parameter(ParameterSetName = 'byNamespaceId', Mandatory = $true)] + [string] $token, - [Parameter(ParameterSetName = 'byNamespace', Mandatory = $true)] - [Parameter(ParameterSetName = 'byNamespaceId', Mandatory = $true)] - [System.Array] $descriptor - ) + [Parameter(ParameterSetName = 'byNamespace', Mandatory = $true)] + [Parameter(ParameterSetName = 'byNamespaceId', Mandatory = $true)] + [System.Array] $descriptor + ) - process { - if($securityNamespace) { - $securityNamespaceId = ($securityNamespace | Select-Object -ExpandProperty id -ErrorAction SilentlyContinue) - } + process { + if ($securityNamespace) { + $securityNamespaceId = ($securityNamespace | Select-Object -ExpandProperty id -ErrorAction SilentlyContinue) + } - if(($descriptor).count -gt 1) { - $descriptor = @() + if (($descriptor).count -gt 1) { + $descriptor = @() - foreach($uniqueDescriptor in $descriptor) { - $uniqueDescriptor = ($uniqueDescriptor).split(".")[1] - try { - - $uniqueDescriptor = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String("$uniqueDescriptor")) - } - catch [FormatException]{ - Write-Error "Could not convert base64 string to string." - continue - } - $uniqueDescriptor = "Microsoft.TeamFoundation.Identity;"+"$uniqueDescriptor" - - $descriptor += $uniqueDescriptor - } - - if(($descriptor).count -eq 0) { - Write-Error "No valid descriptors provided." - return - } - else - { - $descriptor = $descriptor -join "," - } - } - else { - $descriptor = ($descriptor).split(".")[1] + foreach ($uniqueDescriptor in $descriptor) { + $uniqueDescriptor = ($uniqueDescriptor).split(".")[1] try { - $descriptor = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($descriptor)) + + $uniqueDescriptor = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String("$uniqueDescriptor")) } - catch { - trap [FormatException]{} - Write-Error "Could not convert base64 string to string." - return + catch [FormatException] { + Write-Error "Could not convert base64 string to string." + continue } + $uniqueDescriptor = "Microsoft.TeamFoundation.Identity;" + "$uniqueDescriptor" + + $descriptor += $uniqueDescriptor + } + + if (($descriptor).count -eq 0) { + Write-Error "No valid descriptors provided." + return + } + else { + $descriptor = $descriptor -join "," + } + } + else { + $descriptor = ($descriptor).split(".")[1] + try { + $descriptor = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($descriptor)) + } + catch { + trap [FormatException] { } + Write-Error "Could not convert base64 string to string." + return + } - $descriptor = "Microsoft.TeamFoundation.Identity;"+"$descriptor" - } + $descriptor = "Microsoft.TeamFoundation.Identity;" + "$descriptor" + } - if($PSCmdlet.ShouldProcess("$token")) { - # Call the REST API - $resp = _callAPI -method DELETE -Area "accesscontrolentries" -id $securityNamespaceId -ContentType "application/json" -Version $([VSTeamVersions]::Core) -QueryString @{token = $token; descriptors = $descriptor} -ErrorAction SilentlyContinue - } + if ($PSCmdlet.ShouldProcess("$token")) { + # Call the REST API + $resp = _callAPI -method DELETE -Area "accesscontrolentries" -id $securityNamespaceId -ContentType "application/json" -Version $(_getApiVersion Core) -QueryString @{token = $token; descriptors = $descriptor } -ErrorAction SilentlyContinue + } - switch($resp) { - {($resp -eq $true)} - { - return "Removal of ACE from ACL succeeded." - } + switch ($resp) { + { ($resp -eq $true) } { + return "Removal of ACE from ACL succeeded." + } - {($resp -eq $false)} - { - Write-Error "Removal of ACE from ACL failed. Ensure descriptor and token are correct." - return - } - {($resp -ne $true) -and ($resp -ne $false)} - { - Write-Error "Unexpected response from REST API." - return - } - } - } - } + { ($resp -eq $false) } { + Write-Error "Removal of ACE from ACL failed. Ensure descriptor and token are correct." + return + } + { ($resp -ne $true) -and ($resp -ne $false) } { + Write-Error "Unexpected response from REST API." + return + } + } + } +} diff --git a/Source/Public/Remove-VSTeamAccessControlList.ps1 b/Source/Public/Remove-VSTeamAccessControlList.ps1 index 64001e89e..1354677fd 100644 --- a/Source/Public/Remove-VSTeamAccessControlList.ps1 +++ b/Source/Public/Remove-VSTeamAccessControlList.ps1 @@ -19,15 +19,13 @@ function Remove-VSTeamAccessControlList { ) process { - if ($SecurityNamespace) - { + if ($SecurityNamespace) { $SecurityNamespaceId = $SecurityNamespace.ID } - $queryString = @{} + $queryString = @{ } - if ($Tokens) - { + if ($Tokens) { $queryString.tokens = $Tokens -join "," } diff --git a/Source/Public/Remove-VSTeamAccount.ps1 b/Source/Public/Remove-VSTeamAccount.ps1 index 72c682886..875d9e294 100644 --- a/Source/Public/Remove-VSTeamAccount.ps1 +++ b/Source/Public/Remove-VSTeamAccount.ps1 @@ -1,7 +1,6 @@ function Remove-VSTeamAccount { [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium")] param( - # Forces the command without confirmation [switch] $Force ) diff --git a/Source/Public/Remove-VSTeamAgent.ps1 b/Source/Public/Remove-VSTeamAgent.ps1 index 34a5a098d..5a211879f 100644 --- a/Source/Public/Remove-VSTeamAgent.ps1 +++ b/Source/Public/Remove-VSTeamAgent.ps1 @@ -8,7 +8,6 @@ function Remove-VSTeamAgent { [Alias('AgentID')] [int[]] $Id, - # Forces the command without confirmation [switch] $Force ) diff --git a/Source/Public/Remove-VSTeamBuild.ps1 b/Source/Public/Remove-VSTeamBuild.ps1 index fa5fce366..b8e7de0e3 100644 --- a/Source/Public/Remove-VSTeamBuild.ps1 +++ b/Source/Public/Remove-VSTeamBuild.ps1 @@ -1,33 +1,30 @@ -function Remove-VSTeamBuild { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High")] - param( - [parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [Alias('BuildID')] - [int[]] $Id, - - [switch] $Force - ) - - DynamicParam { - _buildProjectNameDynamicParam - } - - Process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - - foreach ($item in $id) { - if ($Force -or $pscmdlet.ShouldProcess($item, "Delete Build")) { - try { - _callAPI -ProjectName $ProjectName -Area 'build' -Resource 'builds' -id $item ` - -Method Delete -Version $(_getApiVersion Build) | Out-Null - - Write-Output "Deleted build $item" - } - catch { - _handleException $_ - } - } - } - } -} \ No newline at end of file +function Remove-VSTeamBuild { + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High")] + param( + [parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [Alias('BuildID')] + [int[]] $Id, + + [switch] $Force, + + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName + ) + process { + foreach ($item in $id) { + if ($Force -or $pscmdlet.ShouldProcess($item, "Delete Build")) { + try { + _callAPI -ProjectName $ProjectName -Area 'build' -Resource 'builds' -id $item ` + -Method Delete -Version $(_getApiVersion Build) | Out-Null + + Write-Output "Deleted build $item" + } + catch { + _handleException $_ + } + } + } + } +} diff --git a/Source/Public/Remove-VSTeamBuildDefinition.ps1 b/Source/Public/Remove-VSTeamBuildDefinition.ps1 index cc34659ad..909bf0317 100644 --- a/Source/Public/Remove-VSTeamBuildDefinition.ps1 +++ b/Source/Public/Remove-VSTeamBuildDefinition.ps1 @@ -1,28 +1,25 @@ -function Remove-VSTeamBuildDefinition { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High")] - param( - [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [int[]] $Id, - - # Forces the command without confirmation - [switch] $Force - ) - - DynamicParam { - _buildProjectNameDynamicParam - } - - Process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - - foreach ($item in $id) { - if ($Force -or $pscmdlet.ShouldProcess($item, "Delete Build Definition")) { - # Call the REST API - _callAPI -Method Delete -ProjectName $ProjectName -Area build -Resource definitions -Id $item -Version $(_getApiVersion Build) | Out-Null - - Write-Output "Deleted build definition $item" - } - } - } -} \ No newline at end of file +function Remove-VSTeamBuildDefinition { + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High")] + param( + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [int[]] $Id, + + [switch] $Force, + + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName + ) + + process { + foreach ($item in $id) { + if ($Force -or $pscmdlet.ShouldProcess($item, "Delete Build Definition")) { + # Call the REST API + _callAPI -Method Delete -ProjectName $ProjectName -Area build -Resource definitions -Id $item -Version $(_getApiVersion Build) | Out-Null + + Write-Output "Deleted build definition $item" + } + } + } +} diff --git a/Source/Public/Remove-VSTeamBuildTag.ps1 b/Source/Public/Remove-VSTeamBuildTag.ps1 index be4d2f31f..63d1e7d9b 100644 --- a/Source/Public/Remove-VSTeamBuildTag.ps1 +++ b/Source/Public/Remove-VSTeamBuildTag.ps1 @@ -1,31 +1,30 @@ -function Remove-VSTeamBuildTag { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] - param( - [parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Position = 0)] - [string[]] $Tags, - - [parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [Alias('BuildID')] - [int[]] $Id, - - [switch] $Force - ) - - DynamicParam { - _buildProjectNameDynamicParam - } - - Process { - $ProjectName = $PSBoundParameters["ProjectName"] - - foreach ($item in $id) { - if ($Force -or $pscmdlet.ShouldProcess($item, "Remove-VSTeamBuildTag")) { - foreach ($tag in $tags) { - # Call the REST API - _callAPI -ProjectName $projectName -Area 'build' -Resource "builds/$Id/tags" ` - -Method Delete -Querystring @{tag = $tag} -Version $(_getApiVersion Build) | Out-Null - } - } - } - } -} \ No newline at end of file +function Remove-VSTeamBuildTag { + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] + param( + [parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Position = 0)] + [string[]] $Tags, + + [parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [Alias('BuildID')] + [int[]] $Id, + + [switch] $Force, + + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName + ) + + process { + foreach ($item in $id) { + if ($Force -or $pscmdlet.ShouldProcess($item, "Remove-VSTeamBuildTag")) { + foreach ($tag in $tags) { + # Call the REST API + _callAPI -ProjectName $projectName -Area 'build' -Resource "builds/$Id/tags" ` + -Method Delete -Querystring @{tag = $tag } -Version $(_getApiVersion Build) | Out-Null + } + } + } + } +} diff --git a/Source/Public/Remove-VSTeamFeed.ps1 b/Source/Public/Remove-VSTeamFeed.ps1 index ff4dd67d7..f9c3cf2e0 100644 --- a/Source/Public/Remove-VSTeamFeed.ps1 +++ b/Source/Public/Remove-VSTeamFeed.ps1 @@ -1,26 +1,23 @@ -function Remove-VSTeamFeed { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High")] - param ( - [Parameter(ParameterSetName = 'ByID', Position = 0, Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [Alias('FeedId')] - [string[]] $Id, - - # Forces the command without confirmation - [switch] $Force - ) - - process { - # Thi swill throw if this account does not support feeds - _supportsFeeds - - foreach ($item in $id) { - - if ($Force -or $pscmdlet.ShouldProcess($item, "Delete Package Feed")) { - # Call the REST API - _callAPI -NoProject -subDomain feeds -Method Delete -Id $item -Area packaging -Resource feeds -Version $(_getApiVersion Packaging) | Out-Null - - Write-Output "Deleted Feed $item" - } - } - } -} \ No newline at end of file +function Remove-VSTeamFeed { + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High")] + param ( + [Parameter(ParameterSetName = 'ByID', Position = 0, Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [Alias('FeedId')] + [string[]] $Id, + + [switch] $Force + ) + process { + # This will throw if this account does not support feeds + _supportsFeeds + + foreach ($item in $id) { + if ($Force -or $pscmdlet.ShouldProcess($item, "Delete Package Feed")) { + # Call the REST API + _callAPI -subDomain feeds -Method Delete -Id $item -Area packaging -Resource feeds -Version $(_getApiVersion Packaging) | Out-Null + + Write-Output "Deleted Feed $item" + } + } + } +} diff --git a/Source/Public/Remove-VSTeamPolicy.ps1 b/Source/Public/Remove-VSTeamPolicy.ps1 index d1bb59100..71efb5f86 100644 --- a/Source/Public/Remove-VSTeamPolicy.ps1 +++ b/Source/Public/Remove-VSTeamPolicy.ps1 @@ -1,30 +1,29 @@ -function Remove-VSTeamPolicy { - [CmdletBinding(SupportsShouldProcess = $true)] - param( - [parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [int[]] $Id, - - [switch] $Force - ) - - DynamicParam { - _buildProjectNameDynamicParam -mandatory $true - } - - Process { - $ProjectName = $PSBoundParameters["ProjectName"] - - foreach ($item in $id) { - if ($Force -or $pscmdlet.ShouldProcess($item, "Delete Policy")) { - try { - _callAPI -ProjectName $ProjectName -Method Delete -Id $item -Area policy -Resource configurations -Version $(_getApiVersion Git) | Out-Null - - Write-Output "Deleted policy $item" - } - catch { - _handleException $_ - } - } - } - } -} \ No newline at end of file +function Remove-VSTeamPolicy { + [CmdletBinding(SupportsShouldProcess = $true)] + param( + [parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [int[]] $Id, + + [switch] $Force, + + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName + ) + + process { + foreach ($item in $id) { + if ($Force -or $pscmdlet.ShouldProcess($item, "Delete Policy")) { + try { + _callAPI -ProjectName $ProjectName -Method Delete -Id $item -Area policy -Resource configurations -Version $(_getApiVersion Git) | Out-Null + + Write-Output "Deleted policy $item" + } + catch { + _handleException $_ + } + } + } + } +} diff --git a/Source/Public/Remove-VSTeamProject.ps1 b/Source/Public/Remove-VSTeamProject.ps1 index b4e918afd..4a3337645 100644 --- a/Source/Public/Remove-VSTeamProject.ps1 +++ b/Source/Public/Remove-VSTeamProject.ps1 @@ -1,28 +1,30 @@ -function Remove-VSTeamProject { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High")] - param( - [switch] $Force - ) - - DynamicParam { - _buildProjectNameDynamicParam -ParameterName 'Name' -AliasName 'ProjectName' - } - - Process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["Name"] - - if ($Force -or $pscmdlet.ShouldProcess($ProjectName, "Delete Project")) { - # Call the REST API - $resp = _callAPI -Area 'projects' -Id (Get-VSTeamProject $ProjectName).id ` - -Method Delete -Version $(_getApiVersion Core) - - _trackProjectProgress -resp $resp -title 'Deleting team project' -msg "Deleting $ProjectName" - - # Invalidate any cache of projects. - [VSTeamProjectCache]::timestamp = -1 - - Write-Output "Deleted $ProjectName" - } - } -} \ No newline at end of file +function Remove-VSTeamProject { + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High")] + param( + [switch] $Force, + + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [Alias('ProjectName')] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $Name + ) + + Process { + # Bind the parameter to a friendly variable + $ProjectName = $PSBoundParameters["Name"] + + if ($Force -or $pscmdlet.ShouldProcess($ProjectName, "Delete Project")) { + # Call the REST API + $resp = _callAPI -Area 'projects' -Id (Get-VSTeamProject $ProjectName).id ` + -Method Delete -Version $(_getApiVersion Core) + + _trackProjectProgress -resp $resp -title 'Deleting team project' -msg "Deleting $ProjectName" + + # Invalidate any cache of projects. + [VSTeamProjectCache]::timestamp = -1 + + Write-Output "Deleted $ProjectName" + } + } +} diff --git a/Source/Public/Remove-VSTeamRelease.ps1 b/Source/Public/Remove-VSTeamRelease.ps1 index 99922877a..58e1e636e 100644 --- a/Source/Public/Remove-VSTeamRelease.ps1 +++ b/Source/Public/Remove-VSTeamRelease.ps1 @@ -1,37 +1,29 @@ -function Remove-VSTeamRelease { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High")] - param( - [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [int[]] $Id, - - # Forces the command without confirmation - [switch] $Force - ) - - DynamicParam { - _buildProjectNameDynamicParam - } - - Process { - Write-Debug 'Remove-VSTeamRelease Process' - - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - - foreach ($item in $id) { - if ($force -or $pscmdlet.ShouldProcess($item, "Delete Release")) { - Write-Debug 'Remove-VSTeamRelease Call the REST API' - - try { - # Call the REST API - _callAPI -Method Delete -SubDomain vsrm -Area release -Resource releases -ProjectName $ProjectName -id $item -Version $(_getApiVersion Release) | Out-Null - - Write-Output "Deleted release $item" - } - catch { - _handleException $_ - } - } - } - } -} \ No newline at end of file +function Remove-VSTeamRelease { + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High")] + param( + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [int[]] $Id, + + [switch] $Force, + + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName + ) + process { + foreach ($item in $id) { + if ($force -or $pscmdlet.ShouldProcess($item, "Delete Release")) { + try { + # Call the REST API + _callAPI -Method Delete -SubDomain vsrm -Area release -Resource releases -ProjectName $ProjectName -id $item -Version $(_getApiVersion Release) | Out-Null + + Write-Output "Deleted release $item" + } + catch { + _handleException $_ + } + } + } + } +} diff --git a/Source/Public/Remove-VSTeamReleaseDefinition.ps1 b/Source/Public/Remove-VSTeamReleaseDefinition.ps1 index 39f10002a..1f26ac434 100644 --- a/Source/Public/Remove-VSTeamReleaseDefinition.ps1 +++ b/Source/Public/Remove-VSTeamReleaseDefinition.ps1 @@ -1,29 +1,26 @@ -function Remove-VSTeamReleaseDefinition { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High")] - param( - [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [int[]] $Id, - - # Forces the command without confirmation - [switch] $Force - ) - - DynamicParam { - _buildProjectNameDynamicParam - } - - Process { - Write-Debug 'Remove-VSTeamReleaseDefinition Process' - - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - - foreach ($item in $id) { - if ($force -or $pscmdlet.ShouldProcess($item, "Delete Release Definition")) { - _callAPI -Method Delete -subDomain vsrm -Area release -Resource definitions -Version $(_getApiVersion Release) -projectName $ProjectName -id $item | Out-Null - - Write-Output "Deleted release definition $item" - } - } - } -} \ No newline at end of file +function Remove-VSTeamReleaseDefinition { + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High")] + param( + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [int[]] $Id, + + [switch] $Force, + + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName + ) + + process { + Write-Debug 'Remove-VSTeamReleaseDefinition Process' + + foreach ($item in $id) { + if ($force -or $pscmdlet.ShouldProcess($item, "Delete Release Definition")) { + _callAPI -Method Delete -subDomain vsrm -Area release -Resource definitions -Version $(_getApiVersion Release) -projectName $ProjectName -id $item | Out-Null + + Write-Output "Deleted release definition $item" + } + } + } +} diff --git a/Source/Public/Remove-VSTeamServiceEndpoint.ps1 b/Source/Public/Remove-VSTeamServiceEndpoint.ps1 index 21f64daed..97a8a6f35 100644 --- a/Source/Public/Remove-VSTeamServiceEndpoint.ps1 +++ b/Source/Public/Remove-VSTeamServiceEndpoint.ps1 @@ -1,28 +1,26 @@ -function Remove-VSTeamServiceEndpoint { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High")] - param( - [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [string[]] $id, - - [switch] $Force - ) - - DynamicParam { - _buildProjectNameDynamicParam - } - - Process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - - foreach ($item in $id) { - if ($Force -or $pscmdlet.ShouldProcess($item, "Delete Service Endpoint")) { - # Call the REST API - _callAPI -projectName $projectName -Area 'distributedtask' -Resource 'serviceendpoints' -Id $item ` - -Method Delete -Version $(_getApiVersion DistributedTask) | Out-Null - - Write-Output "Deleted service endpoint $item" - } - } - } -} \ No newline at end of file +function Remove-VSTeamServiceEndpoint { + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High")] + param( + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [string[]] $id, + + [switch] $Force, + + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName + ) + + process { + foreach ($item in $id) { + if ($Force -or $pscmdlet.ShouldProcess($item, "Delete Service Endpoint")) { + # Call the REST API + _callAPI -projectName $projectName -Area 'distributedtask' -Resource 'serviceendpoints' -Id $item ` + -Method Delete -Version $(_getApiVersion DistributedTask) | Out-Null + + Write-Output "Deleted service endpoint $item" + } + } + } +} diff --git a/Source/Public/Remove-VSTeamTaskGroup.ps1 b/Source/Public/Remove-VSTeamTaskGroup.ps1 index 4a8cba9d1..8b58a462f 100644 --- a/Source/Public/Remove-VSTeamTaskGroup.ps1 +++ b/Source/Public/Remove-VSTeamTaskGroup.ps1 @@ -1,27 +1,24 @@ -function Remove-VSTeamTaskGroup { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] - param( - [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [string[]] $Id, - - [switch] $Force - ) - - DynamicParam { - _buildProjectNameDynamicParam - } - - process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - - foreach ($item in $Id) { - if ($Force -or $pscmdlet.ShouldProcess($item, "Delete Task Group")) { - # Call the REST API - _callAPI -Method Delete -ProjectName $ProjectName -Area distributedtask -Resource taskgroups -Version $(_getApiVersion TaskGroups) -Id $item | Out-Null - - Write-Output "Deleted task group $item" - } - } - } -} \ No newline at end of file +function Remove-VSTeamTaskGroup { + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] + param( + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [string[]] $Id, + + [switch] $Force, + + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName + ) + process { + foreach ($item in $Id) { + if ($Force -or $pscmdlet.ShouldProcess($item, "Delete Task Group")) { + # Call the REST API + _callAPI -Method Delete -ProjectName $ProjectName -Area distributedtask -Resource taskgroups -Version $(_getApiVersion TaskGroups) -Id $item | Out-Null + + Write-Output "Deleted task group $item" + } + } + } +} diff --git a/Source/Public/Remove-VSTeamUserEntitlement.ps1 b/Source/Public/Remove-VSTeamUserEntitlement.ps1 index cf4a6466b..5184805f5 100644 --- a/Source/Public/Remove-VSTeamUserEntitlement.ps1 +++ b/Source/Public/Remove-VSTeamUserEntitlement.ps1 @@ -1,40 +1,40 @@ -function Remove-VSTeamUserEntitlement { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High", DefaultParameterSetName = 'ById')] - param( - [Parameter(ParameterSetName = 'ById', Mandatory = $True, ValueFromPipelineByPropertyName = $true)] - [Alias('UserId')] - [string]$Id, - - [Parameter(ParameterSetName = 'ByEmail', Mandatory = $True, ValueFromPipelineByPropertyName = $true)] - [Alias('UserEmail')] - [string]$Email, - - [switch]$Force - ) - - process { - # Thi swill throw if this account does not support MemberEntitlementManagement - _supportsMemberEntitlementManagement - - if ($email) { - # We have to go find the id - $user = Get-VSTeamUserEntitlement | Where-Object email -eq $email - - if (-not $user) { - throw "Could not find user with an email equal to $email" - } - - $id = $user.id - - } else { - $user = Get-VSTeamUserEntitlement -Id $id - } - - if ($Force -or $PSCmdlet.ShouldProcess("$($user.userName) ($($user.email))", "Delete user")) { - # Call the REST API - _callAPI -Method Delete -SubDomain 'vsaex' -Resource 'userentitlements' -Id $Id -Version $(_getApiVersion MemberEntitlementManagement) | Out-Null - - Write-Output "Deleted user $($user.userName) ($($user.email))" - } - } +function Remove-VSTeamUserEntitlement { + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High", DefaultParameterSetName = 'ById')] + param( + [Parameter(ParameterSetName = 'ById', Mandatory = $True, ValueFromPipelineByPropertyName = $true)] + [Alias('UserId')] + [string]$Id, + + [Parameter(ParameterSetName = 'ByEmail', Mandatory = $True, ValueFromPipelineByPropertyName = $true)] + [Alias('UserEmail')] + [string]$Email, + + [switch]$Force + ) + + process { + # This will throw if this account does not support MemberEntitlementManagement + _supportsMemberEntitlementManagement + + if ($email) { + # We have to go find the id + $user = Get-VSTeamUserEntitlement | Where-Object email -eq $email + + if (-not $user) { + throw "Could not find user with an email equal to $email" + } + + $id = $user.id + + } else { + $user = Get-VSTeamUserEntitlement -Id $id + } + + if ($Force -or $PSCmdlet.ShouldProcess("$($user.userName) ($($user.email))", "Delete user")) { + # Call the REST API + _callAPI -Method Delete -SubDomain 'vsaex' -Resource 'userentitlements' -Id $Id -Version $(_getApiVersion MemberEntitlementManagement) | Out-Null + + Write-Output "Deleted user $($user.userName) ($($user.email))" + } + } } \ No newline at end of file diff --git a/Source/Public/Remove-VSTeamVariableGroup.ps1 b/Source/Public/Remove-VSTeamVariableGroup.ps1 index 999a11d6f..0794ccecc 100644 --- a/Source/Public/Remove-VSTeamVariableGroup.ps1 +++ b/Source/Public/Remove-VSTeamVariableGroup.ps1 @@ -1,28 +1,26 @@ -function Remove-VSTeamVariableGroup { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High")] - param( - [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [string[]] $id, - - [switch] $Force - ) - - DynamicParam { - _buildProjectNameDynamicParam - } - - Process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - - foreach ($item in $id) { - if ($Force -or $pscmdlet.ShouldProcess($item, "Delete Variable Group")) { - # Call the REST API - _callAPI -projectName $projectName -Area 'distributedtask' -Resource 'variablegroups' -Id $item ` - -Method Delete -Version $(_getApiVersion VariableGroups) | Out-Null - - Write-Output "Deleted variable group $item" - } - } - } -} +function Remove-VSTeamVariableGroup { + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High")] + param( + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [string[]] $id, + + [switch] $Force, + + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName + ) + + process { + foreach ($item in $id) { + if ($Force -or $pscmdlet.ShouldProcess($item, "Delete Variable Group")) { + # Call the REST API + _callAPI -projectName $projectName -Area 'distributedtask' -Resource 'variablegroups' -Id $item ` + -Method Delete -Version $(_getApiVersion VariableGroups) | Out-Null + + Write-Output "Deleted variable group $item" + } + } + } +} diff --git a/Source/Public/Set-VSTeamAccount.ps1 b/Source/Public/Set-VSTeamAccount.ps1 index abe5defaa..29deab806 100644 --- a/Source/Public/Set-VSTeamAccount.ps1 +++ b/Source/Public/Set-VSTeamAccount.ps1 @@ -136,7 +136,7 @@ function Set-VSTeamAccount { } } - if((_isOnWindows) -and ($UsingWindowsAuth) -and $(_isVSTS $Account)) { + if ((_isOnWindows) -and ($UsingWindowsAuth) -and $(_isVSTS $Account)) { Write-Error "Windows Auth can only be used with Team Fondation Server or Azure DevOps Server.$([Environment]::NewLine)Provide a Personal Access Token or Bearer Token to connect to Azure DevOps Services." return } @@ -154,4 +154,4 @@ function Set-VSTeamAccount { } } } -} +} \ No newline at end of file diff --git a/Source/Public/Set-VSTeamAlias.ps1 b/Source/Public/Set-VSTeamAlias.ps1 index aad4ae0e0..73c9319a9 100644 --- a/Source/Public/Set-VSTeamAlias.ps1 +++ b/Source/Public/Set-VSTeamAlias.ps1 @@ -5,115 +5,115 @@ function Set-VSTeamAlias { ) if ($Force -or $pscmdlet.ShouldProcess("Set Alias")) { - New-Alias ata Set-VSTeamAccount -Scope Global - New-Alias sta Set-VSTeamAccount -Scope Global - New-Alias gti Get-VSTeamInfo -Scope Global - New-Alias ivr Invoke-VSTeamRequest -Scope Global - New-Alias Get-ServiceEndpoint Get-VSTeamServiceEndpoint -Scope Global - New-Alias Add-AzureRMServiceEndpoint Add-VSTeamAzureRMServiceEndpoint -Scope Global - New-Alias Remove-ServiceEndpoint Remove-VSTeamServiceEndpoint -Scope Global - New-Alias Add-SonarQubeEndpoint Add-VSTeamSonarQubeEndpoint -Scope Global - New-Alias Add-KubernetesEndpoint Add-VSTeamKubernetesEndpoint -Scope Global - New-Alias Add-ServiceEndpoint Add-VSTeamServiceEndpoint -Scope Global - New-Alias Update-ServiceEndpoint Update-VSTeamServiceEndpoint -Scope Global - New-Alias Add-ServiceFabricEndpoint Add-VSTeamServiceFabricEndpoint -Scope Global - New-Alias Remove-ServiceFabricEndpoint Remove-VSTeamServiceFabricEndpoint -Scope Global - New-Alias Remove-AzureRMServiceEndpoint Remove-VSTeamAzureRMServiceEndpoint -Scope Global - New-Alias Remove-SonarQubeEndpoint Remove-VSTeamSonarQubeEndpoint -Scope Global - New-Alias Get-Build Get-VSTeamBuild -Scope Global - New-Alias Show-Build Show-VSTeamBuild -Scope Global - New-Alias Get-BuildLog Get-VSTeamBuildLog -Scope Global - New-Alias Get-BuildTag Get-VSTeamBuildTag -Scope Global - New-Alias Get-BuildArtifact Get-VSTeamBuildArtifact -Scope Global - New-Alias Add-Build Add-VSTeamBuild -Scope Global - New-Alias Add-BuildTag Add-VSTeamBuildTag -Scope Global - New-Alias Remove-Build Remove-VSTeamBuild -Scope Global - New-Alias Remove-BuildTag Remove-VSTeamBuildTag -Scope Global - New-Alias Update-Build Update-VSTeamBuild -Scope Global - New-Alias Get-BuildDefinition Get-VSTeamBuildDefinition -Scope Global - New-Alias Add-BuildDefinition Add-VSTeamBuildDefinition -Scope Global - New-Alias Show-BuildDefinition Show-VSTeamBuildDefinition -Scope Global - New-Alias Remove-BuildDefinition Remove-VSTeamBuildDefinition -Scope Global - New-Alias Show-Approval Show-VSTeamApproval -Scope Global - New-Alias Get-Approval Get-VSTeamApproval -Scope Global - New-Alias Set-Approval Set-VSTeamApproval -Scope Global - New-Alias Get-CloudSubscription Get-VSTeamCloudSubscription -Scope Global - New-Alias Get-GitRepository Get-VSTeamGitRepository -Scope Global - New-Alias Show-GitRepository Show-VSTeamGitRepository -Scope Global - New-Alias Add-GitRepository Add-VSTeamGitRepository -Scope Global - New-Alias Remove-GitRepository Remove-VSTeamGitRepository -Scope Global - New-Alias Get-Pool Get-VSTeamPool -Scope Global - New-Alias Get-Project Get-VSTeamProject -Scope Global - New-Alias Show-Project Show-VSTeamProject -Scope Global - New-Alias Update-Project Update-VSTeamProject -Scope Global - New-Alias Add-Project Add-VSTeamProject -Scope Global - New-Alias Remove-Project Remove-VSTeamProject -Scope Global - New-Alias Get-Queue Get-VSTeamQueue -Scope Global - New-Alias Get-ReleaseDefinition Get-VSTeamReleaseDefinition -Scope Global - New-Alias Show-ReleaseDefinition Show-VSTeamReleaseDefinition -Scope Global - New-Alias Add-ReleaseDefinition Add-VSTeamReleaseDefinition -Scope Global - New-Alias Remove-ReleaseDefinition Remove-VSTeamReleaseDefinition -Scope Global - New-Alias Get-Release Get-VSTeamRelease -Scope Global - New-Alias Show-Release Show-VSTeamRelease -Scope Global - New-Alias Add-Release Add-VSTeamRelease -Scope Global - New-Alias Remove-Release Remove-VSTeamRelease -Scope Global - New-Alias Set-ReleaseStatus Set-VSTeamReleaseStatus -Scope Global - New-Alias Add-ReleaseEnvironment Add-VSTeamReleaseEnvironment -Scope Global - New-Alias Get-TeamInfo Get-VSTeamInfo -Scope Global - New-Alias Add-TeamAccount Set-VSTeamAccount -Scope Global - New-Alias Remove-TeamAccount Remove-VSTeamAccount -Scope Global - New-Alias Get-TeamOption Get-VSTeamOption -Scope Global - New-Alias Get-TeamResourceArea Get-VSTeamResourceArea -Scope Global - New-Alias Clear-DefaultProject Clear-VSTeamDefaultProject -Scope Global - New-Alias Set-DefaultProject Set-VSTeamDefaultProject -Scope Global - New-Alias Get-TeamMember Get-VSTeamMember -Scope Global - New-Alias Get-Team Get-VSTeam -Scope Global - New-Alias Add-Team Add-VSTeam -Scope Global - New-Alias Update-Team Update-VSTeam -Scope Global - New-Alias Remove-Team Remove-VSTeam -Scope Global - New-Alias Add-Profile Add-VSTeamProfile -Scope Global - New-Alias Remove-Profile Remove-VSTeamProfile -Scope Global - New-Alias Get-Profile Get-VSTeamProfile -Scope Global - New-Alias Set-APIVersion Set-VSTeamAPIVersion -Scope Global - New-Alias Add-UserEntitlement Add-VSTeamUserEntitlement -Scope Global - New-Alias Remove-UserEntitlement Remove-VSTeamUserEntitlement -Scope Global - New-Alias Get-UserEntitlement Get-VSTeamUserEntitlement -Scope Global - New-Alias Update-UserEntitlement Update-VSTeamUserEntitlement -Scope Global - New-Alias Set-EnvironmentStatus Set-VSTeamEnvironmentStatus -Scope Global - New-Alias Get-ServiceEndpointType Get-VSTeamServiceEndpointType -Scope Global - New-Alias Update-BuildDefinition Update-VSTeamBuildDefinition -Scope Global - New-Alias Get-TfvcRootBranch Get-VSTeamTfvcRootBranch -Scope Global - New-Alias Get-TfvcBranch Get-VSTeamTfvcBranch -Scope Global - New-Alias Get-WorkItemType Get-VSTeamWorkItemType -Scope Global - New-Alias Add-WorkItem Add-VSTeamWorkItem -Scope Global - New-Alias Get-WorkItem Get-VSTeamWorkItem -Scope Global - New-Alias Remove-WorkItem Remove-VSTeamWorkItem -Scope Global - New-Alias Show-WorkItem Show-VSTeamWorkItem -Scope Global - New-Alias Get-Policy Get-VSTeamPolicy -Scope Global - New-Alias Get-PolicyType Get-VSTeamPolicyType -Scope Global - New-Alias Add-Policy Add-VSTeamPolicy -Scope Global - New-Alias Update-Policy Update-VSTeamPolicy -Scope Global - New-Alias Remove-Policy Remove-VSTeamPolicy -Scope Global - New-Alias Get-GitRef Get-VSTeamGitRef -Scope Global - New-Alias Get-Agent Get-VSTeamAgent -Scope Global - New-Alias Remove-Agent Remove-VSTeamAgent -Scope Global - New-Alias Enable-Agent Enable-VSTeamAgent -Scope Global - New-Alias Disable-Agent Disable-VSTeamAgent -Scope Global - New-Alias Update-Profile Update-VSTeamProfile -Scope Global - New-Alias Get-APIVersion Get-VSTeamAPIVersion -Scope Global - New-Alias Add-NuGetEndpoint Add-VSTeamNuGetEndpoint -Scope Global - New-Alias Get-Feed Get-VSTeamFeed -Scope Global - New-Alias Add-Feed Add-VSTeamFeed -Scope Global - New-Alias Show-Feed Show-VSTeamFeed -Scope Global - New-Alias Remove-Feed Remove-VSTeamFeed -Scope Global - New-Alias Get-PullRequest Get-VSTeamPullRequest -Scope Global - New-Alias Show-PullRequest Show-VSTeamPullRequest -Scope Global - New-Alias Add-Extension Add-VSTeamExtension -Scope Global - New-Alias Get-Extension Get-VSTeamExtension -Scope Global - New-Alias Update-Extension Update-VSTeamExtension -Scope Global - New-Alias Remove-Extension Remove-VSTeamExtension -Scope Global - New-Alias Update-WorkItem Update-VSTeamWorkItem -Scope Global - New-Alias Get-JobRequest Get-VSTeamJobRequest -Scope Global - New-Alias Update-ReleaseDefinition Update-VSTeamReleaseDefinition -Scope Global + New-Alias ata Set-VSTeamAccount -Scope Global -Force + New-Alias sta Set-VSTeamAccount -Scope Global -Force + New-Alias gti Get-VSTeamInfo -Scope Global -Force + New-Alias ivr Invoke-VSTeamRequest -Scope Global -Force + New-Alias Get-ServiceEndpoint Get-VSTeamServiceEndpoint -Scope Global -Force + New-Alias Add-AzureRMServiceEndpoint Add-VSTeamAzureRMServiceEndpoint -Scope Global -Force + New-Alias Remove-ServiceEndpoint Remove-VSTeamServiceEndpoint -Scope Global -Force + New-Alias Add-SonarQubeEndpoint Add-VSTeamSonarQubeEndpoint -Scope Global -Force + New-Alias Add-KubernetesEndpoint Add-VSTeamKubernetesEndpoint -Scope Global -Force + New-Alias Add-ServiceEndpoint Add-VSTeamServiceEndpoint -Scope Global -Force + New-Alias Update-ServiceEndpoint Update-VSTeamServiceEndpoint -Scope Global -Force + New-Alias Add-ServiceFabricEndpoint Add-VSTeamServiceFabricEndpoint -Scope Global -Force + New-Alias Remove-ServiceFabricEndpoint Remove-VSTeamServiceFabricEndpoint -Scope Global -Force + New-Alias Remove-AzureRMServiceEndpoint Remove-VSTeamAzureRMServiceEndpoint -Scope Global -Force + New-Alias Remove-SonarQubeEndpoint Remove-VSTeamSonarQubeEndpoint -Scope Global -Force + New-Alias Get-Build Get-VSTeamBuild -Scope Global -Force + New-Alias Show-Build Show-VSTeamBuild -Scope Global -Force + New-Alias Get-BuildLog Get-VSTeamBuildLog -Scope Global -Force + New-Alias Get-BuildTag Get-VSTeamBuildTag -Scope Global -Force + New-Alias Get-BuildArtifact Get-VSTeamBuildArtifact -Scope Global -Force + New-Alias Add-Build Add-VSTeamBuild -Scope Global -Force + New-Alias Add-BuildTag Add-VSTeamBuildTag -Scope Global -Force + New-Alias Remove-Build Remove-VSTeamBuild -Scope Global -Force + New-Alias Remove-BuildTag Remove-VSTeamBuildTag -Scope Global -Force + New-Alias Update-Build Update-VSTeamBuild -Scope Global -Force + New-Alias Get-BuildDefinition Get-VSTeamBuildDefinition -Scope Global -Force + New-Alias Add-BuildDefinition Add-VSTeamBuildDefinition -Scope Global -Force + New-Alias Show-BuildDefinition Show-VSTeamBuildDefinition -Scope Global -Force + New-Alias Remove-BuildDefinition Remove-VSTeamBuildDefinition -Scope Global -Force + New-Alias Show-Approval Show-VSTeamApproval -Scope Global -Force + New-Alias Get-Approval Get-VSTeamApproval -Scope Global -Force + New-Alias Set-Approval Set-VSTeamApproval -Scope Global -Force + New-Alias Get-CloudSubscription Get-VSTeamCloudSubscription -Scope Global -Force + New-Alias Get-GitRepository Get-VSTeamGitRepository -Scope Global -Force + New-Alias Show-GitRepository Show-VSTeamGitRepository -Scope Global -Force + New-Alias Add-GitRepository Add-VSTeamGitRepository -Scope Global -Force + New-Alias Remove-GitRepository Remove-VSTeamGitRepository -Scope Global -Force + New-Alias Get-Pool Get-VSTeamPool -Scope Global -Force + New-Alias Get-Project Get-VSTeamProject -Scope Global -Force + New-Alias Show-Project Show-VSTeamProject -Scope Global -Force + New-Alias Update-Project Update-VSTeamProject -Scope Global -Force + New-Alias Add-Project Add-VSTeamProject -Scope Global -Force + New-Alias Remove-Project Remove-VSTeamProject -Scope Global -Force + New-Alias Get-Queue Get-VSTeamQueue -Scope Global -Force + New-Alias Get-ReleaseDefinition Get-VSTeamReleaseDefinition -Scope Global -Force + New-Alias Show-ReleaseDefinition Show-VSTeamReleaseDefinition -Scope Global -Force + New-Alias Add-ReleaseDefinition Add-VSTeamReleaseDefinition -Scope Global -Force + New-Alias Remove-ReleaseDefinition Remove-VSTeamReleaseDefinition -Scope Global -Force + New-Alias Get-Release Get-VSTeamRelease -Scope Global -Force + New-Alias Show-Release Show-VSTeamRelease -Scope Global -Force + New-Alias Add-Release Add-VSTeamRelease -Scope Global -Force + New-Alias Remove-Release Remove-VSTeamRelease -Scope Global -Force + New-Alias Set-ReleaseStatus Set-VSTeamReleaseStatus -Scope Global -Force + New-Alias Add-ReleaseEnvironment Add-VSTeamReleaseEnvironment -Scope Global -Force + New-Alias Get-TeamInfo Get-VSTeamInfo -Scope Global -Force + New-Alias Add-TeamAccount Set-VSTeamAccount -Scope Global -Force + New-Alias Remove-TeamAccount Remove-VSTeamAccount -Scope Global -Force + New-Alias Get-TeamOption Get-VSTeamOption -Scope Global -Force + New-Alias Get-TeamResourceArea Get-VSTeamResourceArea -Scope Global -Force + New-Alias Clear-DefaultProject Clear-VSTeamDefaultProject -Scope Global -Force + New-Alias Set-DefaultProject Set-VSTeamDefaultProject -Scope Global -Force + New-Alias Get-TeamMember Get-VSTeamMember -Scope Global -Force + New-Alias Get-Team Get-VSTeam -Scope Global -Force + New-Alias Add-Team Add-VSTeam -Scope Global -Force + New-Alias Update-Team Update-VSTeam -Scope Global -Force + New-Alias Remove-Team Remove-VSTeam -Scope Global -Force + New-Alias Add-Profile Add-VSTeamProfile -Scope Global -Force + New-Alias Remove-Profile Remove-VSTeamProfile -Scope Global -Force + New-Alias Get-Profile Get-VSTeamProfile -Scope Global -Force + New-Alias Set-APIVersion Set-VSTeamAPIVersion -Scope Global -Force + New-Alias Add-UserEntitlement Add-VSTeamUserEntitlement -Scope Global -Force + New-Alias Remove-UserEntitlement Remove-VSTeamUserEntitlement -Scope Global -Force + New-Alias Get-UserEntitlement Get-VSTeamUserEntitlement -Scope Global -Force + New-Alias Update-UserEntitlement Update-VSTeamUserEntitlement -Scope Global -Force + New-Alias Set-EnvironmentStatus Set-VSTeamEnvironmentStatus -Scope Global -Force + New-Alias Get-ServiceEndpointType Get-VSTeamServiceEndpointType -Scope Global -Force + New-Alias Update-BuildDefinition Update-VSTeamBuildDefinition -Scope Global -Force + New-Alias Get-TfvcRootBranch Get-VSTeamTfvcRootBranch -Scope Global -Force + New-Alias Get-TfvcBranch Get-VSTeamTfvcBranch -Scope Global -Force + New-Alias Get-WorkItemType Get-VSTeamWorkItemType -Scope Global -Force + New-Alias Add-WorkItem Add-VSTeamWorkItem -Scope Global -Force + New-Alias Get-WorkItem Get-VSTeamWorkItem -Scope Global -Force + New-Alias Remove-WorkItem Remove-VSTeamWorkItem -Scope Global -Force + New-Alias Show-WorkItem Show-VSTeamWorkItem -Scope Global -Force + New-Alias Get-Policy Get-VSTeamPolicy -Scope Global -Force + New-Alias Get-PolicyType Get-VSTeamPolicyType -Scope Global -Force + New-Alias Add-Policy Add-VSTeamPolicy -Scope Global -Force + New-Alias Update-Policy Update-VSTeamPolicy -Scope Global -Force + New-Alias Remove-Policy Remove-VSTeamPolicy -Scope Global -Force + New-Alias Get-GitRef Get-VSTeamGitRef -Scope Global -Force + New-Alias Get-Agent Get-VSTeamAgent -Scope Global -Force + New-Alias Remove-Agent Remove-VSTeamAgent -Scope Global -Force + New-Alias Enable-Agent Enable-VSTeamAgent -Scope Global -Force + New-Alias Disable-Agent Disable-VSTeamAgent -Scope Global -Force + New-Alias Update-Profile Update-VSTeamProfile -Scope Global -Force + New-Alias Get-APIVersion Get-VSTeamAPIVersion -Scope Global -Force + New-Alias Add-NuGetEndpoint Add-VSTeamNuGetEndpoint -Scope Global -Force + New-Alias Get-Feed Get-VSTeamFeed -Scope Global -Force + New-Alias Add-Feed Add-VSTeamFeed -Scope Global -Force + New-Alias Show-Feed Show-VSTeamFeed -Scope Global -Force + New-Alias Remove-Feed Remove-VSTeamFeed -Scope Global -Force + New-Alias Get-PullRequest Get-VSTeamPullRequest -Scope Global -Force + New-Alias Show-PullRequest Show-VSTeamPullRequest -Scope Global -Force + New-Alias Add-Extension Add-VSTeamExtension -Scope Global -Force + New-Alias Get-Extension Get-VSTeamExtension -Scope Global -Force + New-Alias Update-Extension Update-VSTeamExtension -Scope Global -Force + New-Alias Remove-Extension Remove-VSTeamExtension -Scope Global -Force + New-Alias Update-WorkItem Update-VSTeamWorkItem -Scope Global -Force + New-Alias Get-JobRequest Get-VSTeamJobRequest -Scope Global -Force + New-Alias Update-ReleaseDefinition Update-VSTeamReleaseDefinition -Scope Global -Force } } \ No newline at end of file diff --git a/Source/Public/Set-VSTeamApproval.ps1 b/Source/Public/Set-VSTeamApproval.ps1 index a3c53a04f..04a80eb5d 100644 --- a/Source/Public/Set-VSTeamApproval.ps1 +++ b/Source/Public/Set-VSTeamApproval.ps1 @@ -1,49 +1,43 @@ -function Set-VSTeamApproval { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium")] - param( - [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [int[]] $Id, - - [Parameter(Mandatory = $true)] - [ValidateSet('Approved', 'Rejected', 'Pending', 'ReAssigned')] - [string] $Status, - - [string] $Approver, - - [string] $Comment, - - # Forces the command without confirmation - [switch] $Force - ) - - DynamicParam { - _buildProjectNameDynamicParam - } - - Process { - Write-Debug 'Set-VSTeamApproval Process' - - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - - $body = '{ "status": "' + $status + '", "approver": "' + $approver + '", "comments": "' + $comment + '" }' - Write-Verbose $body - - foreach ($item in $id) { - if ($force -or $pscmdlet.ShouldProcess($item, "Set Approval Status")) { - Write-Debug 'Set-VSTeamApproval Call the REST API' - - try { - # Call the REST API - _callAPI -Method Patch -SubDomain vsrm -ProjectName $ProjectName -Area release -Resource approvals ` - -Id $item -Version $(_getApiVersion Release) -body $body -ContentType 'application/json' | Out-Null - - Write-Output "Approval $item status changed to $status" - } - catch { - _handleException $_ - } - } - } - } -} \ No newline at end of file +function Set-VSTeamApproval { + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium")] + param( + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [int[]] $Id, + + [Parameter(Mandatory = $true)] + [ValidateSet('Approved', 'Rejected', 'Pending', 'ReAssigned')] + [string] $Status, + + [string] $Approver, + + [string] $Comment, + + [switch] $Force, + + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName + ) + + process { + $body = '{ "status": "' + $status + '", "approver": "' + $approver + '", "comments": "' + $comment + '" }' + + Write-Verbose $body + + foreach ($item in $id) { + if ($force -or $pscmdlet.ShouldProcess($item, "Set Approval Status")) { + try { + # Call the REST API + _callAPI -Method Patch -SubDomain vsrm -ProjectName $ProjectName -Area release -Resource approvals ` + -Id $item -Version $(_getApiVersion Release) -body $body -ContentType 'application/json' | Out-Null + + Write-Output "Approval $item status changed to $status" + } + catch { + _handleException $_ + } + } + } + } +} diff --git a/Source/Public/Set-VSTeamDefaultProject.ps1 b/Source/Public/Set-VSTeamDefaultProject.ps1 index 958a13b42..c4b008ef1 100644 --- a/Source/Public/Set-VSTeamDefaultProject.ps1 +++ b/Source/Public/Set-VSTeamDefaultProject.ps1 @@ -1,25 +1,28 @@ function Set-VSTeamDefaultProject { [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseDeclaredVarsMoreThanAssignments", "")] [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] - param([switch] $Force) + param( + [switch] $Force, + + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $Project + ) DynamicParam { - $dp = _buildProjectNameDynamicParam -ParameterName "Project" - + $dp = New-Object System.Management.Automation.RuntimeDefinedParameterDictionary + # Only add these options on Windows Machines if (_isOnWindows) { $ParameterName = 'Level' - # Create the collection of attributes $AttributeCollection = New-Object System.Collections.ObjectModel.Collection[System.Attribute] - # Create and set the parameters' attributes $ParameterAttribute = New-Object System.Management.Automation.ParameterAttribute $ParameterAttribute.Mandatory = $false $ParameterAttribute.HelpMessage = "On Windows machines allows you to store the default project at the process, user or machine level. Not available on other platforms." - # Add the attributes to the attributes collection $AttributeCollection.Add($ParameterAttribute) - # Generate and set the ValidateSet if (_testAdministrator) { $arrSet = "Process", "User", "Machine" @@ -27,24 +30,18 @@ function Set-VSTeamDefaultProject { else { $arrSet = "Process", "User" } - $ValidateSetAttribute = New-Object System.Management.Automation.ValidateSetAttribute($arrSet) - # Add the ValidateSet to the attributes collection $AttributeCollection.Add($ValidateSetAttribute) - # Create and return the dynamic parameter $RuntimeParameter = New-Object System.Management.Automation.RuntimeDefinedParameter($ParameterName, [string], $AttributeCollection) $dp.Add($ParameterName, $RuntimeParameter) } - + return $dp } begin { - # Bind the parameter to a friendly variable - $Project = $PSBoundParameters["Project"] - if (_isOnWindows) { $Level = $PSBoundParameters[$ParameterName] } @@ -56,7 +53,7 @@ function Set-VSTeamDefaultProject { if (-not $Level) { $Level = "Process" } - + # You always have to set at the process level or they will Not # be seen in your current session. $env:TEAM_PROJECT = $Project @@ -65,7 +62,7 @@ function Set-VSTeamDefaultProject { [System.Environment]::SetEnvironmentVariable("TEAM_PROJECT", $Project, $Level) } - $Global:PSDefaultParameterValues["*:projectName"] = $Project + $Global:PSDefaultParameterValues["*-vsteam*:projectName"] = $Project } } -} \ No newline at end of file +} diff --git a/Source/Public/Set-VSTeamEnvironmentStatus.ps1 b/Source/Public/Set-VSTeamEnvironmentStatus.ps1 index 9dd7967ff..efeeb2eb1 100644 --- a/Source/Public/Set-VSTeamEnvironmentStatus.ps1 +++ b/Source/Public/Set-VSTeamEnvironmentStatus.ps1 @@ -1,53 +1,46 @@ -function Set-VSTeamEnvironmentStatus { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium")] - param( - [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [Alias('Id')] - [int[]] $EnvironmentId, - - [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [int] $ReleaseId, - - [Parameter(Mandatory = $true, Position = 0)] - [ValidateSet('canceled', 'inProgress', 'notStarted', 'partiallySucceeded', 'queued', 'rejected', 'scheduled', 'succeeded', 'undefined')] - [Alias('EnvironmentStatus')] - [string] $Status, - - [string] $Comment, - - [datetime] $ScheduledDeploymentTime, - - # Forces the command without confirmation - [switch] $Force - ) - - DynamicParam { - _buildProjectNameDynamicParam -Position 1 - } - - Process { - Write-Debug 'Set-VSTeamEnvironmentStatus Process' - - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - - $body = ConvertTo-Json ([PSCustomObject]@{status = $Status; comment = $Comment; scheduledDeploymentTime = $ScheduledDeploymentTime}) - - foreach ($item in $EnvironmentId) { - if ($force -or $pscmdlet.ShouldProcess($item, "Set Status on Environment")) { - Write-Debug 'Set-VSTeamEnvironmentStatus Call the REST API' - - try { - # Call the REST API - _callAPI -Method Patch -SubDomain vsrm -Area release -Resource "releases/$ReleaseId/environments" -projectName $ProjectName -id $item ` - -body $body -ContentType 'application/json' -Version $(_getApiVersion Release) | Out-Null - - Write-Output "Environment $item status changed to $status" - } - catch { - _handleException $_ - } - } - } - } -} \ No newline at end of file +function Set-VSTeamEnvironmentStatus { + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium")] + param( + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [Alias('Id')] + [int[]] $EnvironmentId, + + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [int] $ReleaseId, + + [Parameter(Mandatory = $true, Position = 0)] + [ValidateSet('canceled', 'inProgress', 'notStarted', 'partiallySucceeded', 'queued', 'rejected', 'scheduled', 'succeeded', 'undefined')] + [Alias('EnvironmentStatus')] + [string] $Status, + + [string] $Comment, + + [datetime] $ScheduledDeploymentTime, + + [switch] $Force, + + [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter]) ] + [string] $ProjectName + ) + + process { + $body = ConvertTo-Json ([PSCustomObject]@{status = $Status; comment = $Comment; scheduledDeploymentTime = $ScheduledDeploymentTime }) + + foreach ($item in $EnvironmentId) { + if ($force -or $pscmdlet.ShouldProcess($item, "Set Status on Environment")) { + try { + # Call the REST API + _callAPI -Method Patch -SubDomain vsrm -Area release -Resource "releases/$ReleaseId/environments" -projectName $ProjectName -id $item ` + -body $body -ContentType 'application/json' -Version $(_getApiVersion Release) | Out-Null + + Write-Output "Environment $item status changed to $status" + } + catch { + _handleException $_ + } + } + } + } +} diff --git a/Source/Public/Set-VSTeamPermissionInheritance.ps1 b/Source/Public/Set-VSTeamPermissionInheritance.ps1 index 36f8700af..7725219f0 100644 --- a/Source/Public/Set-VSTeamPermissionInheritance.ps1 +++ b/Source/Public/Set-VSTeamPermissionInheritance.ps1 @@ -12,17 +12,15 @@ [Parameter(Mandatory)] [bool] $NewState, - # Forces the command without confirmation - [switch] $Force - ) + [switch] $Force, - DynamicParam { - _buildProjectNameDynamicParam -mandatory $true - } + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName + ) process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] Write-Verbose "Creating VSTeamPermissionInheritance" $item = [VSTeamPermissionInheritance]::new($ProjectName, $Name, $ResourceType) $token = $item.Token @@ -59,11 +57,10 @@ Write-Verbose "Result: $(ConvertTo-Json -InputObject $resp -Depth 100)" if (($resp | Select-Object -ExpandProperty dataProviders | Select-Object -ExpandProperty 'ms.vss-admin-web.security-view-update-data-provider' | Select-Object -ExpandProperty statusCode) -eq "204") { - Return "Inheritance successfully changed for $ResourceType $Name." + return "Inheritance successfully changed for $ResourceType $Name." } else { Write-Error "Inheritance change failed for $ResourceType $Name." - Return } } } \ No newline at end of file diff --git a/Source/Public/Set-VSTeamReleaseStatus.ps1 b/Source/Public/Set-VSTeamReleaseStatus.ps1 index 41c2e8128..e309074cc 100644 --- a/Source/Public/Set-VSTeamReleaseStatus.ps1 +++ b/Source/Public/Set-VSTeamReleaseStatus.ps1 @@ -1,43 +1,37 @@ -function Set-VSTeamReleaseStatus { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium")] - param( - [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [int[]] $Id, - - [ValidateSet('Active', 'Abandoned')] - [string] $Status, - - # Forces the command without confirmation - [switch] $Force - ) - - DynamicParam { - _buildProjectNameDynamicParam - } - - Process { - Write-Debug 'Set-VSTeamReleaseStatus Process' - - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - - $body = '{ "id": ' + $id + ', "status": "' + $status + '" }' - - foreach ($item in $id) { - if ($force -or $pscmdlet.ShouldProcess($item, "Set status on Release")) { - Write-Debug 'Set-VSTeamReleaseStatus Call the REST API' - - try { - # Call the REST API - _callAPI -Method Patch -SubDomain vsrm -Area release -Resource releases -projectName $ProjectName -id $item ` - -body $body -ContentType 'application/json' -Version $(_getApiVersion Release) | Out-Null - - Write-Output "Release $item status changed to $status" - } - catch { - _handleException $_ - } - } - } - } -} \ No newline at end of file +function Set-VSTeamReleaseStatus { + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium")] + param( + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [int[]] $Id, + + [ValidateSet('Active', 'Abandoned')] + [string] $Status, + + [switch] $Force, + + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName + ) + + Process { + $body = '{ "id": ' + $id + ', "status": "' + $status + '" }' + + foreach ($item in $id) { + if ($force -or $pscmdlet.ShouldProcess($item, "Set status on Release")) { + + try { + # Call the REST API + _callAPI -Method Patch -SubDomain vsrm -Area release -Resource releases -projectName $ProjectName -id $item ` + -body $body -ContentType 'application/json' -Version $(_getApiVersion Release) | Out-Null + + Write-Output "Release $item status changed to $status" + } + catch { + _handleException $_ + } + } + } + } +} diff --git a/Source/Public/Show-VSTeamApproval.ps1 b/Source/Public/Show-VSTeamApproval.ps1 index a1c89ef84..a6df45135 100644 --- a/Source/Public/Show-VSTeamApproval.ps1 +++ b/Source/Public/Show-VSTeamApproval.ps1 @@ -3,19 +3,15 @@ function Show-VSTeamApproval { param( [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [Alias('Id')] - [int] $ReleaseDefinitionId + [int] $ReleaseDefinitionId, + + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName ) - DynamicParam { - _buildProjectNameDynamicParam - } - - Process { - Write-Debug 'Show-VSTeamApproval Process' - - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - + process { Show-Browser "$(_getInstance)/$ProjectName/_release?releaseId=$ReleaseDefinitionId" } -} \ No newline at end of file +} diff --git a/Source/Public/Show-VSTeamBuild.ps1 b/Source/Public/Show-VSTeamBuild.ps1 index a46660253..3d96b2f70 100644 --- a/Source/Public/Show-VSTeamBuild.ps1 +++ b/Source/Public/Show-VSTeamBuild.ps1 @@ -3,17 +3,15 @@ function Show-VSTeamBuild { param ( [Parameter(ParameterSetName = 'ByID', ValueFromPipelineByPropertyName = $true)] [Alias('BuildID')] - [int[]] $Id - ) - - DynamicParam { - _buildProjectNameDynamicParam - } + [int[]] $Id, + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName + ) + process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - Show-Browser "$(_getInstance)/$ProjectName/_build/index?buildId=$Id" } -} \ No newline at end of file +} diff --git a/Source/Public/Show-VSTeamBuildDefinition.ps1 b/Source/Public/Show-VSTeamBuildDefinition.ps1 index a7ab4ea85..1041903c9 100644 --- a/Source/Public/Show-VSTeamBuildDefinition.ps1 +++ b/Source/Public/Show-VSTeamBuildDefinition.ps1 @@ -13,17 +13,14 @@ function Show-VSTeamBuildDefinition { [int[]] $Id, [Parameter(ParameterSetName = 'List')] - [string] $Path = '\' - ) - - DynamicParam { - _buildProjectNameDynamicParam - } + [string] $Path = '\', + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName + ) process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - # Build the url $url = "$(_getInstance)/$ProjectName/_build" @@ -51,7 +48,6 @@ function Show-VSTeamBuildDefinition { if ($Path[0] -ne '\') { $Path = '\' + $Path } - $url += [System.Web.HttpUtility]::UrlEncode($Path) } diff --git a/Source/Public/Show-VSTeamGitRepository.ps1 b/Source/Public/Show-VSTeamGitRepository.ps1 index f5c491a56..b8f4ed758 100644 --- a/Source/Public/Show-VSTeamGitRepository.ps1 +++ b/Source/Public/Show-VSTeamGitRepository.ps1 @@ -2,17 +2,15 @@ function Show-VSTeamGitRepository { [CmdletBinding()] param ( [Parameter(ValueFromPipelineByPropertyName = $true)] - [string] $RemoteUrl - ) - - DynamicParam { - _buildProjectNameDynamicParam -mandatory $false - } + [string] $RemoteUrl, + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName + ) + process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - if ($RemoteUrl) { Show-Browser $RemoteUrl } @@ -20,4 +18,4 @@ function Show-VSTeamGitRepository { Show-Browser "$(_getInstance)/_git/$ProjectName" } } -} \ No newline at end of file +} diff --git a/Source/Public/Show-VSTeamProject.ps1 b/Source/Public/Show-VSTeamProject.ps1 index c8ed8714a..049ffa2ea 100644 --- a/Source/Public/Show-VSTeamProject.ps1 +++ b/Source/Public/Show-VSTeamProject.ps1 @@ -3,13 +3,15 @@ function Show-VSTeamProject { param( [Parameter(ParameterSetName = 'ByID')] [Alias('ProjectID')] - [string] $Id + [string] $Id, + + [Parameter(ParameterSetName = 'ByName', Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter]) ] + [Alias('ProjectName')] + [string] $Name ) - - DynamicParam { - _buildProjectNameDynamicParam -ParameterSetName 'ByName' -ParameterName 'Name' -AliasName 'ProjectName' - } - + process { _hasAccount @@ -22,4 +24,4 @@ function Show-VSTeamProject { Show-Browser "$(_getInstance)/$ProjectName" } -} \ No newline at end of file +} diff --git a/Source/Public/Show-VSTeamRelease.ps1 b/Source/Public/Show-VSTeamRelease.ps1 index 187929c16..eab4edde4 100644 --- a/Source/Public/Show-VSTeamRelease.ps1 +++ b/Source/Public/Show-VSTeamRelease.ps1 @@ -3,24 +3,20 @@ function Show-VSTeamRelease { param( [Parameter(ParameterSetName = 'ByID', ValueFromPipelineByPropertyName = $true, Mandatory = $true, Position = 1)] [Alias('ReleaseID')] - [int] $id + [int] $id, + + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName ) - DynamicParam { - _buildProjectNameDynamicParam - } - process { - Write-Debug 'Show-VSTeamRelease Process' - if ($id -lt 1) { Throw "$id is not a valid id. Value must be greater than 0." } - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - # Build the url Show-Browser "$(_getInstance)/$ProjectName/_release?releaseId=$id" } -} \ No newline at end of file +} diff --git a/Source/Public/Show-VSTeamReleaseDefinition.ps1 b/Source/Public/Show-VSTeamReleaseDefinition.ps1 index aff4dde7e..2c0197af8 100644 --- a/Source/Public/Show-VSTeamReleaseDefinition.ps1 +++ b/Source/Public/Show-VSTeamReleaseDefinition.ps1 @@ -3,19 +3,15 @@ function Show-VSTeamReleaseDefinition { param( [Parameter(ParameterSetName = 'ByID', ValueFromPipelineByPropertyName = $true)] [Alias('ReleaseDefinitionID')] - [int] $Id + [int] $Id, + + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName ) - DynamicParam { - _buildProjectNameDynamicParam - } - process { - Write-Debug 'Show-VSTeamReleaseDefinition Process' - - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - # Build the url $url = "$(_getInstance)/$ProjectName/_release" @@ -25,4 +21,4 @@ function Show-VSTeamReleaseDefinition { Show-Browser $url } -} \ No newline at end of file +} diff --git a/Source/Public/Show-VSTeamWorkItem.ps1 b/Source/Public/Show-VSTeamWorkItem.ps1 index d1d07e413..ac8c07cf1 100644 --- a/Source/Public/Show-VSTeamWorkItem.ps1 +++ b/Source/Public/Show-VSTeamWorkItem.ps1 @@ -3,17 +3,15 @@ function Show-VSTeamWorkItem { param( [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Position = 0)] [Alias('WorkItemID')] - [int] $Id + [int] $Id, + + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName ) - - DynamicParam { - _buildProjectNameDynamicParam - } - + process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - Show-Browser "$(_getInstance)/$ProjectName/_workitems/edit/$Id" } -} \ No newline at end of file +} diff --git a/Source/Public/Test-VSTeamMembership.ps1 b/Source/Public/Test-VSTeamMembership.ps1 index 429bc0012..d674e293f 100644 --- a/Source/Public/Test-VSTeamMembership.ps1 +++ b/Source/Public/Test-VSTeamMembership.ps1 @@ -8,8 +8,6 @@ function Test-VSTeamMembership { ) process { - Set-StrictMode -Version Latest - $PrevWarningPreference = $WarningPreference try { $WarningPreference = "SilentlyContinue" # avoid 404 warning, since that indicates it doesn't exist diff --git a/Source/Public/Update-VSTeam.ps1 b/Source/Public/Update-VSTeam.ps1 index 338b81ecd..334ff4f74 100644 --- a/Source/Public/Update-VSTeam.ps1 +++ b/Source/Public/Update-VSTeam.ps1 @@ -1,46 +1,50 @@ -function Update-VSTeam { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium")] - param( - [Parameter(Mandatory = $True, ValueFromPipelineByPropertyName = $true)] - [Alias('TeamName', 'TeamId', 'TeamToUpdate', 'Id')] - [string]$Name, - [string]$NewTeamName, - [string]$Description, - [switch] $Force - ) - DynamicParam { - _buildProjectNameDynamicParam - } - - process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - - if (-not $NewTeamName -and -not $Description) { - throw 'You must provide a new team name or description, or both.' - } - - if ($Force -or $pscmdlet.ShouldProcess($Name, "Update-VSTeam")) { - if (-not $NewTeamName) { - $body = '{"description": "' + $Description + '" }' - } - if (-not $Description) { - $body = '{ "name": "' + $NewTeamName + '" }' - } - if ($NewTeamName -and $Description) { - $body = '{ "name": "' + $NewTeamName + '", "description": "' + $Description + '" }' - } - - # Call the REST API - $resp = _callAPI -Area 'projects' -Resource "$ProjectName/teams" -Id $Name ` - -Method Patch -ContentType 'application/json' -Body $body -Version $(_getApiVersion Core) - - # Storing the object before you return it cleaned up the pipeline. - # When I just write the object from the constructor each property - # seemed to be written - $team = [VSTeamTeam]::new($resp, $ProjectName) - - Write-Output $team - } - } -} \ No newline at end of file +function Update-VSTeam { + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium")] + param( + [Parameter(Mandatory = $True, ValueFromPipelineByPropertyName = $true)] + [Alias('TeamName', 'TeamId', 'TeamToUpdate', 'Id')] + [string]$Name, + + [string]$NewTeamName, + + [string]$Description, + + [switch] $Force, + + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName + ) + + process { + if (-not $NewTeamName -and -not $Description) { + throw 'You must provide a new team name or description, or both.' + } + + if ($Force -or $pscmdlet.ShouldProcess($Name, "Update-VSTeam")) { + if (-not $NewTeamName) { + $body = '{"description": "' + $Description + '" }' + } + + if (-not $Description) { + $body = '{ "name": "' + $NewTeamName + '" }' + } + + if ($NewTeamName -and $Description) { + $body = '{ "name": "' + $NewTeamName + '", "description": "' + $Description + '" }' + } + + # Call the REST API + $resp = _callAPI -Area 'projects' -Resource "$ProjectName/teams" -Id $Name ` + -Method Patch -ContentType 'application/json' -Body $body -Version $(_getApiVersion Core) + + # Storing the object before you return it cleaned up the pipeline. + # When I just write the object from the constructor each property + # seemed to be written + $team = [VSTeamTeam]::new($resp, $ProjectName) + + Write-Output $team + } + } +} diff --git a/Source/Public/Update-VSTeamAgent.ps1 b/Source/Public/Update-VSTeamAgent.ps1 index f6b6ecb58..bc5dae7fd 100644 --- a/Source/Public/Update-VSTeamAgent.ps1 +++ b/Source/Public/Update-VSTeamAgent.ps1 @@ -15,7 +15,7 @@ function Update-VSTeamAgent { foreach ($item in $Id) { try { if ($Force -or $pscmdlet.ShouldProcess($item, "Update-VSTeamAgent")) { - _callAPI -Method Post -Area "distributedtask/pools/$PoolId" -Resource messages -QueryString @{agentId = $item} -Version $([VSTeamVersions]::DistributedTask) -ContentType "application/json" | Out-Null + _callAPI -Method Post -Area "distributedtask/pools/$PoolId" -Resource messages -QueryString @{agentId = $item} -Version $(_getApiVersion DistributedTask) -ContentType "application/json" | Out-Null Write-Output "Update agent $item" } } diff --git a/Source/Public/Update-VSTeamBuild.ps1 b/Source/Public/Update-VSTeamBuild.ps1 index d96c62221..8c7a27857 100644 --- a/Source/Public/Update-VSTeamBuild.ps1 +++ b/Source/Public/Update-VSTeamBuild.ps1 @@ -1,49 +1,48 @@ -function Update-VSTeamBuild { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium")] - param( - [parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [Alias('BuildID')] - [Int] $Id, - - [parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [bool] $KeepForever, - - [parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [string] $BuildNumber, - - [switch] $Force - ) - - DynamicParam { - _buildProjectNameDynamicParam - } - - Process { - $ProjectName = $PSBoundParameters["ProjectName"] - - if ($Force -or $pscmdlet.ShouldProcess($Id, "Update-VSTeamBuild")) { - - $body = '{' - - $items = New-Object System.Collections.ArrayList - - if ($null -ne $KeepForever) { - $items.Add("`"keepForever`": $($KeepForever.ToString().ToLower())") > $null - } - - if ($null -ne $buildNumber -and $buildNumber.Length -gt 0) { - $items.Add("`"buildNumber`": `"$BuildNumber`"") > $null - } - - if ($null -ne $items -and $items.count -gt 0) { - $body += ($items -join ", ") - } - - $body += '}' - - # Call the REST API - _callAPI -ProjectName $ProjectName -Area 'build' -Resource 'builds' -Id $Id ` - -Method Patch -ContentType 'application/json' -body $body -Version $(_getApiVersion Build) | Out-Null - } - } -} \ No newline at end of file +function Update-VSTeamBuild { + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium")] + param( + [parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [Alias('BuildID')] + [Int] $Id, + + [parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [bool] $KeepForever, + + [parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [string] $BuildNumber, + + [switch] $Force, + + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName + ) + + process { + if ($Force -or $pscmdlet.ShouldProcess($Id, "Update-VSTeamBuild")) { + + $body = '{' + + $items = New-Object System.Collections.ArrayList + + if ($null -ne $KeepForever) { + $items.Add("`"keepForever`": $($KeepForever.ToString().ToLower())") > $null + } + + if ($null -ne $buildNumber -and $buildNumber.Length -gt 0) { + $items.Add("`"buildNumber`": `"$BuildNumber`"") > $null + } + + if ($null -ne $items -and $items.count -gt 0) { + $body += ($items -join ", ") + } + + $body += '}' + + # Call the REST API + _callAPI -ProjectName $ProjectName -Area 'build' -Resource 'builds' -Id $Id ` + -Method Patch -ContentType 'application/json' -body $body -Version $(_getApiVersion Build) | Out-Null + } + } +} diff --git a/Source/Public/Update-VSTeamBuildDefinition.ps1 b/Source/Public/Update-VSTeamBuildDefinition.ps1 index 3864f156d..69c3b5170 100644 --- a/Source/Public/Update-VSTeamBuildDefinition.ps1 +++ b/Source/Public/Update-VSTeamBuildDefinition.ps1 @@ -1,36 +1,33 @@ -function Update-VSTeamBuildDefinition { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium", DefaultParameterSetName = 'JSON')] - Param( - [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [int] $Id, - - [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, ParameterSetName = 'File')] - [string] $InFile, - - [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, ParameterSetName = 'JSON')] - [string] $BuildDefinition, - - # Forces the command without confirmation - [switch] $Force - ) - - DynamicParam { - _buildProjectNameDynamicParam - } - - Process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - - if ($Force -or $pscmdlet.ShouldProcess($Id, "Update Build Definition")) { - # Call the REST API - - if ($InFile) { - _callAPI -Method Put -ProjectName $ProjectName -Area build -Resource definitions -Id $Id -Version $(_getApiVersion Build) -InFile $InFile -ContentType 'application/json' | Out-Null - } - else { - _callAPI -Method Put -ProjectName $ProjectName -Area build -Resource definitions -Id $Id -Version $([VSTeamVersions]::Build) -Body $BuildDefinition -ContentType 'application/json' | Out-Null - } - } - } -} \ No newline at end of file +function Update-VSTeamBuildDefinition { + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium", DefaultParameterSetName = 'JSON')] + Param( + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [int] $Id, + + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, ParameterSetName = 'File')] + [string] $InFile, + + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, ParameterSetName = 'JSON')] + [string] $BuildDefinition, + + [switch] $Force, + + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName + ) + + process { + if ($Force -or $pscmdlet.ShouldProcess($Id, "Update Build Definition")) { + # Call the REST API + + if ($InFile) { + _callAPI -Method Put -ProjectName $ProjectName -Area build -Resource definitions -Id $Id -Version $(_getApiVersion Build) -InFile $InFile -ContentType 'application/json' | Out-Null + } + else { + _callAPI -Method Put -ProjectName $ProjectName -Area build -Resource definitions -Id $Id -Version $(_getApiVersion Build) -Body $BuildDefinition -ContentType 'application/json' | Out-Null + } + } + } +} diff --git a/Source/Public/Update-VSTeamExtension.ps1 b/Source/Public/Update-VSTeamExtension.ps1 index 8bbd89456..348859e33 100644 --- a/Source/Public/Update-VSTeamExtension.ps1 +++ b/Source/Public/Update-VSTeamExtension.ps1 @@ -25,7 +25,7 @@ function Update-VSTeamExtension { $body = $obj | ConvertTo-Json - $resp = _callAPI -Method Patch -body $body -SubDomain 'extmgmt' -Resource 'extensionmanagement/installedextensions' -Version $([VSTeamVersions]::ExtensionsManagement) -ContentType "application/json" + $resp = _callAPI -Method Patch -body $body -SubDomain 'extmgmt' -Resource 'extensionmanagement/installedextensions' -Version $(_getApiVersion ExtensionsManagement) -ContentType "application/json" $item = [VSTeamExtension]::new($resp) diff --git a/Source/Public/Update-VSTeamPolicy.ps1 b/Source/Public/Update-VSTeamPolicy.ps1 index e80ec37c0..4602c8e67 100644 --- a/Source/Public/Update-VSTeamPolicy.ps1 +++ b/Source/Public/Update-VSTeamPolicy.ps1 @@ -1,54 +1,53 @@ -function Update-VSTeamPolicy { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium")] - param( - [Parameter(Mandatory = $true)] - [int] $id, - - [Parameter(Mandatory = $false)] - [guid] $type, - - [switch] $enabled, - - [switch] $blocking, - - [Parameter(Mandatory = $true)] - [hashtable] $settings, - - [switch] $Force - ) - - DynamicParam { - _buildProjectNameDynamicParam -mandatory $true - } - - process { - $ProjectName = $PSBoundParameters["ProjectName"] - - if (-not $type) { - $policy = Get-VSTeamPolicy -ProjectName $ProjectName -Id $id | Select-Object -First 1 - $type = $policy.type.id - } - - $body = @{ - isEnabled = $enabled.IsPresent; - isBlocking = $blocking.IsPresent; - type = @{ - id = $type - } - settings = $settings - } | ConvertTo-Json -Depth 10 -Compress - - try { - if ($Force -or $pscmdlet.ShouldProcess($id, "Update Policy")) { - # Call the REST API - $resp = _callAPI -ProjectName $ProjectName -Area 'policy' -id $id -Resource 'configurations' ` - -Method Put -ContentType 'application/json' -Body $body -Version $(_getApiVersion Git) - - Write-Output $resp - } - } - catch { - _handleException $_ - } - } -} \ No newline at end of file +function Update-VSTeamPolicy { + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium")] + param( + [Parameter(Mandatory = $true)] + [int] $id, + + [Parameter(Mandatory = $false)] + [guid] $type, + + [switch] $enabled, + + [switch] $blocking, + + [Parameter(Mandatory = $true)] + [hashtable] $settings, + + [switch] $Force, + + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [string] $ProjectName + ) + + process { + if (-not $type) { + $policy = Get-VSTeamPolicy -ProjectName $ProjectName -Id $id | Select-Object -First 1 + $type = $policy.type.id + } + + $body = @{ + isEnabled = $enabled.IsPresent; + isBlocking = $blocking.IsPresent; + type = @{ + id = $type + } + settings = $settings + } | ConvertTo-Json -Depth 10 -Compress + + try { + if ($Force -or $pscmdlet.ShouldProcess($id, "Update Policy")) { + # Call the REST API + $resp = _callAPI -ProjectName $ProjectName -Area 'policy' -id $id -Resource 'configurations' ` + -Method Put -ContentType 'application/json' -Body $body -Version $(_getApiVersion Git) + + Write-Output $resp + } + } + catch { + _handleException $_ + } + } +} diff --git a/Source/Public/Update-VSTeamProject.ps1 b/Source/Public/Update-VSTeamProject.ps1 index d30fbf05e..6bf744174 100644 --- a/Source/Public/Update-VSTeamProject.ps1 +++ b/Source/Public/Update-VSTeamProject.ps1 @@ -1,66 +1,69 @@ -function Update-VSTeamProject { - [CmdletBinding(DefaultParameterSetName = 'ByName', SupportsShouldProcess = $true, ConfirmImpact = "High")] - param( - [string] $NewName = '', - [string] $NewDescription = '', - [switch] $Force, - [Parameter(ParameterSetName = 'ByID', ValueFromPipelineByPropertyName = $true)] - [string] $Id - ) - - DynamicParam { - _buildProjectNameDynamicParam -ParameterName 'Name' -AliasName 'ProjectName' -ParameterSetName 'ByName' -Mandatory $false - } - - process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["Name"] - - if ($id) { - $ProjectName = $id - } - else { - $id = (Get-VSTeamProject $ProjectName).id - } - - if ($newName -eq '' -and $newDescription -eq '') { - # There is nothing to do - Write-Verbose 'Nothing to update' - return - } - - if ($Force -or $pscmdlet.ShouldProcess($ProjectName, "Update Project")) { - - # At the end we return the project and need it's name - # this is used to track the final name. - $finalName = $ProjectName - - if ($newName -ne '' -and $newDescription -ne '') { - $finalName = $newName - $msg = "Changing name and description" - $body = '{"name": "' + $newName + '", "description": "' + $newDescription + '"}' - } - elseif ($newName -ne '') { - $finalName = $newName - $msg = "Changing name" - $body = '{"name": "' + $newName + '"}' - } - else { - $msg = "Changing description" - $body = '{"description": "' + $newDescription + '"}' - } - - # Call the REST API - $resp = _callAPI -Area 'projects' -id $id -NoProject ` - -Method Patch -ContentType 'application/json' -body $body -Version $(_getApiVersion Core) - - _trackProjectProgress -resp $resp -title 'Updating team project' -msg $msg - - # Invalidate any cache of projects. - [VSTeamProjectCache]::timestamp = -1 - - # Return the project now that it has been updated - return Get-VSTeamProject -Id $finalName - } - } -} \ No newline at end of file +function Update-VSTeamProject { + [CmdletBinding(DefaultParameterSetName = 'ByName', SupportsShouldProcess = $true, ConfirmImpact = "High")] + param( + [string] $NewName = '', + + [string] $NewDescription = '', + + [switch] $Force, + + [Parameter(ParameterSetName = 'ByID', ValueFromPipelineByPropertyName = $true)] + [string] $Id, + + [Alias('ProjectName')] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter]) ] + [Parameter(ParameterSetName = 'ByName', Position = 0, ValueFromPipelineByPropertyName = $true)] + [string] $Name + ) + process { + # Bind the parameter to a friendly variable + $ProjectName = $PSBoundParameters["Name"] + + if ($id) { + $ProjectName = $id + } + else { + $id = (Get-VSTeamProject $ProjectName).id + } + + if ($newName -eq '' -and $newDescription -eq '') { + # There is nothing to do + Write-Verbose 'Nothing to update' + return + } + + if ($Force -or $pscmdlet.ShouldProcess($ProjectName, "Update Project")) { + # At the end we return the project and need it's name + # this is used to track the final name. + $finalName = $ProjectName + + if ($newName -ne '' -and $newDescription -ne '') { + $finalName = $newName + $msg = "Changing name and description" + $body = '{"name": "' + $newName + '", "description": "' + $newDescription + '"}' + } + elseif ($newName -ne '') { + $finalName = $newName + $msg = "Changing name" + $body = '{"name": "' + $newName + '"}' + } + else { + $msg = "Changing description" + $body = '{"description": "' + $newDescription + '"}' + } + + # Call the REST API + $resp = _callAPI -Area 'projects' -id $id -NoProject ` + -Method Patch -ContentType 'application/json' -body $body -Version $(_getApiVersion Core) + + _trackProjectProgress -resp $resp -title 'Updating team project' -msg $msg + + # Invalidate any cache of projects. + [VSTeamProjectCache]::timestamp = -1 + + # Return the project now that it has been updated + return Get-VSTeamProject -Id $finalName + } + } +} diff --git a/Source/Public/Update-VSTeamRelease.ps1 b/Source/Public/Update-VSTeamRelease.ps1 index e26aba8d5..220e25a4b 100644 --- a/Source/Public/Update-VSTeamRelease.ps1 +++ b/Source/Public/Update-VSTeamRelease.ps1 @@ -1,31 +1,29 @@ -function Update-VSTeamRelease { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium")] - param( - [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [int] $Id, - - [Parameter(Mandatory = $true)] - [PSCustomObject] $Release, - - [switch] $Force - ) - - DynamicParam { - _buildProjectNameDynamicParam - } - - Process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - - $body = $Release | ConvertTo-Json -Depth 99 - - if ($Force -or $pscmdlet.ShouldProcess($Id, "Update Release")) { - # Call the REST API - $resp = _callAPI -ProjectName $projectName -SubDomain vsrm -Area release -Resource releases -Id $id ` - -Method Put -ContentType 'application/json' -body $body -Version $(_getApiVersion Release) - - Write-Output $resp - } - } -} \ No newline at end of file +function Update-VSTeamRelease { + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium")] + param( + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [int] $Id, + + [Parameter(Mandatory = $true)] + [PSCustomObject] $Release, + + [switch] $Force, + + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [string] $ProjectName + ) + + Process { + $body = $Release | ConvertTo-Json -Depth 99 + + if ($Force -or $pscmdlet.ShouldProcess($Id, "Update Release")) { + # Call the REST API + $resp = _callAPI -ProjectName $projectName -SubDomain vsrm -Area release -Resource releases -Id $id ` + -Method Put -ContentType 'application/json' -body $body -Version $(_getApiVersion Release) + + Write-Output $resp + } + } +} diff --git a/Source/Public/Update-VSTeamReleaseDefinition.ps1 b/Source/Public/Update-VSTeamReleaseDefinition.ps1 index 19ae7fc3a..badc10530 100644 --- a/Source/Public/Update-VSTeamReleaseDefinition.ps1 +++ b/Source/Public/Update-VSTeamReleaseDefinition.ps1 @@ -3,31 +3,27 @@ function Update-VSTeamReleaseDefinition { Param( [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, ParameterSetName = 'File')] [string] $InFile, - + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, ParameterSetName = 'JSON')] [string] $ReleaseDefinition, + + [switch] $Force, - # Forces the command without confirmation - [switch] $Force + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [string] $ProjectName ) - DynamicParam { - _buildProjectNameDynamicParam - } - Process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - if ($Force -or $pscmdlet.ShouldProcess('', "Update Release Definition")) { # Call the REST API - if ($InFile) { - _callAPI -Method Put -ProjectName $ProjectName -SubDomain vsrm -Area Release -Resource definitions -Version $([VSTeamVersions]::Release) -InFile $InFile -ContentType 'application/json' | Out-Null + _callAPI -Method Put -ProjectName $ProjectName -SubDomain vsrm -Area Release -Resource definitions -Version $(_getApiVersion Release) -InFile $InFile -ContentType 'application/json' | Out-Null } else { - _callAPI -Method Put -ProjectName $ProjectName -SubDomain vsrm -Area Release -Resource definitions -Version $([VSTeamVersions]::Release) -Body $ReleaseDefinition -ContentType 'application/json' | Out-Null + _callAPI -Method Put -ProjectName $ProjectName -SubDomain vsrm -Area Release -Resource definitions -Version $(_getApiVersion Release) -Body $ReleaseDefinition -ContentType 'application/json' | Out-Null } } } -} \ No newline at end of file +} diff --git a/Source/Public/Update-VSTeamServiceEndpoint.ps1 b/Source/Public/Update-VSTeamServiceEndpoint.ps1 index 1275cc5fa..3151f09a8 100644 --- a/Source/Public/Update-VSTeamServiceEndpoint.ps1 +++ b/Source/Public/Update-VSTeamServiceEndpoint.ps1 @@ -1,33 +1,31 @@ -function Update-VSTeamServiceEndpoint { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium")] - param( - [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [string] $id, - - [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [hashtable] $object, - - [switch] $Force - ) - - DynamicParam { - _buildProjectNameDynamicParam - } - - Process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - - $body = $object | ConvertTo-Json - - if ($Force -or $pscmdlet.ShouldProcess($id, "Update Service Endpoint")) { - # Call the REST API - $resp = _callAPI -ProjectName $projectName -Area 'distributedtask' -Resource 'serviceendpoints' -Id $id ` - -Method Put -ContentType 'application/json' -body $body -Version $(_getApiVersion DistributedTask) - - _trackServiceEndpointProgress -projectName $projectName -resp $resp -title 'Updating Service Endpoint' -msg "Updating $id" - - return Get-VSTeamServiceEndpoint -ProjectName $ProjectName -id $id - } - } -} \ No newline at end of file +function Update-VSTeamServiceEndpoint { + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium")] + param( + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [string] $id, + + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [hashtable] $object, + + [switch] $Force, + + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [string] $ProjectName + ) + + Process { + $body = $object | ConvertTo-Json + + if ($Force -or $pscmdlet.ShouldProcess($id, "Update Service Endpoint")) { + # Call the REST API + $resp = _callAPI -ProjectName $projectName -Area 'distributedtask' -Resource 'serviceendpoints' -Id $id ` + -Method Put -ContentType 'application/json' -body $body -Version $(_getApiVersion DistributedTask) + + _trackServiceEndpointProgress -projectName $projectName -resp $resp -title 'Updating Service Endpoint' -msg "Updating $id" + + return Get-VSTeamServiceEndpoint -ProjectName $ProjectName -id $id + } + } +} diff --git a/Source/Public/Update-VSTeamTaskGroup.ps1 b/Source/Public/Update-VSTeamTaskGroup.ps1 index f7dcf5b40..17d26dfb9 100644 --- a/Source/Public/Update-VSTeamTaskGroup.ps1 +++ b/Source/Public/Update-VSTeamTaskGroup.ps1 @@ -1,35 +1,33 @@ -function Update-VSTeamTaskGroup { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] - param( - [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [string] $Id, - - [Parameter(ParameterSetName = 'ByFile', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [string] $InFile, - - [Parameter(ParameterSetName = 'ByBody', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [string] $Body, - - [switch] $Force - ) - - DynamicParam { - _buildProjectNameDynamicParam - } - - process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - - if ($Force -or $pscmdlet.ShouldProcess("Update Task Group")) { - if ($InFile) { - $resp = _callAPI -Method Put -ProjectName $ProjectName -Area distributedtask -Resource taskgroups -Version $(_getApiVersion TaskGroups) -InFile $InFile -ContentType 'application/json' -Id $Id - } - else { - $resp = _callAPI -Method Put -ProjectName $ProjectName -Area distributedtask -Resource taskgroups -Version $(_getApiVersion TaskGroups) -Body $Body -ContentType 'application/json' -Id $Id - } - } - - return $resp - } -} +function Update-VSTeamTaskGroup { + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] + param( + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [string] $Id, + + [Parameter(ParameterSetName = 'ByFile', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [string] $InFile, + + [Parameter(ParameterSetName = 'ByBody', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [string] $Body, + + [switch] $Force, + + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [string] $ProjectName + ) + + Process { + if ($Force -or $pscmdlet.ShouldProcess("Update Task Group")) { + if ($InFile) { + $resp = _callAPI -Method Put -ProjectName $ProjectName -Area distributedtask -Resource taskgroups -Version $(_getApiVersion TaskGroups) -InFile $InFile -ContentType 'application/json' -Id $Id + } + else { + $resp = _callAPI -Method Put -ProjectName $ProjectName -Area distributedtask -Resource taskgroups -Version $(_getApiVersion TaskGroups) -Body $Body -ContentType 'application/json' -Id $Id + } + } + + return $resp + } +} diff --git a/Source/Public/Update-VSTeamUserEntitlement.ps1 b/Source/Public/Update-VSTeamUserEntitlement.ps1 index 579ed3d9e..8e3c9b5c1 100644 --- a/Source/Public/Update-VSTeamUserEntitlement.ps1 +++ b/Source/Public/Update-VSTeamUserEntitlement.ps1 @@ -32,7 +32,7 @@ function Update-VSTeamUserEntitlement [switch]$Force ) - process { + Process { # This will throw if this account does not support MemberEntitlementManagement _supportsMemberEntitlementManagement @@ -74,7 +74,9 @@ function Update-VSTeamUserEntitlement $body = ConvertTo-Json -InputObject @($obj) - if ($Force -or $PSCmdlet.ShouldProcess("$( $user.userName ) ($( $user.email ))", "Update user")) + $msg = "$( $user.userName ) ($( $user.email ))" + + if ($Force -or $PSCmdlet.ShouldProcess($msg, "Update user")) { # Call the REST API _callAPI -Method Patch -NoProject -Body $body -SubDomain 'vsaex' -Resource 'userentitlements' -Id $id -Version $(_getApiVersion MemberEntitlementManagement) -ContentType 'application/json-patch+json' | Out-Null diff --git a/Source/Public/Update-VSTeamVariableGroup.ps1 b/Source/Public/Update-VSTeamVariableGroup.ps1 index 8af2e2ffa..c0b1b6ade 100644 --- a/Source/Public/Update-VSTeamVariableGroup.ps1 +++ b/Source/Public/Update-VSTeamVariableGroup.ps1 @@ -1,73 +1,74 @@ -function Update-VSTeamVariableGroup { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium")] - param( - [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [string] $Id, - - [Parameter(ParameterSetName = 'ByHashtable', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [string] $Name, - - [Parameter(ParameterSetName = 'ByHashtable', Mandatory = $false, ValueFromPipelineByPropertyName = $true)] - [string] $Description, - - [Parameter(ParameterSetName = 'ByHashtable', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [hashtable] $Variables, - - [Parameter(ParameterSetName = 'ByBody', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [string] $Body, - - [switch] $Force - ) - - DynamicParam { - $dp = _buildProjectNameDynamicParam - - if ($(_getApiVersion -Target) -ne "TFS2017" -and $PSCmdlet.ParameterSetName -eq "ByHashtable") { - $ParameterName = 'Type' - $rp = _buildDynamicParam -ParameterName $ParameterName -arrSet ('Vsts', 'AzureKeyVault') -Mandatory $true - $dp.Add($ParameterName, $rp) - - $ParameterName = 'ProviderData' - $rp = _buildDynamicParam -ParameterName $ParameterName -Mandatory $false -ParameterType ([hashtable]) - $dp.Add($ParameterName, $rp) - } - - return $dp - } - - Process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - - - if ([string]::IsNullOrWhiteSpace($Body)) - { - $bodyAsHashtable = @{ - name = $Name - description = $Description - variables = $Variables - } - if ($(_getApiVersion -Target) -ne "TFS2017") { - $Type = $PSBoundParameters['Type'] - $bodyAsHashtable.Add("type", $Type) - - $ProviderData = $PSBoundParameters['ProviderData'] - if ($null -ne $ProviderData) { - $bodyAsHashtable.Add("providerData", $ProviderData) - } - } - - $body = $bodyAsHashtable | ConvertTo-Json - } - - if ($Force -or $pscmdlet.ShouldProcess($Id, "Update Variable Group")) { - # Call the REST API - $resp = _callAPI -ProjectName $projectName -Area 'distributedtask' -Resource 'variablegroups' -Id $Id ` - -Method Put -ContentType 'application/json' -body $body -Version $(_getApiVersion VariableGroups) - - Write-Verbose $resp - - return Get-VSTeamVariableGroup -ProjectName $ProjectName -Id $Id - } - } -} \ No newline at end of file +function Update-VSTeamVariableGroup { + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium")] + param( + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [string] $Id, + + [Parameter(ParameterSetName = 'ByHashtable', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [string] $Name, + + [Parameter(ParameterSetName = 'ByHashtable', Mandatory = $false, ValueFromPipelineByPropertyName = $true)] + [string] $Description, + + [Parameter(ParameterSetName = 'ByHashtable', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [hashtable] $Variables, + + [Parameter(ParameterSetName = 'ByBody', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [string] $Body, + + [switch] $Force, + + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [string] $ProjectName + ) + + DynamicParam { + $dp = New-Object System.Management.Automation.RuntimeDefinedParameterDictionary + + if ($(_getApiVersion -Target) -ne "TFS2017" -and $PSCmdlet.ParameterSetName -eq "ByHashtable") { + $ParameterName = 'Type' + $rp = _buildDynamicParam -ParameterName $ParameterName -arrSet ('Vsts', 'AzureKeyVault') -Mandatory $true + $dp.Add($ParameterName, $rp) + + $ParameterName = 'ProviderData' + $rp = _buildDynamicParam -ParameterName $ParameterName -Mandatory $false -ParameterType ([hashtable]) + $dp.Add($ParameterName, $rp) + } + + return $dp + } + + Process { + if ([string]::IsNullOrWhiteSpace($Body)) { + $bodyAsHashtable = @{ + name = $Name + description = $Description + variables = $Variables + } + + if ([VSTeamVersions]::Version -ne "TFS2017") { + $Type = $PSBoundParameters['Type'] + $bodyAsHashtable.Add("type", $Type) + + $ProviderData = $PSBoundParameters['ProviderData'] + if ($null -ne $ProviderData) { + $bodyAsHashtable.Add("providerData", $ProviderData) + } + } + + $body = $bodyAsHashtable | ConvertTo-Json + } + + if ($Force -or $pscmdlet.ShouldProcess($Id, "Update Variable Group")) { + # Call the REST API + $resp = _callAPI -ProjectName $projectName -Area 'distributedtask' -Resource 'variablegroups' -Id $Id ` + -Method Put -ContentType 'application/json' -body $body -Version $(_getApiVersion VariableGroups) + + Write-Verbose $resp + + return Get-VSTeamVariableGroup -ProjectName $ProjectName -Id $Id + } + } +} diff --git a/Source/VSTeam.psd1 b/Source/VSTeam.psd1 index 142fdc90e..ff0ca9db6 100644 --- a/Source/VSTeam.psd1 +++ b/Source/VSTeam.psd1 @@ -9,31 +9,31 @@ @{ # Script module or binary module file associated with this manifest. - RootModule = 'VSTeam.psm1' + RootModule = 'VSTeam.psm1' # Version number of this module. - ModuleVersion = '6.4.6' + ModuleVersion = '6.4.7' # Supported PSEditions - # CompatiblePSEditions = @() + CompatiblePSEditions = @('Core', 'Desktop') # ID used to uniquely identify this module - GUID = '210e95b1-50bb-44da-a993-f567f4574214' + GUID = '210e95b1-50bb-44da-a993-f567f4574214' # Author of this module - Author = '@DonovanBrown' + Author = '@DonovanBrown' # Company or vendor of this module - CompanyName = '' + CompanyName = '' # Copyright statement for this module - Copyright = '(c) 2020 Donovan Brown. All rights reserved.' + Copyright = '(c) 2020 Donovan Brown. All rights reserved.' # Description of the functionality provided by this module - Description = 'Adds functionality for working with Azure DevOps and Team Foundation Server.' + Description = 'Adds functionality for working with Azure DevOps and Team Foundation Server.' # Minimum version of the Windows PowerShell engine required by this module - # PowerShellVersion = '' + PowerShellVersion = '5.1' # Name of the Windows PowerShell host required by this module # PowerShellHostName = '' @@ -51,7 +51,7 @@ # ProcessorArchitecture = '' # Modules that must be imported into the global environment prior to importing this module - RequiredModules = @('SHiPS', 'Trackyon.Utils') + RequiredModules = @('SHiPS', 'Trackyon.Utils') # Assemblies that must be loaded prior to importing this module # RequiredAssemblies = @() @@ -60,17 +60,17 @@ # ScriptsToProcess = @() # Type files (.ps1xml) to be loaded when importing this module - TypesToProcess = @('.\vsteam.types.ps1xml') + TypesToProcess = @('.\vsteam.types.ps1xml') # Format files (.ps1xml) to be loaded when importing this module - FormatsToProcess = @('.\vsteam.format.ps1xml') + FormatsToProcess = @('.\vsteam.format.ps1xml') # Modules to import as nested modules of the module specified in RootModule/ModuleToProcess # NestedModules = @() # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. # This wildcard will be replaced during the build process in AzD - FunctionsToExport = @('*') + FunctionsToExport = @('*') # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. # CmdletsToExport = @() @@ -91,7 +91,7 @@ # FileList = @() # Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. - PrivateData = @{ + PrivateData = @{ PSData = @{ diff --git a/Source/en-US/VSTeam-Help.xml b/Source/en-US/VSTeam-Help.xml index 2d185e857..d5a6042d5 100644 --- a/Source/en-US/VSTeam-Help.xml +++ b/Source/en-US/VSTeam-Help.xml @@ -7673,9 +7673,8 @@ ID Title Status ProjectName - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + Returns the build with this build number. + You can also use * for a starts with search. For example: 2015* Will return all build numbers that start with 2015. String @@ -9993,7 +9992,7 @@ ID Title Status Int32 - None + False Skip @@ -10064,8 +10063,8 @@ ID Title Status None - - Ids + + Id If provided, specifies the exact commit ids of the commits to fetch. May not be combined with other parameters. @@ -10076,6 +10075,17 @@ ID Title Status None + + Raw + + Returns the raw response. This is required when you need to use the object to send back. Without this switch the object produced from the returned object will not match the expected shape of the JSON for sending back to server. + + + SwitchParameter + + + False + @@ -10470,9 +10480,35 @@ ID Title Status Specifies the ID of the repository. - Guid + String - Guid + String + + + None + + + Id + + Specifies one or more builds by ID. + To specify multiple IDs, use commas to separate the IDs. + To find the ID of a build, type Get-VSTeamBuild. + + Int32[] + + Int32[] + + + None + + + Index + + Each task stores its logs in an array. If you know the index of a specific task you can return just its logs. If you do not provide a value all the logs are displayed. + + Int32 + + Int32 None @@ -10527,7 +10563,16 @@ ID Title Status - + + + + System.Object + + + + + + @@ -10665,7 +10710,16 @@ ID Title Status - + + + + System.Object + + + + + + @@ -10742,9 +10796,9 @@ ID Title Status Name of the branch. - String + int32 - String + int32 None @@ -10876,12 +10930,67 @@ ID Title Status - + + + + System.Object + + + + + + + + + + + + Get-VSTeamCloudSubscription + Get + VSTeamCloudSubscription + + Gets the Azure subscriptions associated with the Team Services account. + + + + The Get-VSTeamCloudSubscription function gets the Azure subscriptions associated with the Team Services account. + + + + Get-VSTeamCloudSubscription + + + + + + + None + + + + + + + + + + Team.AzureSubscription + + + + + + + + + This function currently is not supported in TFS. + + -------------------------- EXAMPLE 1 -------------------------- @@ -10905,29 +11014,32 @@ ID Title Status - + + + Set-VSTeamAccount + + + - Get-VSTeamGroup + Get-VSTeamDescriptor Get - VSTeamGroup + VSTeamDescriptor - Returns a Group or List of Groups. + Resolve a storage key to a descriptor. - Returns a Group or List of Groups. + Resolve a storage key to a descriptor. - Get-VSTeamGroup - - ProjectName + Get-VSTeamDescriptor + + StorageKey - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + Storage key of the subject (user, group, scope, etc.) to resolve String @@ -10936,24 +11048,63 @@ ID Title Status None - - SubjectTypes + + + + + StorageKey + + Storage key of the subject (user, group, scope, etc.) to resolve + + String + + String + + + None + + + + + + + + + + + + + + + Get-VSTeamExtension + Get + VSTeamExtension + + Get the installed extensions in the specified Azure DevOps or Team Foundation Server project. + + + + Get the installed extensions in the specified Azure DevOps or Team Foundation Server project. + + + + Get-VSTeamExtension + + PublisherId - A comma separated list of user subject subtypes to reduce the retrieved results. Valid subject types: - - vssgp (Azure DevOps Group) - - aadgp (Azure Active Directory Group) + The id of the publisher. - String[] + String - String[] + String None - - ScopeDescriptor + + ExtensionId - Specify a non-default scope (collection, project) to search for groups. + The id of the extension. String @@ -10964,73 +11115,47 @@ ID Title Status - Get-VSTeamGroup - - ProjectName + Get-VSTeamExtension + + IncludeInstallationIssues - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + If true (the default), include installed extensions with issues. - String - String + SwitchParameter - None + False - SubjectTypes + IncludeDisabledExtensions - A comma separated list of user subject subtypes to reduce the retrieved results. Valid subject types: - - vssgp (Azure DevOps Group) - - aadgp (Azure Active Directory Group) + If true (the default), include disabled extensions in the results. - String[] - String[] + SwitchParameter - None + False - - - Get-VSTeamGroup - - ProjectName + + IncludeErrors - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + If true, include installed extensions with errors. - String - - String - - - None - - - Descriptor - - The descriptor of the desired graph group. - - String - String + SwitchParameter - None + False - - ProjectName + + PublisherId - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + The id of the publisher. String @@ -11039,43 +11164,53 @@ ID Title Status None - - SubjectTypes + + ExtensionId - A comma separated list of user subject subtypes to reduce the retrieved results. Valid subject types: - - vssgp (Azure DevOps Group) - - aadgp (Azure Active Directory Group) + The id of the extension. - String[] + String - String[] + String None - ScopeDescriptor + IncludeInstallationIssues - Specify a non-default scope (collection, project) to search for groups. + If true (the default), include installed extensions with issues. - String + SwitchParameter - String + SwitchParameter - None + False - Descriptor + IncludeDisabledExtensions - The descriptor of the desired graph group. + If true (the default), include disabled extensions in the results. - String + SwitchParameter - String + SwitchParameter - None + False + + + IncludeErrors + + If true, include installed extensions with errors. + + SwitchParameter + + SwitchParameter + + + False @@ -11085,105 +11220,49 @@ ID Title Status - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> $group = Get-VSTeamGroup | ? DisplayName -eq 'Endpoint Administrators' - - Assigns Endpoint Administrators group to $group variable. - - - - - - - - Get-VSTeamInfo - Get - VSTeamInfo - - Displays your current account and default project. - - - - Displays your current account and default project. - - - - Get-VSTeamInfo - - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamInfo - - This will display your current account and default project - - - + - Set-VSTeamAccount + Add-VSTeamExtension + + + + Get-VSTeamExtension + + + + Remove-VSTeamExtension + + + + Update-VSTeamExtension - Get-VSTeamJobRequest + Get-VSTeamFeed Get - VSTeamJobRequest + VSTeamFeed - Returns all the job requests of an agent. + Returns a list of package feeds for the account. - Returns all the job requests of an agent. + Get-VSTeamFeed gets all the feeds for the account - Get-VSTeamJobRequest - - PoolId - - Id of the pool. - - String - - String - - - None - - - AgentId - - Id of the agent to return. - - String - - String - - - None - - - CompletedRequestCount + Get-VSTeamFeed + + FeedId - The number of requests to return. + Specifies the ID of the feed. - Int32 + Guid - Int32 + Guid None @@ -11191,63 +11270,21 @@ ID Title Status - - PoolId - - Id of the pool. - - String - - String - - - None - - - AgentId - - Id of the agent to return. - - String - - String - - - None - - - CompletedRequestCount + + FeedId - The number of requests to return. + Specifies the ID of the feed. - Int32 + Guid - Int32 + Guid None - - - - System.String - - - - - - - - - - System.Object - - - - - - + + @@ -11256,9 +11293,9 @@ ID Title Status -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamJobRequest 1 111 + PS C:\> Get-VSTeamFeed - This will display all the job request of agent with id 111 under the pool with id 1. + This command returns all the package feeds for the account. @@ -11266,19 +11303,19 @@ ID Title Status - Get-VSTeamMember + Get-VSTeamGitCommit Get - VSTeamMember + VSTeamGitCommit - Returns a team member. + Retrieve git commits for a project - Returns a team member. + The Get-VSTeamGitCommit function gets the commits for a git repository. - Get-VSTeamMember + Get-VSTeamGitCommit ProjectName @@ -11293,134 +11330,49 @@ ID Title Status None - - TeamId + + RepositoryId - The id of the team to search. + The id or friendly name of the repository. To use the friendly name, projectId must also be specified. - String + Guid - String + Guid None - Skip + FromDate - The number of items to skip. + If provided, only include history entries created after this date (string) - Int32 + DateTime - Int32 + DateTime None - Top + ToDate - Specifies the maximum number to return. + If provided, only include history entries created before this date (string) - Int32 + DateTime - Int32 + DateTime None - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - Skip - - The number of items to skip. - - Int32 - - Int32 - - - None - - - TeamId - - The id of the team to search. - - String - - String - - - None - - - Top - - Specifies the maximum number to return. - - Int32 - - Int32 - - - None - - - - - - - Team.Team - - - - - - - - - - - - - - - - - Get-VSTeamMembership - Get - VSTeamMembership - - Gets a memberships for a container or member. - - - - Gets a memberships for a container or member. - - - - Get-VSTeamMembership - - ContainerDescriptor + + ItemVersionVersionType - A container descriptor retrieved by Get-VsTeamGroup + Version type (branch, tag, or commit). Determines how Id is interpreted. The acceptable values for this parameter are: + - branch + - commit + - tag String @@ -11429,13 +11381,10 @@ ID Title Status None - - - Get-VSTeamMembership - - MemberDescriptor + + ItemVersionVersion - A member descriptor retrieved by Get-VsTeamUser + Version string identifier (name of tag/branch, SHA1 of commit) String @@ -11444,107 +11393,13 @@ ID Title Status None - - - - - ContainerDescriptor - - A container descriptor retrieved by Get-VsTeamGroup - - String - - String - - - None - - - MemberDescriptor - - A member descriptor retrieved by Get-VsTeamUser - - String - - String - - - None - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - (Get-VSTeamMembership -MemberDescriptor $user.ID).value | % { Get-VSTeamGroup -Descriptor $_.containerDescriptor } - - Get all the groups for a user - - - - -------------------------- EXAMPLE 2 -------------------------- - (Get-VSTeamMembership -ContainerDescriptor $group.id).value | % {Get-VSTeamUser -Descriptor $_.memberDescriptor } - - Get all the members for a group - - - - - - Get-VsTeamUser - - - - Get-VsTeamGroup - - - - Add-VsTeamMembership - - - - Remove-VsTeamMembership - - - - Test-VsTeamMembership - - - - - - - Get-VSTeamOption - Get - VSTeamOption - - Returns all the versions of supported APIs of your TFS or AzD. - - - - Returns all the versions of supported APIs of your TFS or AzD. - There are two table formats defined for the Team.Option type, Default and Versions. - Default view contains Name, Area, Max Version and URI Template. - Version view contains Name, Area, Min Version, Max Version, Released Version and Resource Version. - - - - Get-VSTeamOption - SubDomain + ItemVersionVersionOptions - Returns options for that sub domain APIs. Some examples include: - - vsaex = Member Entitlement Management - - feeds = Artifacts - - vsrm = Release Management - - vssps = Graph - - extmgmt = Extensions + Version options - Specify additional modifiers to version (e.g Previous). The acceptable values for this parameter are: + - firstParent + - none + - previousChange String @@ -11553,85 +11408,13 @@ ID Title Status None - - - - - SubDomain - - Returns options for that sub domain APIs. Some examples include: - - vsaex = Member Entitlement Management - - feeds = Artifacts - - vsrm = Release Management - - vssps = Graph - - extmgmt = Extensions - - String - - String - - - None - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamOption - - This will display all the versions of supported APIs for your account using the 'Default' table format. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Get-VSTeamOption | Format-Table -View Versions - - This will display all the versions of supported APIs for your account using the 'Versions' custom table format. - - - - -------------------------- EXAMPLE 3 -------------------------- - PS C:\> Get-VSTeamOption -SubDomain vsrm - - This will display all the versions of supported APIs for the release management service. - - - - - - Set-VSTeamAccount - - - - - - - Get-VSTeamPermissionInheritance - Get - VSTeamPermissionInheritance - - Returns true or false. - - - - Returns true or false. - - - - Get-VSTeamPermissionInheritance - - ProjectName + + CompareVersionVersionType - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + Version type (branch, tag, or commit). Determines how Id is interpreted. The acceptable values for this parameter are: + - branch + - commit + - tag String @@ -11640,10 +11423,13 @@ ID Title Status None - - Name + + CompareVersionVersion - Specifies the name of the resource. + Version string identifier (name of tag/branch, SHA1 of commit). The acceptable values for this parameter are: + - firstParent + - none + - previousChange String @@ -11652,13 +11438,10 @@ ID Title Status None - - ResourceType + + CompareVersionVersionOptions - Specifies the type of resource. The acceptable values for this parameter are: - - Repository - - BuildDefinition - - ReleaseDefinition + Version options - Specify additional modifiers to version (e.g Previous) String @@ -11667,110 +11450,10 @@ ID Title Status None - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - Name - - Specifies the name of the resource. - - String - - String - - - None - - - ResourceType - - Specifies the type of resource. The acceptable values for this parameter are: - - Repository - - BuildDefinition - - ReleaseDefinition - - String - - String - - - None - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamPermissionInheritance -ProjectName Demo -Name Demo-CI -ResourceType BuildDefinition - - This command returns true or false. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Get-VSTeamBuildDefinition | Get-VSTeamPermissionInheritance -ResourceType BuildDefinition - - This command returns true or false for every build definition returned from Get-VSTeamBuildDefinition. - - - - - - Add-VSTeamPolicy - - - - Remove-VSTeamPolicy - - - - Get-VSTeamPermissionInheritanceType - - - - - - - Get-VSTeamPolicy - Get - VSTeamPolicy - - Get the code policies in the specified Azure DevOps or Team Foundation Server project. - - - - Get the code policies in the specified Azure DevOps or Team Foundation Server project. - - - - Get-VSTeamPolicy - - ProjectName + + FromCommitId - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + If provided, a lower bound for filtering commits alphabetically String @@ -11779,109 +11462,22 @@ ID Title Status None - - Id + + ToCommitId - Specifies one code policy by id. - The id is an integer. Unique within each project. + If provided, an upper bound for filtering commits alphabetically - Int + String - Int + String None - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - Id - - Specifies one code policy by id. - The id is an integer. Unique within each project. - - Int - - Int - - - None - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamPolicy -ProjectName Demo - - This command returns all the policies for the Demo project in your TFS or Team Services account. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Get-VSTeamPolicy -ProjectName Demo -Id 1 - - This command gets the policy with an id of 1 within the Demo project. - - - - - - Add-VSTeamPolicy - - - - Remove-VSTeamPolicy - - - - Get-VSTeamPolicyType - - - - - - - Get-VSTeamPolicyType - Get - VSTeamPolicyType - - Get the policy types in the specified Azure DevOps or Team Foundation Server project. - - - - Get the policy types in the specified Azure DevOps or Team Foundation Server project. - - - - Get-VSTeamPolicyType - - ProjectName + + Author - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + Alias or display name of the author String @@ -11891,218 +11487,73 @@ ID Title Status None - Id + ItemPath - Specifies one policy type by id. + Path of item to search under - Guid[] + String - Guid[] + String None - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - Id - - Specifies one policy type by id. - - Guid[] - - Guid[] - - - None - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamPolicyType -ProjectName Demo - - This command returns all the policy types for the Demo project. - - - - -------------------------- EXAMPLE 3 -------------------------- - PS C:\> Get-VSTeamPolicyType -ProjectName Demo -Id 73da726a-8ff9-44d7-8caa-cbb581eac991 - - This command gets the policy type by the specified id within the Demo project. - - - - - - Add-VSTeamPolicy - - - - Remove-VSTeamPolicy - - - - Get-VSTeamPolicy - - - - - - - Get-VSTeamPool - Get - VSTeamPool - - Returns the agent pools. - - - - Returns the agent pools. - - - - Get-VSTeamPool - - Id + + ExcludeDeletes - Id of the pool to return. + Only applies when an itemPath is specified. This determines whether to exclude delete entries of the specified path. - int - int + SwitchParameter - None + False - - - - - Id - - Id of the pool to return. - - int - - int - - - None - - - - - - System.String - - - - - - - - - - System.Object - - - - - - - - - - - - - - - - - Get-VSTeamProcess - Get - VSTeamProcess - - Returns a list of process templates in the Team Services or Team Foundation Server account. - - - - The list of Process Templates returned can be controlled by using the top and skip parameters. - You can also get a single Process Template by name or id. - You must call Set-VSTeamAccount before calling this function. - - - - Get-VSTeamProcess - - Name + + Top - Specifies the process template name for which this function operates. - You can tab complete from a list of available process templates. + Maximum number of entries to retrieve - String + Int32 - String + Int32 None - Top + Skip - Specifies the maximum number to return. + Number of entries to skip Int32 Int32 - 100 + None - Skip + User - Defines the number of Process Templates to skip. The default value is 0 + Alias or display name of the committer - Int32 + String - Int32 + String - 0 + None - Get-VSTeamProcess + Get-VSTeamGitCommit - Name + ProjectName - Specifies the process template name for which this function operates. - You can tab complete from a list of available process templates. + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. String @@ -12111,124 +11562,49 @@ ID Title Status None - - Id + + RepositoryId - The id of the Process Template to return. + The id or friendly name of the repository. To use the friendly name, projectId must also be specified. - String + Guid - String + Guid None - - - - - Name - - Specifies the process template name for which this function operates. - You can tab complete from a list of available process templates. - - String - - String - - - None - - - Top - - Specifies the maximum number to return. - - Int32 - - Int32 - - - 100 - - - Skip - - Defines the number of Process Templates to skip. The default value is 0 - - Int32 - - Int32 - - - 0 - - - Id - - The id of the Process Template to return. - - String - - String - - - None - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamProcess - - This will return all the Process Templates - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Get-VSTeamProcess -top 5 | Format-Wide - - This will return the top five Process Templates only showing their name - - - - - - Set-VSTeamAccount - - - - Add-VSTeamProject - - - - - - - Get-VSTeamProfile - Get - VSTeamProfile - - Returns the saved profiles. - - - - Returns the saved profiles. - - - - Get-VSTeamProfile - - Name + + FromDate - Optional name for the profile. + If provided, only include history entries created after this date (string) + + DateTime + + DateTime + + + None + + + ToDate + + If provided, only include history entries created before this date (string) + + DateTime + + DateTime + + + None + + + ItemVersionVersionType + + Version type (branch, tag, or commit). Determines how Id is interpreted. The acceptable values for this parameter are: + - branch + - commit + - tag String @@ -12237,79 +11613,10 @@ ID Title Status None - - - - - Name - - Optional name for the profile. - - String - - String - - - None - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamProfile - - Return the list of saved profiles - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Get-VSTeamProfile -Name mydemos - - Will return details of the profile provided - - - - - - Set-VSTeamAccount - - - - Add-VSTeamProfile - - - - - - - Get-VSTeamProject - Get - VSTeamProject - - Returns a list of projects in the Team Services or Team Foundation Server account. - - - - The list of projects returned can be controlled by using the stateFilter, top and skip parameters. - You can also get a single project by name or id. - You must call Set-VSTeamAccount before calling this function. - - - - Get-VSTeamProject - - ProjectName + + ItemVersionVersion - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + Version string identifier (name of tag/branch, SHA1 of commit) String @@ -12319,55 +11626,54 @@ ID Title Status None - StateFilter + ItemVersionVersionOptions - Returns team projects in a specific team project state. The acceptable values for this parameter are: - - WellFormed - - CreatePending - - Deleting - - New - - All + Version options - Specify additional modifiers to version (e.g Previous). The acceptable values for this parameter are: + - firstParent + - none + - previousChange String String - WellFormed + None - Top + CompareVersionVersionType - Specifies the maximum number to return. + Version type (branch, tag, or commit). Determines how Id is interpreted. The acceptable values for this parameter are: + - branch + - commit + - tag - Int32 + String - Int32 + String - 100 + None - Skip + CompareVersionVersion - Defines the number of team projects to skip. The default value is 0 + Version string identifier (name of tag/branch, SHA1 of commit). The acceptable values for this parameter are: + - firstParent + - none + - previousChange - Int32 + String - Int32 + String - 0 + None - - - Get-VSTeamProject - - ProjectName + + CompareVersionVersionOptions - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + Version options - Specify additional modifiers to version (e.g Previous) String @@ -12376,10 +11682,10 @@ ID Title Status None - - Id + + FromCommitId - The id of the project to return. + If provided, a lower bound for filtering commits alphabetically String @@ -12389,158 +11695,21 @@ ID Title Status None - IncludeCapabilities + ToCommitId - Will return additional information about the project. + If provided, an upper bound for filtering commits alphabetically + String - SwitchParameter + String - False + None - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - StateFilter - - Returns team projects in a specific team project state. The acceptable values for this parameter are: - - WellFormed - - CreatePending - - Deleting - - New - - All - - String - - String - - - WellFormed - - - Top - - Specifies the maximum number to return. - - Int32 - - Int32 - - - 100 - - - Skip - - Defines the number of team projects to skip. The default value is 0 - - Int32 - - Int32 - - - 0 - - - Id - - The id of the project to return. - - String - - String - - - None - - - IncludeCapabilities - - Will return additional information about the project. - - SwitchParameter - - SwitchParameter - - - False - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamProject - - This will return all the WellFormed team projects. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Get-VSTeamProject -top 5 | Format-Wide - - This will return the top five WellFormed team projects only showing their name - - - - - - Set-VSTeamAccount - - - - Add-VSTeamProject - - - - Remove-VSTeamProject - - - - - - - Get-VSTeamPullRequest - Get - VSTeamPullRequest - - Returns one or more open pull requests from your team, project, or Id. - - - - Returns one or more open pull requests from your team, project, or Id. - - - - Get-VSTeamPullRequest - - ProjectName + + Author - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + Alias or display name of the author String @@ -12549,10 +11718,34 @@ ID Title Status None - - Id + + Top - Specifies the pull request by ID. + Maximum number of entries to retrieve + + Int32 + + Int32 + + + None + + + Skip + + Number of entries to skip + + Int32 + + Int32 + + + None + + + User + + Alias or display name of the committer String @@ -12563,8 +11756,8 @@ ID Title Status - Get-VSTeamPullRequest - + Get-VSTeamGitCommit + ProjectName Specifies the team project for which this function operates. @@ -12578,10 +11771,10 @@ ID Title Status None - + RepositoryId - The repository ID of the pull request's target branch. + The id or friendly name of the repository. To use the friendly name, projectId must also be specified. Guid @@ -12591,33 +11784,36 @@ ID Title Status None - SourceRepositoryId + FromDate - If set, search for pull requests whose source branch is in this repository. + If provided, only include history entries created after this date (string) - Guid + DateTime - Guid + DateTime None - SourceBranchRef + ToDate - If set, search for pull requests from this branch. + If provided, only include history entries created before this date (string) - String + DateTime - String + DateTime None - TargetBranchRef + ItemVersionVersionType - If set, search for pull requests into this branch. + Version type (branch, tag, or commit). Determines how Id is interpreted. The acceptable values for this parameter are: + - branch + - commit + - tag String @@ -12627,14 +11823,9 @@ ID Title Status None - Status + ItemVersionVersion - If set, search for pull requests that are in this state. Defaults to Active if unset. Valid values for this parameter are: - - abandoned - - active - - all - - completed - - notSet + Version string identifier (name of tag/branch, SHA1 of commit) String @@ -12644,38 +11835,42 @@ ID Title Status None - Top + ItemVersionVersionOptions - The number of pull requests to retrieve. + Version options - Specify additional modifiers to version (e.g Previous). The acceptable values for this parameter are: + - firstParent + - none + - previousChange - Int32 + String - Int32 + String None - Skip + CompareVersionVersionType - The number of pull requests to ignore. For example, to retrieve results 101-150, set top to 50 and skip to 100. + Version type (branch, tag, or commit). Determines how Id is interpreted. The acceptable values for this parameter are: + - branch + - commit + - tag - Int32 + String - Int32 + String None - - - Get-VSTeamPullRequest - - ProjectName + + CompareVersionVersion - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + Version string identifier (name of tag/branch, SHA1 of commit). The acceptable values for this parameter are: + - firstParent + - none + - previousChange String @@ -12685,33 +11880,33 @@ ID Title Status None - RepositoryId + CompareVersionVersionOptions - The repository ID of the pull request's target branch. + Version options - Specify additional modifiers to version (e.g Previous) - Guid + String - Guid + String None - SourceRepositoryId + FromCommitId - If set, search for pull requests whose source branch is in this repository. + If provided, a lower bound for filtering commits alphabetically - Guid + String - Guid + String None - SourceBranchRef + ToCommitId - If set, search for pull requests from this branch. + If provided, an upper bound for filtering commits alphabetically String @@ -12721,9 +11916,9 @@ ID Title Status None - TargetBranchRef + Author - If set, search for pull requests into this branch. + Alias or display name of the author String @@ -12733,20 +11928,21 @@ ID Title Status None - All + Top - + Maximum number of entries to retrieve + Int32 - SwitchParameter + Int32 - False + None - Top + Skip - The number of pull requests to retrieve. + Number of entries to skip Int32 @@ -12756,222 +11952,20 @@ ID Title Status None - Skip + User - The number of pull requests to ignore. For example, to retrieve results 101-150, set top to 50 and skip to 100. + Alias or display name of the committer - Int32 + String - Int32 + String None - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - Id - - Specifies the pull request by ID. - - String - - String - - - None - - - RepositoryId - - The repository ID of the pull request's target branch. - - Guid - - Guid - - - None - - - SourceRepositoryId - - If set, search for pull requests whose source branch is in this repository. - - Guid - - Guid - - - None - - - SourceBranchRef - - If set, search for pull requests from this branch. - - String - - String - - - None - - - TargetBranchRef - - If set, search for pull requests into this branch. - - String - - String - - - None - - - Status - - If set, search for pull requests that are in this state. Defaults to Active if unset. Valid values for this parameter are: - - abandoned - - active - - all - - completed - - notSet - - String - - String - - - None - - - All - - - - SwitchParameter - - SwitchParameter - - - False - - - Top - - The number of pull requests to retrieve. - - Int32 - - Int32 - - - None - - - Skip - - The number of pull requests to ignore. For example, to retrieve results 101-150, set top to 50 and skip to 100. - - Int32 - - Int32 - - - None - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamPullRequest - - This command returns all the open pull requests for your TFS or Team Services account. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Get-VSTeamPullRequest -ProjectName Demo - - This command returns all the open pull requests for the Demo team project. - - - - -------------------------- EXAMPLE 3 -------------------------- - PS C:\> Get-VSTeamPullRequest -ProjectName Demo -All - - This command returns all pull requests for the Demo team project. - - - - -------------------------- EXAMPLE 4 -------------------------- - PS C:\> Get-VSTeamPullRequest -ProjectName Demo -TargetBranchRef "refs/heads/mybranch" - - This command returns all open pull requests for a specific branch - - - - -------------------------- EXAMPLE 5 -------------------------- - PS C:\> Get-VSTeamPullRequest -Id 123 - - This command gets the pull request with an Id of 123. - - - - - - Show-VSTeamPullRequest - - - - Add-VSTeamPullRequest - - - - Update-VSTeamPullRequest - - - - - - - Get-VSTeamQueue - Get - VSTeamQueue - - Gets a agent queue. - - - - Gets a agent queue. - - - Get-VSTeamQueue + Get-VSTeamGitCommit ProjectName @@ -12986,51 +11980,49 @@ ID Title Status None - - QueueName + + RepositoryId - Name of the queue to return. + The id or friendly name of the repository. To use the friendly name, projectId must also be specified. - String + Guid - String + Guid None - ActionFilter + FromDate - None, Manage or Use. + If provided, only include history entries created after this date (string) - String + DateTime - String + DateTime None - - - Get-VSTeamQueue - - ProjectName + + ToDate - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + If provided, only include history entries created before this date (string) - String + DateTime - String + DateTime None - - Id + + ItemVersionVersionType - Id of the queue to return. + Version type (branch, tag, or commit). Determines how Id is interpreted. The acceptable values for this parameter are: + - branch + - commit + - tag String @@ -13039,103 +12031,10 @@ ID Title Status None - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - QueueName - - Name of the queue to return. - - String - - String - - - None - - - ActionFilter - - None, Manage or Use. - - String - - String - - - None - - - Id - - Id of the queue to return. - - String - - String - - - None - - - - - - - Team.Queue - - - - - - - - - - - - - - - - - Get-VSTeamRelease - Get - VSTeamRelease - - Gets the releases for a team project. - - - - The Get-VSTeamRelease function gets the releases for a team project. - The project name is a Dynamic Parameter which may not be displayed in the syntax above but is mandatory. - With just a project name, this function gets all of the releases for that team project. - You can also specify a particular release definition by ID. - - - - Get-VSTeamRelease - - ProjectName + + ItemVersionVersion - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + Version string identifier (name of tag/branch, SHA1 of commit) String @@ -13145,9 +12044,12 @@ ID Title Status None - Expand + ItemVersionVersionOptions - Specifies which property should be expanded in the list of Release (environments, artifacts, none). + Version options - Specify additional modifiers to version (e.g Previous). The acceptable values for this parameter are: + - firstParent + - none + - previousChange String @@ -13157,9 +12059,12 @@ ID Title Status None - StatusFilter + CompareVersionVersionType - Draft, Active or Abandoned. + Version type (branch, tag, or commit). Determines how Id is interpreted. The acceptable values for this parameter are: + - branch + - commit + - tag String @@ -13169,33 +12074,36 @@ ID Title Status None - DefinitionId + CompareVersionVersion - Id of the release definition + Version string identifier (name of tag/branch, SHA1 of commit). The acceptable values for this parameter are: + - firstParent + - none + - previousChange - Int32 + String - Int32 + String - 0 + None - Top + CompareVersionVersionOptions - Specifies the maximum number to return. + Version options - Specify additional modifiers to version (e.g Previous) - Int32 + String - Int32 + String - 0 + None - CreatedBy + FromCommitId - + If provided, a lower bound for filtering commits alphabetically String @@ -13205,33 +12113,33 @@ ID Title Status None - MinCreatedTime + ToCommitId - + If provided, an upper bound for filtering commits alphabetically - DateTime + String - DateTime + String None - MaxCreatedTime + Author - + Alias or display name of the author - DateTime + String - DateTime + String None - QueryOrder + ItemPath - + Path of item to search under String @@ -13241,26 +12149,48 @@ ID Title Status None - ContinuationToken + ExcludeDeletes - + Only applies when an itemPath is specified. This determines whether to exclude delete entries of the specified path. - String - String + SwitchParameter + + + False + + + Top + + Maximum number of entries to retrieve + + Int32 + + Int32 None - - - Get-VSTeamRelease - - ProjectName + + Skip - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + Number of entries to skip + + Int32 + + Int32 + + + None + + + HistoryMode + + What Git history mode should be used. This only applies to the search criteria when Ids = null and an itemPath is specified. The acceptable values for this parameter are: + - firstParent + - fullHistory + - fullHistorySimplifyMerges + - simplifiedHistory String @@ -13269,23 +12199,21 @@ ID Title Status None - - Id + + User - Specifies one or more releases by ID. - To specify multiple IDs, use commas to separate the IDs. - To find the ID of a release definition, type Get-VSTeamRelease. + Alias or display name of the committer - Int32[] + String - Int32[] + String None - Get-VSTeamRelease + Get-VSTeamGitCommit ProjectName @@ -13300,40 +12228,22 @@ ID Title Status None - - Id + + RepositoryId - Specifies one or more releases by ID. - To specify multiple IDs, use commas to separate the IDs. - To find the ID of a release definition, type Get-VSTeamRelease. + The id or friendly name of the repository. To use the friendly name, projectId must also be specified. - Int32[] + Guid - Int32[] + Guid None - - JSON - - Converts the raw response into JSON and displays in the console. This is required when you need to use the object to send back. Without this switch the JSON produced from the returned object will not match the expected shape of the JSON for sending back to server. - - - SwitchParameter - - - False - - - - Get-VSTeamRelease - - ProjectName + + Ids - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + If provided, specifies the exact commit ids of the commits to fetch. May not be combined with other parameters. String @@ -13342,31 +12252,6 @@ ID Title Status None - - Id - - Specifies one or more releases by ID. - To specify multiple IDs, use commas to separate the IDs. - To find the ID of a release definition, type Get-VSTeamRelease. - - Int32[] - - Int32[] - - - None - - - Raw - - Returns the raw response. This is required when you need to use the object to send back. Without this switch the object produced from the returned object will not match the expected shape of the JSON for sending back to server. - - - SwitchParameter - - - False - @@ -13384,10 +12269,49 @@ ID Title Status None + + RepositoryId + + The id or friendly name of the repository. To use the friendly name, projectId must also be specified. + + Guid + + Guid + + + None + - Expand + FromDate - Specifies which property should be expanded in the list of Release (environments, artifacts, none). + If provided, only include history entries created after this date (string) + + DateTime + + DateTime + + + None + + + ToDate + + If provided, only include history entries created before this date (string) + + DateTime + + DateTime + + + None + + + ItemVersionVersionType + + Version type (branch, tag, or commit). Determines how Id is interpreted. The acceptable values for this parameter are: + - branch + - commit + - tag String @@ -13397,9 +12321,9 @@ ID Title Status None - StatusFilter + ItemVersionVersion - Draft, Active or Abandoned. + Version string identifier (name of tag/branch, SHA1 of commit) String @@ -13409,33 +12333,42 @@ ID Title Status None - DefinitionId + ItemVersionVersionOptions - Id of the release definition + Version options - Specify additional modifiers to version (e.g Previous). The acceptable values for this parameter are: + - firstParent + - none + - previousChange - Int32 + String - Int32 + String - 0 + None - Top + CompareVersionVersionType - Specifies the maximum number to return. + Version type (branch, tag, or commit). Determines how Id is interpreted. The acceptable values for this parameter are: + - branch + - commit + - tag - Int32 + String - Int32 + String - 0 + None - CreatedBy + CompareVersionVersion - + Version string identifier (name of tag/branch, SHA1 of commit). The acceptable values for this parameter are: + - firstParent + - none + - previousChange String @@ -13445,33 +12378,33 @@ ID Title Status None - MinCreatedTime + CompareVersionVersionOptions - + Version options - Specify additional modifiers to version (e.g Previous) - DateTime + String - DateTime + String None - MaxCreatedTime + FromCommitId - + If provided, a lower bound for filtering commits alphabetically - DateTime + String - DateTime + String None - QueryOrder + ToCommitId - + If provided, an upper bound for filtering commits alphabetically String @@ -13481,9 +12414,9 @@ ID Title Status None - ContinuationToken + Author - + Alias or display name of the author String @@ -13492,36 +12425,34 @@ ID Title Status None - - Id + + Ids - Specifies one or more releases by ID. - To specify multiple IDs, use commas to separate the IDs. - To find the ID of a release definition, type Get-VSTeamRelease. + If provided, specifies the exact commit ids of the commits to fetch. May not be combined with other parameters. - Int32[] + String - Int32[] + String None - - JSON + + ItemPath - Converts the raw response into JSON and displays in the console. This is required when you need to use the object to send back. Without this switch the JSON produced from the returned object will not match the expected shape of the JSON for sending back to server. + Path of item to search under - SwitchParameter + String - SwitchParameter + String - False + None - - Raw + + ExcludeDeletes - Returns the raw response. This is required when you need to use the object to send back. Without this switch the object produced from the returned object will not match the expected shape of the JSON for sending back to server. + Only applies when an itemPath is specified. This determines whether to exclude delete entries of the specified path. SwitchParameter @@ -13530,87 +12461,95 @@ ID Title Status False - - - - + + Top + + Maximum number of entries to retrieve + + Int32 - Team.Release + Int32 + - - - - - + None + + + Skip + + Number of entries to skip + + Int32 + + Int32 + + + None + + + HistoryMode + + What Git history mode should be used. This only applies to the search criteria when Ids = null and an itemPath is specified. The acceptable values for this parameter are: + - firstParent + - fullHistory + - fullHistorySimplifyMerges + - simplifiedHistory + + String + + String + + + None + + + User + + Alias or display name of the committer + + String + + String + + + None + + + + - This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets releases. + This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets commits. You can tab complete from a list of available projects. You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - You can pipe release definition IDs to this function. + You can pipe a repository ID to this function. -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamRelease -ProjectName demo | Format-List * + PS C:\> Get-VSTeamGitCommit -ProjectName demo -RepositoryId 118C262F-0D4C-4B76-BD9B-7DD8CA12F196 - This command gets a list of all releases in the demo project. - The pipeline operator (|) passes the data to the Format-List cmdlet, which displays all available properties (*) of the release definition objects. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Get-VSTeamRelease -ProjectName demo -Id 10 -Raw - - This command returns the raw object returned from the server. - - - - -------------------------- EXAMPLE 3 -------------------------- - PS C:\> Get-VSTeamRelease -ProjectName demo -Id 10 -Json - - This command returns the raw object returned from the server formated as JSON. + This command gets a list of all commits in the demo project for a specific repository. - - - Set-VSTeamAccount - - - - Set-VSTeamDefaultProject - - - - Add-VSTeamRelease - - - - Remove-VSTeamRelease - - - + - Get-VSTeamReleaseDefinition + Get-VSTeamGitRef Get - VSTeamReleaseDefinition + VSTeamGitRef - Gets the release definitions for a team project. + Queries the provided repository for its refs and returns them. - The Get-VSTeamReleaseDefinition function gets the release definitions for a team project. - The project name is a Dynamic Parameter which may not be displayed in the syntax above but is mandatory. - With just a project name, this function gets all of the release definitions for that team project. - You can also specify a particular release definition by ID. + Get-VSTeamGitRef gets all the refs for the provided repository. - Get-VSTeamReleaseDefinition + Get-VSTeamGitRef ProjectName @@ -13625,105 +12564,66 @@ ID Title Status None - - Expand + + RepositoryId - Specifies which property should be expanded in the list of Release Definition (environments, artifacts, none). + Specifies the ID of the repository. - String + Guid - String + Guid None - - - Get-VSTeamReleaseDefinition - - ProjectName + + Filter - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + A filter to apply to the refs (starts with). - String + string - String + string None - - Id + + FilterContains - Specifies one or more release definitions by ID. - To specify multiple IDs, use commas to separate the IDs. - To find the ID of a release definition, type Get-VSTeamReleaseDefinition. + A filter to apply to the refs (contains). (Azure DevOps Service and Azure DevOps Server 2019+ only) - Int32[] + string - Int32[] + string None - - - Get-VSTeamReleaseDefinition - - ProjectName + + Top - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + Maximum number of refs to return. It cannot be bigger than 1000. If it is not provided but continuationToken is, top will default to 100. (Azure DevOps Service and Azure DevOps Server 2019+ only) - String + int - String + int None - - JSON - - Converts the raw response into JSON and displays in the console. This is required when you need to use the object to send back. Without this switch the JSON produced from the returned object will not match the expected shape of the JSON for sending back to server. - - - SwitchParameter - - - False - - - - Get-VSTeamReleaseDefinition - - ProjectName + + ContinuationToken - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + The continuation token used for pagination. (Azure DevOps Service and Azure DevOps Server 2019+ only) - String + string - String + string None - - Raw - - Returns the raw response. This is required when you need to use the object to send back. Without this switch the object produced from the returned object will not match the expected shape of the JSON for sending back to server. - - - SwitchParameter - - - False - @@ -13741,77 +12641,69 @@ ID Title Status None - - Expand + + RepositoryId - Specifies which property should be expanded in the list of Release Definition (environments, artifacts, none). + Specifies the ID of the repository. - String + Guid - String + Guid None - - Id + + Filter - Specifies one or more release definitions by ID. - To specify multiple IDs, use commas to separate the IDs. - To find the ID of a release definition, type Get-VSTeamReleaseDefinition. + A filter to apply to the refs (starts with). - Int32[] + string - Int32[] + string None - - JSON + + FilterContains - Converts the raw response into JSON and displays in the console. This is required when you need to use the object to send back. Without this switch the JSON produced from the returned object will not match the expected shape of the JSON for sending back to server. + A filter to apply to the refs (contains). (Azure DevOps Service and Azure DevOps Server 2019+ only) - SwitchParameter + string - SwitchParameter + string - False + None - - Raw + + Top - Returns the raw response. This is required when you need to use the object to send back. Without this switch the object produced from the returned object will not match the expected shape of the JSON for sending back to server. + Maximum number of refs to return. It cannot be bigger than 1000. If it is not provided but continuationToken is, top will default to 100. (Azure DevOps Service and Azure DevOps Server 2019+ only) - SwitchParameter + int - SwitchParameter + int - False + None - - - - - Int[] - - - - - - - - + + ContinuationToken + + The continuation token used for pagination. (Azure DevOps Service and Azure DevOps Server 2019+ only) + + string - Team.ReleaseDefinition + string + - - - - - + None + + + + @@ -13820,110 +12712,35 @@ ID Title Status -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamReleaseDefinition -ProjectName demo | Format-List * - - This command gets a list of all release definitions in the demo project. - The pipeline operator (|) passes the data to the Format-List cmdlet, which displays all available properties (*) of the release definition objects. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Get-VSTeamReleaseDefinition -ProjectName Demo -id 2 -Json - - This command returns the raw object returned from the server formatted as a JSON string. - - - - -------------------------- EXAMPLE 3 -------------------------- - PS C:\> Get-VSTeamReleaseDefinition -ProjectName Demo -id 2 -Raw + PS C:\> Get-VSTeamGitRef -ProjectName Demo - This command returns the raw object returned from the server. + This command returns all the Git refs for the Demo team project. - - - Set-VSTeamAccount - - - - Set-VSTeamDefaultProject - - - - Add-VSTeamReleaseDefinition - - - - Remove-VSTeamReleaseDefinition - - - + - Get-VSTeamResourceArea + Get-VSTeamGitRepository Get - VSTeamResourceArea + VSTeamGitRepository - List all the areas supported by this instance of TFS/VSTS. + Get all the repositories in your Azure DevOps or Team Foundation Server account, or a specific project. - List all the areas supported by this instance of TFS/VSTS. + Get-VSTeamGitRepository gets all the repositories in your Azure DevOps or Team Foundation Server account, or a specific project. - Get-VSTeamResourceArea - - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamResourceArea - - This will display all the areas of supported APIs for your account. - - - - - - Set-VSTeamAccount - - - - Add-VSTeamOption - - - - - - - Get-VSTeamSecurityNamespace - Get - VSTeamSecurityNamespace - - List all security namespaces or just the specified namespace. - - - - List all security namespaces or just the specified namespace. - - - - Get-VSTeamSecurityNamespace - - Id + Get-VSTeamGitRepository + + ProjectName - Security namespace identifier. + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. String @@ -13932,13 +12749,29 @@ ID Title Status None + + Id + + Specifies one or more repositories by ID. + To specify multiple IDs, use commas to separate the IDs. + To find the ID of a repository, type Get-VSTeamGitRepository. + + Guid[] + + Guid[] + + + None + - Get-VSTeamSecurityNamespace - - Name + Get-VSTeamGitRepository + + ProjectName - Security namespace name. + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. String @@ -13947,27 +12780,29 @@ ID Title Status None - - - Get-VSTeamSecurityNamespace - - LocalOnly + + Name - If true, retrieve only local security namespaces. + Specifies one or more repositories by name. + To specify multiple names, use commas to separate the names. + To find the name of a repository, type Get-VSTeamGitRepository. + String[] - SwitchParameter + String[] - False + None - - Id + + ProjectName - Security namespace identifier. + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. String @@ -13976,65 +12811,82 @@ ID Title Status None - - Name + + Id - Security namespace name. + Specifies one or more repositories by ID. + To specify multiple IDs, use commas to separate the IDs. + To find the ID of a repository, type Get-VSTeamGitRepository. - String + Guid[] - String + Guid[] None - - LocalOnly + + Name - If true, retrieve only local security namespaces. + Specifies one or more repositories by name. + To specify multiple names, use commas to separate the names. + To find the name of a repository, type Get-VSTeamGitRepository. - SwitchParameter + String[] - SwitchParameter + String[] - False + None - - - - VSTeamSecurityNamespace - - - - - - + - + + + -------------------------- EXAMPLE 1 -------------------------- + PS C:\> Get-VSTeamGitRepository + + This command returns all the Git repositories for your TFS or Team Services account. + + + + -------------------------- EXAMPLE 2 -------------------------- + PS C:\> Get-VSTeamGitRepository -ProjectName Demo + + This command returns all the Git repositories for the Demo team project. + + + + -------------------------- EXAMPLE 3 -------------------------- + PS C:\> git clone (Get-VSTeamGitRepository | select -ExpandProperty remoteUrl) + + This command gets the remote URL and passes it to git clone command. + + + - Get-VSTeamServiceEndpoint + Get-VSTeamGitStat Get - VSTeamServiceEndpoint + VSTeamGitStat - Gets a service endpoint. + Retrieves statistics about branches within a repository. - Gets a service endpoint. + Retrieves statistics about branches within a repository. - Get-VSTeamServiceEndpoint + Get-VSTeamGitStat ProjectName @@ -14049,10 +12901,64 @@ ID Title Status None - - Id + + RepositoryId - Id of the service endpoint + Specifies the ID of the repository. + + Guid + + Guid + + + None + + + BranchName + + Name of the branch. + + String + + String + + + None + + + VersionOptions + + Version options - Specify additional modifiers to version (e.g Previous). Valid options for this parameter are: + - firstParent + - none + - previousChange + + String + + String + + + None + + + Version + + Version string identifier (name of tag/branch, SHA1 of commit) + + String + + String + + + None + + + VersionType + + Version type (branch, tag, or commit). Determines how Id is interpreted. Valid options for this parameter are: + - branch + - commit + - tag String @@ -14078,93 +12984,49 @@ ID Title Status None - - Id + + RepositoryId - Id of the service endpoint + Specifies the ID of the repository. - String + Guid - String + Guid None - - - + + BranchName + + Name of the branch. + + String - System.String + String + - - - - - - - + None + + + VersionOptions + + Version options - Specify additional modifiers to version (e.g Previous). Valid options for this parameter are: + - firstParent + - none + - previousChange + + String - System.Object + String + - - - - - - - - - - - - - - - - Get-VSTeamServiceEndpointType - Get - VSTeamServiceEndpointType - - Get service endpoint types. - - - - Get service endpoint types. - - - - Get-VSTeamServiceEndpointType - - Type - - Name of service endpoint type to return. - - String - - String - - - None - - - Scheme - - Scheme of service endpoint - - String - - String - - - None - - - - - - Type + None + + + Version - Name of service endpoint type to return. + Version string identifier (name of tag/branch, SHA1 of commit) String @@ -14173,10 +13035,13 @@ ID Title Status None - - Scheme + + VersionType - Scheme of service endpoint + Version type (branch, tag, or commit). Determines how Id is interpreted. Valid options for this parameter are: + - branch + - commit + - tag String @@ -14186,49 +13051,53 @@ ID Title Status None - - - - System.String - - - - - - - - - - System.Object - - - - - - + + - + + + -------------------------- EXAMPLE 1 -------------------------- + PS C:\> Get-VSTeamGitStat -ProjectName Demo -RepositoryId 011E421A-2A54-4491-B370-9256AD8A1BDD + + This command returns all the Git stats for the entire repository + + + + -------------------------- EXAMPLE 2 -------------------------- + PS C:\> Get-VSTeamGitStat -ProjectName Demo -RepositoryId 011E421A-2A54-4491-B370-9256AD8A1BDD -BranchName develop + + This command returns all the Git stats for a specific branch + + + + -------------------------- EXAMPLE 3 -------------------------- + PS C:\> Get-VSTeamGitStat -ProjectName Demo -RepositoryId 011E421A-2A54-4491-B370-9256AD8A1BDD -BranchName develop -VersionType branch -Version 67cae2b029dff7eb3dc062b49403aaedca5bad8d + + This command returns all the Git stats for a specific commit + + + - Get-VSTeamTaskGroup + Get-VSTeamGroup Get - VSTeamTaskGroup + VSTeamGroup - Gets a task group + Returns a Group or List of Groups. - Gets a task group + Returns a Group or List of Groups. - Get-VSTeamTaskGroup + Get-VSTeamGroup ProjectName @@ -14243,10 +13112,24 @@ ID Title Status None - - Id + + SubjectTypes - ID of the existing task group + A comma separated list of user subject subtypes to reduce the retrieved results. Valid subject types: + - vssgp (Azure DevOps Group) + - aadgp (Azure Active Directory Group) + + String[] + + String[] + + + None + + + ScopeDescriptor + + Specify a non-default scope (collection, project) to search for groups. String @@ -14257,7 +13140,7 @@ ID Title Status - Get-VSTeamTaskGroup + Get-VSTeamGroup ProjectName @@ -14272,10 +13155,41 @@ ID Title Status None - - Name + + SubjectTypes - Name of the existing task group + A comma separated list of user subject subtypes to reduce the retrieved results. Valid subject types: + - vssgp (Azure DevOps Group) + - aadgp (Azure Active Directory Group) + + String[] + + String[] + + + None + + + + Get-VSTeamGroup + + ProjectName + + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + + String + + String + + + None + + + Descriptor + + The descriptor of the desired graph group. String @@ -14287,36 +13201,38 @@ ID Title Status - + ProjectName - + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - + String - + String None - - ProjectName + + SubjectTypes - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + A comma separated list of user subject subtypes to reduce the retrieved results. Valid subject types: + - vssgp (Azure DevOps Group) + - aadgp (Azure Active Directory Group) - String + String[] - String + String[] None - - Id + + ScopeDescriptor - ID of the existing task group + Specify a non-default scope (collection, project) to search for groups. String @@ -14325,10 +13241,10 @@ ID Title Status None - - Name + + Descriptor - Name of the existing task group + The descriptor of the desired graph group. String @@ -14338,26 +13254,8 @@ ID Title Status None - - - - System.String - - - - - - - - - - System.Object - - - - - - + + @@ -14366,203 +13264,177 @@ ID Title Status -------------------------- EXAMPLE 1 -------------------------- - $methodParameters = @{ - ProjectName = "some_project_name" -} - -Get-VSTeamTaskGroup @methodParameters - - Get all the task groups for the some_project_name project. Here we are splatting the parameter, but it may also be directly specified. See a non-splatting example below. - - - - -------------------------- EXAMPLE 2 -------------------------- - Get-VSTeamTaskGroup -ProjectName "some_project_name" -Id "Task_group_id" + PS C:\> $group = Get-VSTeamGroup | ? DisplayName -eq 'Endpoint Administrators' - Get a task group when the ID is already known. + Assigns Endpoint Administrators group to $group variable. + + + + + + Get-VSTeamInfo + Get + VSTeamInfo + + Displays your current account and default project. + + + + Displays your current account and default project. + + + + Get-VSTeamInfo + + + + + + + + + + + - -------------------------- EXAMPLE 3 -------------------------- - $methodParameters = @{ - ProjectName = "some_project_name" - Name = "Task_group_name" -} - -Get-VSTeamTaskGroup @methodParameters + -------------------------- EXAMPLE 1 -------------------------- + PS C:\> Get-VSTeamInfo - Get a task group by name, when the ID is not known. Here we are splatting the parameters, but they may also be directly specified. Getting by ID is preferred, as it's more efficient; but getting by name is, of course, handy. + This will display your current account and default project - Add-VSTeamTaskGroup - - - - Update-VSTeamTaskGroup - - - - Remove-VSTeamTaskGroup + Set-VSTeamAccount - Get-VSTeamTfvcBranch + Get-VSTeamJobRequest Get - VSTeamTfvcBranch + VSTeamJobRequest - Gets a branch for a given path from TFVC source control. + Returns all the job requests of an agent. - Get-VSTeamTfvcBranch gets a branch for a given path from TFVC source control. + Returns all the job requests of an agent. - Get-VSTeamTfvcBranch - - Path + Get-VSTeamJobRequest + + PoolId - Full path to the branch. + Id of the pool. - String[] + String - String[] + String None - - IncludeChildren - - Return child branches, if there are any. - - - SwitchParameter - - - False - - - IncludeParent + + AgentId - Return the parent branch, if there is one. + Id of the agent to return. + String - SwitchParameter + String - False + None - IncludeDeleted + CompletedRequestCount - Return branches marked as deleted. + The number of requests to return. + Int32 - SwitchParameter + Int32 - False + None - - Path + + PoolId - Full path to the branch. + Id of the pool. - String[] + String - String[] + String None - - IncludeChildren + + AgentId - Return child branches, if there are any. + Id of the agent to return. - SwitchParameter + String - SwitchParameter + String - False + None - IncludeParent + CompletedRequestCount - Return the parent branch, if there is one. + The number of requests to return. - SwitchParameter + Int32 - SwitchParameter + Int32 - False + None - - IncludeDeleted - - Return branches marked as deleted. - - SwitchParameter + + + - SwitchParameter - + System.String - False - - - - + + + + + + + + + System.Object + + + + + + - You can pipe paths to this function. + -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamTfvcBranch -Path $/MyProject/MyBranch - - This command returns the branch object for the path $/MyProject/MyBranch - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Get-VSTeamTfvcBranch -Path $/MyProject/MyBranch -IncludeChildren - - This command returns the branch object for the path $/MyProject/MyBranch and its child branches. - - - - -------------------------- EXAMPLE 3 -------------------------- - PS C:\> Get-VSTeamTfvcBranch -Path $/MyProject/MyBranch -IncludeParent - - This command returns the branch object for the path $/MyProject/MyBranch and its parent. - - - - -------------------------- EXAMPLE 4 -------------------------- - PS C:\> Get-VSTeamTfvcBranch -Path $/MyProject/MyBranch -IncludeDeleted - - This command returns the branch object for the path $/MyProject/MyBranch, even if it's marked as deleted. - - - - -------------------------- EXAMPLE 5 -------------------------- - PS C:\> '$/MyProject/MyBranch','$/AnotherProject/AnotherBranch' | Get-VSTeamTfvcBranch + PS C:\> Get-VSTeamJobRequest 1 111 - This command returns the branch objects for the paths $/MyProject/MyBranch and $/AnotherProject/AnotherBranch by using the pipeline. + This will display all the job request of agent with id 111 under the pool with id 1. @@ -14570,140 +13442,176 @@ Get-VSTeamTaskGroup @methodParameters - Get-VSTeamTfvcRootBranch + Get-VSTeamMember Get - VSTeamTfvcRootBranch + VSTeamMember - Gets root branches for all projects with TFVC source control. + Returns a team member. - Get-VSTeamTfvcRootBranch gets root branches for all projects with TFVC source control. + Returns a team member. - Get-VSTeamTfvcRootBranch - - IncludeChildren + Get-VSTeamMember + + ProjectName - Return the child branches for each root branch. + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + String - SwitchParameter + String - False + None - - IncludeDeleted + + TeamId - Return deleted branches. + The id of the team to search. + String - SwitchParameter + String - False + None + + + Skip + + The number of items to skip. + + Int32 + + Int32 + + + None + + + Top + + Specifies the maximum number to return. + + Int32 + + Int32 + + + None + + ProjectName + + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + + String + + String + + + None + - IncludeChildren + Skip - Return the child branches for each root branch. + The number of items to skip. - SwitchParameter + Int32 - SwitchParameter + Int32 - False + None + + + TeamId + + The id of the team to search. + + String + + String + + + None - IncludeDeleted + Top - Return deleted branches. + Specifies the maximum number to return. - SwitchParameter + Int32 - SwitchParameter + Int32 - False + None - + + + + Team.Team + + + + + + - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamTfvcRootBranch - - This command returns root branches for all projects. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Get-VSTeamTfvcRootBranch -IncludeChildren - - This command returns root branches for all projects and their respective child branches. - - - - -------------------------- EXAMPLE 3 -------------------------- - PS C:\> Get-VSTeamTfvcRootBranch -IncludeDeleted - - This command returns root branches for all projects, also those marked as deleted. - - - + - Get-VSTeamUser + Get-VSTeamMembership Get - VSTeamUser + VSTeamMembership - Returns a list of users for the account. + Gets a memberships for a container or member. - Returns a list of users for the account. + Gets a memberships for a container or member. - Get-VSTeamUser - - SubjectTypes + Get-VSTeamMembership + + ContainerDescriptor - A comma separated list of user subject subtypes to reduce the retrieved results. Valid subject types: - - vss (Azure DevOps User) - - aad (Azure Active Directory User) - - svc (Azure DevOps Service Identity) - - imp (Imported Identity) - - msa (Microsoft Account) + A container descriptor retrieved by Get-VsTeamGroup - String[] + String - String[] + String None - Get-VSTeamUser - - Descriptor + Get-VSTeamMembership + + MemberDescriptor - The descriptor of the desired graph user. + A member descriptor retrieved by Get-VsTeamUser String @@ -14715,27 +13623,22 @@ Get-VSTeamTaskGroup @methodParameters - - SubjectTypes + + ContainerDescriptor - A comma separated list of user subject subtypes to reduce the retrieved results. Valid subject types: - - vss (Azure DevOps User) - - aad (Azure Active Directory User) - - svc (Azure DevOps Service Identity) - - imp (Imported Identity) - - msa (Microsoft Account) + A container descriptor retrieved by Get-VsTeamGroup - String[] + String - String[] + String None - - Descriptor + + MemberDescriptor - The descriptor of the desired graph user. + A member descriptor retrieved by Get-VsTeamUser String @@ -14752,55 +13655,72 @@ Get-VSTeamTaskGroup @methodParameters - - + + + -------------------------- EXAMPLE 1 -------------------------- + (Get-VSTeamMembership -MemberDescriptor $user.ID).value | % { Get-VSTeamGroup -Descriptor $_.containerDescriptor } + + Get all the groups for a user + + + + -------------------------- EXAMPLE 2 -------------------------- + (Get-VSTeamMembership -ContainerDescriptor $group.id).value | % {Get-VSTeamUser -Descriptor $_.memberDescriptor } + + Get all the members for a group + + + + + + Get-VsTeamUser + + + + Get-VsTeamGroup + + + + Add-VsTeamMembership + + + + Remove-VsTeamMembership + + + + Test-VsTeamMembership + + + - Get-VSTeamUserEntitlement + Get-VSTeamOption Get - VSTeamUserEntitlement + VSTeamOption - Get User Entitlement for a user. + Returns all the versions of supported APIs of your TFS or AzD. - Get User Entitlement for a user. + Returns all the versions of supported APIs of your TFS or AzD. + There are two table formats defined for the Team.Option type, Default and Versions. + Default view contains Name, Area, Max Version and URI Template. + Version view contains Name, Area, Min Version, Max Version, Released Version and Resource Version. - Get-VSTeamUserEntitlement - - Skip - - The number of items to skip. - - Int32 - - Int32 - - - None - + Get-VSTeamOption - Top - - Specifies the maximum number to return. - - Int32 - - Int32 - - - None - - - Select + SubDomain - Comma (",") separated list of properties to select in the result entitlements. The acceptable values for this parameter are: - - Projects - - Extensions - - GroupRules + Returns options for that sub domain APIs. Some examples include: + - vsaex = Member Entitlement Management + - feeds = Artifacts + - vsrm = Release Management + - vssps = Graph + - extmgmt = Extensions String @@ -14810,66 +13730,17 @@ Get-VSTeamTaskGroup @methodParameters None - - Get-VSTeamUserEntitlement - - UserId - - The id of the user to retrieve. - - String[] - - String[] - - - None - - - Skip - - The number of items to skip. - - Int32 - - Int32 - - - None - - - UserId - - The id of the user to retrieve. - - String[] - - String[] - - - None - - - Top - - Specifies the maximum number to return. - - Int32 - - Int32 - - - None - - - Select + SubDomain - Comma (",") separated list of properties to select in the result entitlements. The acceptable values for this parameter are: - - Projects - - Extensions - - GroupRules + Returns options for that sub domain APIs. Some examples include: + - vsaex = Member Entitlement Management + - feeds = Artifacts + - vsrm = Release Management + - vssps = Graph + - extmgmt = Extensions String @@ -14886,24 +13757,51 @@ Get-VSTeamTaskGroup @methodParameters - - + + + -------------------------- EXAMPLE 1 -------------------------- + PS C:\> Get-VSTeamOption + + This will display all the versions of supported APIs for your account using the 'Default' table format. + + + + -------------------------- EXAMPLE 2 -------------------------- + PS C:\> Get-VSTeamOption | Format-Table -View Versions + + This will display all the versions of supported APIs for your account using the 'Versions' custom table format. + + + + -------------------------- EXAMPLE 3 -------------------------- + PS C:\> Get-VSTeamOption -SubDomain vsrm + + This will display all the versions of supported APIs for the release management service. + + + + + + Set-VSTeamAccount + + + - Get-VSTeamVariableGroup + Get-VSTeamPermissionInheritance Get - VSTeamVariableGroup + VSTeamPermissionInheritance - Gets a variable group + Returns true or false. - Gets a variable group + Returns true or false. - Get-VSTeamVariableGroup + Get-VSTeamPermissionInheritance ProjectName @@ -14918,10 +13816,25 @@ Get-VSTeamTaskGroup @methodParameters None - + Name - Name of the existing variable group + Specifies the name of the resource. + + String + + String + + + None + + + ResourceType + + Specifies the type of resource. The acceptable values for this parameter are: + - Repository + - BuildDefinition + - ReleaseDefinition String @@ -14933,18 +13846,6 @@ Get-VSTeamTaskGroup @methodParameters - - ProjectName - - - - - - - - - None - ProjectName @@ -14959,22 +13860,25 @@ Get-VSTeamTaskGroup @methodParameters None - - Id + + Name - ID of the existing variable group + Specifies the name of the resource. - + String - + String None - - Name + + ResourceType - Name of the existing variable group + Specifies the type of resource. The acceptable values for this parameter are: + - Repository + - BuildDefinition + - ReleaseDefinition String @@ -14984,26 +13888,8 @@ Get-VSTeamTaskGroup @methodParameters None - - - - System.String - - - - - - - - - - System.Object - - - - - - + + @@ -15012,184 +13898,111 @@ Get-VSTeamTaskGroup @methodParameters -------------------------- EXAMPLE 1 -------------------------- - $methodParameters = @{ - ProjectName = "some_project_name" -} - -Get-VSTeamVariableGroup @methodParameters + PS C:\> Get-VSTeamPermissionInheritance -ProjectName Demo -Name Demo-CI -ResourceType BuildDefinition - + This command returns true or false. -------------------------- EXAMPLE 2 -------------------------- - $methodParameters = @{ - ProjectName = "some_project_name" - Id = "variable_group_id" -} - -Get-VSTeamVariableGroup @methodParameters - - - - - - -------------------------- EXAMPLE 3 -------------------------- - $methodParameters = @{ - ProjectName = "some_project_name" - Name = "variable_group_name" -} - -Get-VSTeamVariableGroup @methodParameters + PS C:\> Get-VSTeamBuildDefinition | Get-VSTeamPermissionInheritance -ResourceType BuildDefinition - + This command returns true or false for every build definition returned from Get-VSTeamBuildDefinition. - Add-VSTeamVariableGroup + Add-VSTeamPolicy - Update-VSTeamVariableGroup + Remove-VSTeamPolicy - Remove-VSTeamVariableGroup + Get-VSTeamPermissionInheritanceType - Get-VSTeamWiqlItem + Get-VSTeamPermissionInheritance Get - VSTeamWiqlItem + VSTeamPermissionInheritance - Returns work items from the given WIQL query or a saved query by ID from your projects team. + Returns true or false. - Returns work items from the given WIQL query or a saved query by ID from your projects team. + Returns true or false. - Get-VSTeamWiqlItem - - Id + Get-VSTeamPermissionInheritance + + ProjectName - The id query to return work items for. This is the ID of any saved query within a team in a project + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - Int32 + String - Int32 + String None - - Top + + Name - The max number of results to return. + Specifies the name of the resource. String String - 100 + None - - TimePrecision + + ResourceType - Whether or not to use time precision. + Specifies the type of resource. The acceptable values for this parameter are: + - Repository + - BuildDefinition + - ReleaseDefinition + String - SwitchParameter + String - False - - - Expand - - The expand the work items with the selected attributes in the WIQL query. - - - SwitchParameter - - - False - - - - Get-VSTeamWiqlItem - - Query - - The WIQL query. For the syntax check the official documentation (https://docs.microsoft.com/en-us/azure/devops/boards/queries/wiql-syntax?view=azure-devops). - - String - - String - - - None - - - Top - - The max number of results to return. - - String - - String - - - 100 - - - TimePrecision - - Whether or not to use time precision. - - - SwitchParameter - - - False - - - Expand - - The expand the work items with the selected attributes in the WIQL query. - - - SwitchParameter - - - False + None - - Id + + ProjectName - The id query to return work items for. This is the ID of any saved query within a team in a project + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - Int32 + String - Int32 + String None - - Query + + Name - The WIQL query. For the syntax check the official documentation (https://docs.microsoft.com/en-us/azure/devops/boards/queries/wiql-syntax?view=azure-devops). + Specifies the name of the resource. String @@ -15198,139 +14011,93 @@ Get-VSTeamVariableGroup @methodParameters None - - Top + + ResourceType - The max number of results to return. + Specifies the type of resource. The acceptable values for this parameter are: + - Repository + - BuildDefinition + - ReleaseDefinition String String - 100 - - - TimePrecision - - Whether or not to use time precision. - - SwitchParameter - - SwitchParameter - - - False - - - Expand - - The expand the work items with the selected attributes in the WIQL query. - - SwitchParameter - - SwitchParameter - - - False + None - - - - System.String - - - ProjectName - - - + - If you do not set the default project by called Set-VSTeamDefaultProject before calling Get-VSTeamWiql you will have to type in the names. + -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamWiql -Query "Select [System.Id], [System.Title], [System.State] From WorkItems" -Team "MyProject Team" -Project "MyProject" -Expand + PS C:\> Get-VSTeamPermissionInheritance -ProjectName Demo -Name Demo-CI -ResourceType BuildDefinition - This command gets work items via a WIQL query and expands the return work items with only the selected fields System.Id, System.Title and System.State. + This command returns true or false. -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Get-VSTeamWiql -Query "Select [System.Id], [System.Title], [System.State] From WorkItems" -Team "MyProject Team" -Project "MyProject" + PS C:\> Get-VSTeamBuildDefinition | Get-VSTeamPermissionInheritance -ResourceType BuildDefinition - This command gets work items via a WIQL query and returns the WIQL query result with only work item IDs. + This command returns true or false for every build definition returned from Get-VSTeamBuildDefinition. - + + + Add-VSTeamPolicy + + + + Remove-VSTeamPolicy + + + + Get-VSTeamPermissionInheritanceType + + + - Get-VSTeamWorkItem + Get-VSTeamPermissionInheritance Get - VSTeamWorkItem + VSTeamPermissionInheritance - Returns one or more a work items from your project. + Returns true or false. - Returns one or more a work items from your project. + Returns true or false. - Get-VSTeamWorkItem - - Id - - The id of one or more work items. - - Int32[] - - Int32[] - - - None - - - ErrorPolicy + Get-VSTeamPermissionInheritance + + ProjectName - The flag to control error policy in a bulk get work items request. The acceptable values for this parameter are: - - Fail - - Omit + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. String String - omit - - - Fields - - Comma-separated list of requested fields. - - String[] - - String[] - - None - - Expand + + Name - Comma-separated list of requested fields. The acceptable values for this parameter are: - - None - - Relations - - Fields - - Links - - All + Specifies the name of the resource. String @@ -15339,14 +14106,17 @@ Get-VSTeamVariableGroup @methodParameters None - - AsOf + + ResourceType - + Specifies the type of resource. The acceptable values for this parameter are: + - Repository + - BuildDefinition + - ReleaseDefinition - DateTime + String - DateTime + String None @@ -15354,53 +14124,39 @@ Get-VSTeamVariableGroup @methodParameters - - Id + + ProjectName - The id of one or more work items. + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - Int32[] + String - Int32[] + String None - - ErrorPolicy + + Name - The flag to control error policy in a bulk get work items request. The acceptable values for this parameter are: - - Fail - - Omit + Specifies the name of the resource. String String - omit - - - Fields - - Comma-separated list of requested fields. - - String[] - - String[] - - None - - Expand + + ResourceType - Comma-separated list of requested fields. The acceptable values for this parameter are: - - None - - Relations - - Fields - - Links - - All + Specifies the type of resource. The acceptable values for this parameter are: + - Repository + - BuildDefinition + - ReleaseDefinition String @@ -15409,63 +14165,60 @@ Get-VSTeamVariableGroup @methodParameters None - - AsOf - - - - DateTime - - DateTime - - - None - - - - - System.String - - - ProjectName - WorkItemType - - - + - WorkItemType is a dynamic parameter and use the default project value to query their validate set. - If you do not set the default project by called Set-VSTeamDefaultProject before calling Get-VSTeamWorkItem you will have to type in the names. + -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamWorkItem -Id 47,48 + PS C:\> Get-VSTeamPermissionInheritance -ProjectName Demo -Name Demo-CI -ResourceType BuildDefinition - This command gets work items with IDs 47 and 48 by using the IDs parameter. + This command returns true or false. + + + + -------------------------- EXAMPLE 2 -------------------------- + PS C:\> Get-VSTeamBuildDefinition | Get-VSTeamPermissionInheritance -ResourceType BuildDefinition + + This command returns true or false for every build definition returned from Get-VSTeamBuildDefinition. - + + + Add-VSTeamPolicy + + + + Remove-VSTeamPolicy + + + + Get-VSTeamPermissionInheritanceType + + + - Get-VSTeamWorkItemType + Get-VSTeamPolicy Get - VSTeamWorkItemType + VSTeamPolicy - Gets a list of all Work Item Types or a single work item type. + Get the code policies in the specified Azure DevOps or Team Foundation Server project. - Gets a list of all Work Item Types or a single work item type. + Get the code policies in the specified Azure DevOps or Team Foundation Server project. - Get-VSTeamWorkItemType + Get-VSTeamPolicy ProjectName @@ -15480,14 +14233,15 @@ Get-VSTeamVariableGroup @methodParameters None - - WorkItemType + + Id - The type of work item to retrieve. + Specifies one code policy by id. + The id is an integer. Unique within each project. - String + Int - String + Int None @@ -15509,75 +14263,73 @@ Get-VSTeamVariableGroup @methodParameters None - - WorkItemType + + Id - The type of work item to retrieve. + Specifies one code policy by id. + The id is an integer. Unique within each project. - String + Int - String + Int None - - - - System.String - - - - - - - - - - System.Object - - - - - - + + - The JSON returned has empty named items i.e. "": "To Do" This causes issues with the ConvertFrom-Json CmdLet. Therefore, all "": are replaced with "_end": + -------------------------- EXAMPLE 1 -------------------------- - PS R:\repos\vsteam> Get-WorkItemType -ProjectName test -WorkItemType 'Code Review Response' + PS C:\> Get-VSTeamPolicy -ProjectName Demo - This command gets a single work item type. + This command returns all the policies for the Demo project in your TFS or Team Services account. + + + + -------------------------- EXAMPLE 2 -------------------------- + PS C:\> Get-VSTeamPolicy -ProjectName Demo -Id 1 + + This command gets the policy with an id of 1 within the Demo project. - Set-VSTeamAccount + Add-VSTeamPolicy + + + + Remove-VSTeamPolicy + + + + Get-VSTeamPolicyType - Invoke-VSTeamRequest - Invoke - VSTeamRequest + Get-VSTeamPolicyType + Get + VSTeamPolicyType - Allows you to call any TFS/AzD REST API. All the Auth and Route Structure is taken care of for you. Just provide the parts of the API call you need. If you need to send a non-standard URL use the -Url parameter. If the -Url is used the Url is not changed but the header and UserAgent are added for you. + Get the policy types in the specified Azure DevOps or Team Foundation Server project. - Invoke-VSTeamRequest allows you to call a TFS/AzD REST API much easier than using Invoke-WebRequest directly. The shape of the URI and authentication is all handled for you. + Get the policy types in the specified Azure DevOps or Team Foundation Server project. - Invoke-VSTeamRequest + Get-VSTeamPolicyType ProjectName @@ -15593,59 +14345,178 @@ Get-VSTeamVariableGroup @methodParameters None - ContentType + Id - Specifies the content type of the request. - If this parameter is omitted and the request method is POST, the content type will be set to application/json. - Otherwise, the content type is not specified in the call. + Specifies one policy type by id. - String + Guid[] - String + Guid[] - application/json + None - - Method + + + + + ProjectName + + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + + String + + String + + + None + + + Id + + Specifies one policy type by id. + + Guid[] + + Guid[] + + + None + + + + + + + + + + + + -------------------------- EXAMPLE 1 -------------------------- + PS C:\> Get-VSTeamPolicyType -ProjectName Demo + + This command returns all the policy types for the Demo project. + + + + -------------------------- EXAMPLE 3 -------------------------- + PS C:\> Get-VSTeamPolicyType -ProjectName Demo -Id 73da726a-8ff9-44d7-8caa-cbb581eac991 + + This command gets the policy type by the specified id within the Demo project. + + + + + + Add-VSTeamPolicy + + + + Remove-VSTeamPolicy + + + + Get-VSTeamPolicy + + + + + + + Get-VSTeamPool + Get + VSTeamPool + + Returns the agent pools. + + + + Returns the agent pools. + + + + Get-VSTeamPool + + Id - Specifies the method used for the request. The acceptable values for this parameter are: - - Get - - Post - - Patch - - Delete - - Options - - Put - - Default - - Trace - - Head - - Merge + Id of the pool to return. - String + int - String - - - Get - - - Body - - Specifies the body of the request. The body is the content of the request that follows the headers. You can also pipe a body value to Invoke-VSTeamRequest. - The Body parameter can be used to specify a list of query parameters or specify the content of the response. - When the input is a GET request and the body is an IDictionary (typically, a hash table), the body is added to the URI as query parameters. For other GET requests, the body is set as the value of the request body in the standard name=value format. - - Object - - Object + int None - - InFile + + + + + Id + + Id of the pool to return. + + int + + int + + + None + + + + + + System.String + + + + + + + + + + System.Object + + + + + + + + + + + + + + + + + Get-VSTeamProcess + Get + VSTeamProcess + + Returns a list of process templates in the Team Services or Team Foundation Server account. + + + + The list of Process Templates returned can be controlled by using the top and skip parameters. + You can also get a single Process Template by name or id. + You must call Set-VSTeamAccount before calling this function. + + + + Get-VSTeamProcess + + Name - Path and file name to the file that contains the contents of the request. If the path is omitted, the default is the current location. + Specifies the process template name for which this function operates. + You can tab complete from a list of available process templates. String @@ -15655,33 +14526,37 @@ Get-VSTeamVariableGroup @methodParameters None - OutFile + Top - Specifies the output file for which this function saves the response body. Enter a path and file name. If you omit the path, the default is the current location. + Specifies the maximum number to return. - String + Int32 - String + Int32 - None + 100 - Area + Skip - The area to find the resource. + Defines the number of Process Templates to skip. The default value is 0 - String + Int32 - String + Int32 - None + 0 - - Resource + + + Get-VSTeamProcess + + Name - The name of the feature you want to manipulate. + Specifies the process template name for which this function operates. + You can tab complete from a list of available process templates. String @@ -15690,34 +14565,10 @@ Get-VSTeamVariableGroup @methodParameters None - + Id - The unique value of the item you want to work with. - - String - - String - - - None - - - Version - - The version of the API you wish to target. - - String - - String - - - None - - - SubDomain - - The SubDomain before .dev.azure.com. For example, to target Release Management you must use the SubDomain vsrm. + The id of the Process Template to return. String @@ -15726,124 +14577,50 @@ Get-VSTeamVariableGroup @methodParameters None - - JSON - - Converts the PowerShell object into JSON and displays in the console. - - - SwitchParameter - - - False - - - AdditionalHeaders - - Adds additional headers to the request - - Hashtable - - Hashtable - - - None - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - ContentType - - Specifies the content type of the request. - If this parameter is omitted and the request method is POST, the content type will be set to application/json. - Otherwise, the content type is not specified in the call. - - String - - String - - - application/json - - - Method + Name - Specifies the method used for the request. The acceptable values for this parameter are: - - Get - - Post - - Patch - - Delete - - Options - - Put - - Default - - Trace - - Head - - Merge + Specifies the process template name for which this function operates. + You can tab complete from a list of available process templates. String String - Get - - - Body - - Specifies the body of the request. The body is the content of the request that follows the headers. You can also pipe a body value to Invoke-VSTeamRequest. - The Body parameter can be used to specify a list of query parameters or specify the content of the response. - When the input is a GET request and the body is an IDictionary (typically, a hash table), the body is added to the URI as query parameters. For other GET requests, the body is set as the value of the request body in the standard name=value format. - - Object - - Object - - None - InFile + Top - Path and file name to the file that contains the contents of the request. If the path is omitted, the default is the current location. + Specifies the maximum number to return. - String + Int32 - String + Int32 - None + 100 - OutFile + Skip - Specifies the output file for which this function saves the response body. Enter a path and file name. If you omit the path, the default is the current location. + Defines the number of Process Templates to skip. The default value is 0 - String + Int32 - String + Int32 - None + 0 - - Area + + Id - The area to find the resource. + The id of the Process Template to return. String @@ -15852,46 +14629,75 @@ Get-VSTeamVariableGroup @methodParameters None - - Resource - - The name of the feature you want to manipulate. - - String - - String - - - None - - - Id - - The unique value of the item you want to work with. - - String - - String - - - None - - - Version - - The version of the API you wish to target. - - String - - String - - - None - - - SubDomain + + + + + + + + + + + -------------------------- EXAMPLE 1 -------------------------- + PS C:\> Get-VSTeamProcess + + This will return all the Process Templates + + + + -------------------------- EXAMPLE 2 -------------------------- + PS C:\> Get-VSTeamProcess -top 5 | Format-Wide + + This will return the top five Process Templates only showing their name + + + + + + Set-VSTeamAccount + + + + Add-VSTeamProject + + + + + + + Get-VSTeamProfile + Get + VSTeamProfile + + Returns the saved profiles. + + + + Returns the saved profiles. + + + + Get-VSTeamProfile + + Name + + Optional name for the profile. + + String + + String + + + None + + + + + + Name - The SubDomain before .dev.azure.com. For example, to target Release Management you must use the SubDomain vsrm. + Optional name for the profile. String @@ -15900,51 +14706,9 @@ Get-VSTeamVariableGroup @methodParameters None - - JSON - - Converts the PowerShell object into JSON and displays in the console. - - SwitchParameter - - SwitchParameter - - - False - - - AdditionalHeaders - - Adds additional headers to the request - - Hashtable - - Hashtable - - - None - - - - - System.String - - - - - - - - - - System.Object - - - - - - + + @@ -15953,36 +14717,47 @@ Get-VSTeamVariableGroup @methodParameters -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Invoke-VSTeamRequest -resource projectHistory -version '4.1-preview' -Verbose + PS C:\> Get-VSTeamProfile - This command will return the project history. + Return the list of saved profiles -------------------------- EXAMPLE 2 -------------------------- - PS C:\> ivr -area release -resource releases -version '4.1-preview' -subDomain vsrm -Verbose + PS C:\> Get-VSTeamProfile -Name mydemos - This command will return the releases for a project. + Will return details of the profile provided - + + + Set-VSTeamAccount + + + + Add-VSTeamProfile + + + - Remove-VSTeam - Remove - VSTeam + Get-VSTeamProject + Get + VSTeamProject - Removes a team from a project. + Returns a list of projects in the Team Services or Team Foundation Server account. - Removes a team from a project. + The list of projects returned can be controlled by using the stateFilter, top and skip parameters. + You can also get a single project by name or id. + You must call Set-VSTeamAccount before calling this function. - Remove-VSTeam + Get-VSTeamProject ProjectName @@ -15997,44 +14772,80 @@ Get-VSTeamVariableGroup @methodParameters None - - TeamId + + StateFilter - The id of the team to remove. + Returns team projects in a specific team project state. The acceptable values for this parameter are: + - WellFormed + - CreatePending + - Deleting + - New + - All String String - None + WellFormed - - Confirm + + Top - Prompts you for confirmation before running the function. + Specifies the maximum number to return. + Int32 - SwitchParameter + Int32 - False + 100 - Force + Skip - Forces the function without confirmation + Defines the number of team projects to skip. The default value is 0 + Int32 - SwitchParameter + Int32 - False + 0 - - WhatIf + + + Get-VSTeamProject + + ProjectName - Shows what would happen if the function runs. The function is not run. + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + + String + + String + + + None + + + Id + + The id of the project to return. + + String + + String + + + None + + + IncludeCapabilities + + Will return additional information about the project. SwitchParameter @@ -16059,46 +14870,63 @@ Get-VSTeamVariableGroup @methodParameters None - - TeamId + + StateFilter - The id of the team to remove. + Returns team projects in a specific team project state. The acceptable values for this parameter are: + - WellFormed + - CreatePending + - Deleting + - New + - All String String - None + WellFormed - - Confirm + + Top - Prompts you for confirmation before running the function. + Specifies the maximum number to return. - SwitchParameter + Int32 - SwitchParameter + Int32 - False + 100 - Force + Skip - Forces the function without confirmation + Defines the number of team projects to skip. The default value is 0 - SwitchParameter + Int32 - SwitchParameter + Int32 - False + 0 - - WhatIf + + Id - Shows what would happen if the function runs. The function is not run. + The id of the project to return. + + String + + String + + + None + + + IncludeCapabilities + + Will return additional information about the project. SwitchParameter @@ -16115,121 +14943,70 @@ Get-VSTeamVariableGroup @methodParameters - - + + + -------------------------- EXAMPLE 1 -------------------------- + PS C:\> Get-VSTeamProject + + This will return all the WellFormed team projects. + + + + -------------------------- EXAMPLE 2 -------------------------- + PS C:\> Get-VSTeamProject -top 5 | Format-Wide + + This will return the top five WellFormed team projects only showing their name + + + + + + Set-VSTeamAccount + + + + Add-VSTeamProject + + + + Remove-VSTeamProject + + + - Remove-VSTeamAccessControlEntry - Remove - VSTeamAccessControlEntry + Get-VSTeamPullRequest + Get + VSTeamPullRequest - Removes specified ACEs in the ACL for the provided token. The request URI contains the namespace ID, the target token, and a single or list of descriptors that should be removed. Only supports removing AzD based users/groups. + Returns one or more open pull requests from your team, project, or Id. - Removes specified ACEs in the ACL for the provided token. The request URI contains the namespace ID, the target token, and a single or list of descriptors that should be removed. Only supports removing AzD based users/groups. + Returns one or more open pull requests from your team, project, or Id. - Remove-VSTeamAccessControlEntry - - SecurityNamespace + Get-VSTeamPullRequest + + ProjectName - VSTeamSecurityNamespace object. + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - VSTeamSecurityNamespace + String - VSTeamSecurityNamespace + String None - - SecurityNamespaceId + + Id - Security namespace identifier. - Valid IDs are: - AzD: - Analytics (58450c49-b02d-465a-ab12-59ae512d6531) - - AnalyticsViews (d34d3680-dfe5-4cc6-a949-7d9c68f73cba) - - ReleaseManagement (7c7d32f7-0e86-4cd6-892e-b35dbba870bd) - - ReleaseManagement2 (c788c23e-1b46-4162-8f5e-d7585343b5de) - - Identity (5a27515b-ccd7-42c9-84f1-54c998f03866) - - WorkItemTrackingAdministration (445d2788-c5fb-4132-bbef-09c4045ad93f) - - DistributedTask (101eae8c-1709-47f9-b228-0e476c35b3ba) - - WorkItemQueryFolders (71356614-aad7-4757-8f2c-0fb3bff6f680) - - GitRepositories (2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87) - - VersionControlItems2 (3c15a8b7-af1a-45c2-aa97-2cb97078332e) - - EventSubscriber (2bf24a2b-70ba-43d3-ad97-3d9e1f75622f) - - WorkItemTrackingProvision (5a6cd233-6615-414d-9393-48dbb252bd23) - - ServiceEndpoints (49b48001-ca20-4adc-8111-5b60c903a50c) - - ServiceHooks (cb594ebe-87dd-4fc9-ac2c-6a10a4c92046) - - Chat (bc295513-b1a2-4663-8d1a-7017fd760d18) - - Collection (3e65f728-f8bc-4ecd-8764-7e378b19bfa7) - - Proxy (cb4d56d2-e84b-457e-8845-81320a133fbb) - - Plan (bed337f8-e5f3-4fb9-80da-81e17d06e7a8) - - Process (2dab47f9-bd70-49ed-9bd5-8eb051e59c02) - - AccountAdminSecurity (11238e09-49f2-40c7-94d0-8f0307204ce4) - - Library (b7e84409-6553-448a-bbb2-af228e07cbeb) - - Environment (83d4c2e6-e57d-4d6e-892b-b87222b7ad20) - - Project (52d39943-cb85-4d7f-8fa8-c6baac873819) - - EventSubscription (58b176e7-3411-457a-89d0-c6d0ccb3c52b) - - CSS (83e28ad4-2d72-4ceb-97b0-c7726d5502c3) - - TeamLabSecurity (9e4894c3-ff9a-4eac-8a85-ce11cafdc6f1) - - ProjectAnalysisLanguageMetrics (fc5b7b85-5d6b-41eb-8534-e128cb10eb67) - - Tagging (bb50f182-8e5e-40b8-bc21-e8752a1e7ae2) - - MetaTask (f6a4de49-dbe2-4704-86dc-f8ec1a294436) - - Iteration (bf7bfa03-b2b7-47db-8113-fa2e002cc5b1) - - Favorites (fa557b48-b5bf-458a-bb2b-1b680426fe8b) - - Registry (4ae0db5d-8437-4ee8-a18b-1f6fb38bd34c) - - Graph (c2ee56c9-e8fa-4cdd-9d48-2c44f697a58e) - - ViewActivityPaneSecurity (dc02bf3d-cd48-46c3-8a41-345094ecc94b) - - Job (2a887f97-db68-4b7c-9ae3-5cebd7add999) - - WorkItemTracking (73e71c45-d483-40d5-bdba-62fd076f7f87) - - StrongBox (4a9e8381-289a-4dfd-8460-69028eaa93b3) - - Server (1f4179b3-6bac-4d01-b421-71ea09171400) - - TestManagement (e06e1c24-e93d-4e4a-908a-7d951187b483) - - SettingEntries (6ec4592e-048c-434e-8e6c-8671753a8418) - - BuildAdministration (302acaca-b667-436d-a946-87133492041c) - - Location (2725d2bc-7520-4af4-b0e3-8d876494731f) - - Boards (251e12d9-bea3-43a8-bfdb-901b98c0125e) - - UtilizationPermissions (83abde3a-4593-424e-b45f-9898af99034d) - - WorkItemsHub (c0e7a722-1cad-4ae6-b340-a8467501e7ce) - - WebPlatform (0582eb05-c896-449a-b933-aa3d99e121d6) - - VersionControlPrivileges (66312704-deb5-43f9-b51c-ab4ff5e351c3) - - Workspaces (93bafc04-9075-403a-9367-b7164eac6b5c) - - CrossProjectWidgetView (093cbb02-722b-4ad6-9f88-bc452043fa63) - - WorkItemTrackingConfiguration (35e35e8e-686d-4b01-aff6-c369d6e36ce0) - - Discussion Threads (0d140cae-8ac1-4f48-b6d1-c93ce0301a12) - - BoardsExternalIntegration (5ab15bc8-4ea1-d0f3-8344-cab8fe976877) - - DataProvider (7ffa7cf4-317c-4fea-8f1d-cfda50cfa956) - - Social (81c27cc8-7a9f-48ee-b63f-df1e1d0412dd) - - Security (9a82c708-bfbe-4f31-984c-e860c2196781) - - IdentityPicker (a60e0d84-c2f8-48e4-9c0c-f32da48d5fd1) - - ServicingOrchestration (84cc1aa4-15bc-423d-90d9-f97c450fc729) - - Build (33344d9c-fc72-4d6f-aba5-fa317101a7e9) - - DashboardsPrivileges (8adf73b7-389a-4276-b638-fe1653f7efc7) - - VersionControlItems (a39371cf-0841-4c16-bbd3-276e341bc052) - - VSSPS: - EventSubscriber (2bf24a2b-70ba-43d3-ad97-3d9e1f75622f) (VSSPS) - - EventSubscription (58b176e7-3411-457a-89d0-c6d0ccb3c52b) (VSSPS) - - Registry (4ae0db5d-8437-4ee8-a18b-1f6fb38bd34c) (VSSPS) - - Graph (c2ee56c9-e8fa-4cdd-9d48-2c44f697a58e) (VSSPS) - - Invitation (ea0b4d1e-577a-4797-97b5-2f5755e548d5) (VSSPS) - - SystemGraph (b24dfdf1-285a-4ea6-a55b-32549a68121d) (VSSPS) - - Job (2a887f97-db68-4b7c-9ae3-5cebd7add999) (VSSPS) - - CommerceCollectionSecurity (307be2d3-12ed-45c2-aacf-6598760efca7) (VSSPS) - - StrongBox (4a9e8381-289a-4dfd-8460-69028eaa93b3) (VSSPS) - - GroupLicensing (c6a4fd35-b508-49eb-8ea7-7189df5f3698) (VSSPS) - - Server (1f4179b3-6bac-4d01-b421-71ea09171400) (VSSPS) - - SettingEntries (6ec4592e-048c-434e-8e6c-8671753a8418) (VSSPS) - - RemotableTemplateTest (ccdcb71c-4780-4a42-9bb4-8bce07a7628f) (VSSPS) - - Location (2725d2bc-7520-4af4-b0e3-8d876494731f) (VSSPS) - - WebPlatform (0582eb05-c896-449a-b933-aa3d99e121d6) (VSSPS) - - DataProvider (7ffa7cf4-317c-4fea-8f1d-cfda50cfa956) (VSSPS) - - Security (9a82c708-bfbe-4f31-984c-e860c2196781) (VSSPS) - - IdentityPicker (a60e0d84-c2f8-48e4-9c0c-f32da48d5fd1) (VSSPS) - - ServicingOrchestration (84cc1aa4-15bc-423d-90d9-f97c450fc729) (VSSPS) + Specifies the pull request by ID. String @@ -16238,14 +15015,15 @@ Get-VSTeamVariableGroup @methodParameters None - - Token + + + Get-VSTeamPullRequest + + ProjectName - The security Token - Valid token formats are: - - Git Repository (repov2/$projectID/$repositoryID) - - Build Definition ($projectID/$buildDefinitionID) - - Release Definition ($projectID/$releaseDefinitionID, $projectID/Path/to/Release/$releaseDefinitionID) + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. String @@ -16254,64 +15032,4132 @@ Get-VSTeamVariableGroup @methodParameters None - - Descriptor + + RepositoryId - An array of descriptors of users/groups to be removed + The repository ID of the pull request's target branch. - System.Array + Guid - System.Array + Guid None - - - - - SecurityNamespace - - VSTeamSecurityNamespace object. - - VSTeamSecurityNamespace - - VSTeamSecurityNamespace - - - None - - - SecurityNamespaceId - - Security namespace identifier. - Valid IDs are: - AzD: - Analytics (58450c49-b02d-465a-ab12-59ae512d6531) - - AnalyticsViews (d34d3680-dfe5-4cc6-a949-7d9c68f73cba) - - ReleaseManagement (7c7d32f7-0e86-4cd6-892e-b35dbba870bd) - - ReleaseManagement2 (c788c23e-1b46-4162-8f5e-d7585343b5de) - - Identity (5a27515b-ccd7-42c9-84f1-54c998f03866) - - WorkItemTrackingAdministration (445d2788-c5fb-4132-bbef-09c4045ad93f) - - DistributedTask (101eae8c-1709-47f9-b228-0e476c35b3ba) - - WorkItemQueryFolders (71356614-aad7-4757-8f2c-0fb3bff6f680) - - GitRepositories (2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87) - - VersionControlItems2 (3c15a8b7-af1a-45c2-aa97-2cb97078332e) - - EventSubscriber (2bf24a2b-70ba-43d3-ad97-3d9e1f75622f) - - WorkItemTrackingProvision (5a6cd233-6615-414d-9393-48dbb252bd23) - - ServiceEndpoints (49b48001-ca20-4adc-8111-5b60c903a50c) - - ServiceHooks (cb594ebe-87dd-4fc9-ac2c-6a10a4c92046) - - Chat (bc295513-b1a2-4663-8d1a-7017fd760d18) - - Collection (3e65f728-f8bc-4ecd-8764-7e378b19bfa7) - - Proxy (cb4d56d2-e84b-457e-8845-81320a133fbb) - - Plan (bed337f8-e5f3-4fb9-80da-81e17d06e7a8) - - Process (2dab47f9-bd70-49ed-9bd5-8eb051e59c02) - - AccountAdminSecurity (11238e09-49f2-40c7-94d0-8f0307204ce4) - - Library (b7e84409-6553-448a-bbb2-af228e07cbeb) - - Environment (83d4c2e6-e57d-4d6e-892b-b87222b7ad20) - - Project (52d39943-cb85-4d7f-8fa8-c6baac873819) - - EventSubscription (58b176e7-3411-457a-89d0-c6d0ccb3c52b) - - CSS (83e28ad4-2d72-4ceb-97b0-c7726d5502c3) - - TeamLabSecurity (9e4894c3-ff9a-4eac-8a85-ce11cafdc6f1) + + SourceRepositoryId + + If set, search for pull requests whose source branch is in this repository. + + Guid + + Guid + + + None + + + SourceBranchRef + + If set, search for pull requests from this branch. + + String + + String + + + None + + + TargetBranchRef + + If set, search for pull requests into this branch. + + String + + String + + + None + + + Status + + If set, search for pull requests that are in this state. Defaults to Active if unset. Valid values for this parameter are: + - abandoned + - active + - all + - completed + - notSet + + String + + String + + + None + + + Top + + The number of pull requests to retrieve. + + Int32 + + Int32 + + + None + + + Skip + + The number of pull requests to ignore. For example, to retrieve results 101-150, set top to 50 and skip to 100. + + Int32 + + Int32 + + + None + + + + Get-VSTeamPullRequest + + ProjectName + + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + + String + + String + + + None + + + RepositoryId + + The repository ID of the pull request's target branch. + + Guid + + Guid + + + None + + + SourceRepositoryId + + If set, search for pull requests whose source branch is in this repository. + + Guid + + Guid + + + None + + + SourceBranchRef + + If set, search for pull requests from this branch. + + String + + String + + + None + + + TargetBranchRef + + If set, search for pull requests into this branch. + + String + + String + + + None + + + All + + + + + SwitchParameter + + + False + + + Top + + The number of pull requests to retrieve. + + Int32 + + Int32 + + + None + + + Skip + + The number of pull requests to ignore. For example, to retrieve results 101-150, set top to 50 and skip to 100. + + Int32 + + Int32 + + + None + + + + + + ProjectName + + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + + String + + String + + + None + + + Id + + Specifies the pull request by ID. + + String + + String + + + None + + + RepositoryId + + The repository ID of the pull request's target branch. + + Guid + + Guid + + + None + + + SourceRepositoryId + + If set, search for pull requests whose source branch is in this repository. + + Guid + + Guid + + + None + + + SourceBranchRef + + If set, search for pull requests from this branch. + + String + + String + + + None + + + TargetBranchRef + + If set, search for pull requests into this branch. + + String + + String + + + None + + + Status + + If set, search for pull requests that are in this state. Defaults to Active if unset. Valid values for this parameter are: + - abandoned + - active + - all + - completed + - notSet + + String + + String + + + None + + + All + + + + SwitchParameter + + SwitchParameter + + + False + + + + + + + + + + + + -------------------------- EXAMPLE 1 -------------------------- + PS C:\> Get-VSTeamProject + + This will return all the WellFormed team projects. + + + + -------------------------- EXAMPLE 2 -------------------------- + PS C:\> Get-VSTeamProject -top 5 | Format-Wide + + This will return the top five WellFormed team projects only showing their name + + + + + + Set-VSTeamAccount + + + + Add-VSTeamProject + + + + Remove-VSTeamProject + + + + + + + Get-VSTeamPullRequest + Get + VSTeamPullRequest + + Returns one or more open pull requests from your team, project, or Id. + + + + Returns one or more open pull requests from your team, project, or Id. + + + + Get-VSTeamPullRequest + + ProjectName + + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + + String + + String + + + None + + + Id + + Specifies the pull request by ID. + + String + + String + + + None + + + + Get-VSTeamPullRequest + + ProjectName + + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + + String + + String + + + None + + + RepositoryId + + The repository ID of the pull request's target branch. + + Guid + + Guid + + + None + + + SourceRepositoryId + + If set, search for pull requests whose source branch is in this repository. + + Guid + + Guid + + + None + + + SourceBranchRef + + If set, search for pull requests from this branch. + + String + + String + + + None + + + TargetBranchRef + + If set, search for pull requests into this branch. + + String + + String + + + None + + + Status + + If set, search for pull requests that are in this state. Defaults to Active if unset. Valid values for this parameter are: + - abandoned + - active + - all + - completed + - notSet + + String + + String + + + None + + + Top + + The number of pull requests to retrieve. + + Int32 + + Int32 + + + None + + + Skip + + The number of pull requests to ignore. For example, to retrieve results 101-150, set top to 50 and skip to 100. + + Int32 + + Int32 + + + None + + + + Get-VSTeamPullRequest + + ProjectName + + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + + String + + String + + + None + + + RepositoryId + + The repository ID of the pull request's target branch. + + Guid + + Guid + + + None + + + SourceRepositoryId + + If set, search for pull requests whose source branch is in this repository. + + Guid + + Guid + + + None + + + SourceBranchRef + + If set, search for pull requests from this branch. + + String + + String + + + None + + + TargetBranchRef + + If set, search for pull requests into this branch. + + String + + String + + + None + + + All + + + + + SwitchParameter + + + False + + + Top + + The number of pull requests to retrieve. + + Int32 + + Int32 + + + None + + + Skip + + The number of pull requests to ignore. For example, to retrieve results 101-150, set top to 50 and skip to 100. + + Int32 + + Int32 + + + None + + + + + + ProjectName + + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + + String + + String + + + None + + + Id + + Specifies the pull request by ID. + + String + + String + + + None + + + RepositoryId + + The repository ID of the pull request's target branch. + + Guid + + Guid + + + None + + + SourceRepositoryId + + If set, search for pull requests whose source branch is in this repository. + + Guid + + Guid + + + None + + + SourceBranchRef + + If set, search for pull requests from this branch. + + Int32 + + Int32 + + + None + + + TargetBranchRef + + If set, search for pull requests into this branch. + + String + + String + + + None + + + Status + + If set, search for pull requests that are in this state. Defaults to Active if unset. Valid values for this parameter are: + - abandoned + - active + - all + - completed + - notSet + + Int32 + + Int32 + + + None + + + All + + + + SwitchParameter + + SwitchParameter + + + False + + + Top + + The number of pull requests to retrieve. + + Int32 + + Int32 + + + None + + + Skip + + The number of pull requests to ignore. For example, to retrieve results 101-150, set top to 50 and skip to 100. + + Int32 + + Int32 + + + None + + + + + + + + + + + + -------------------------- EXAMPLE 1 -------------------------- + PS C:\> Get-VSTeamPullRequest + + This command returns all the open pull requests for your TFS or Team Services account. + + + + -------------------------- EXAMPLE 2 -------------------------- + PS C:\> Get-VSTeamPullRequest -ProjectName Demo + + This command returns all the open pull requests for the Demo team project. + + + + -------------------------- EXAMPLE 3 -------------------------- + PS C:\> Get-VSTeamPullRequest -ProjectName Demo -All + + This command returns all pull requests for the Demo team project. + + + + -------------------------- EXAMPLE 4 -------------------------- + PS C:\> Get-VSTeamPullRequest -ProjectName Demo -TargetBranchRef "refs/heads/mybranch" + + This command returns all open pull requests for a specific branch + + + + -------------------------- EXAMPLE 5 -------------------------- + PS C:\> Get-VSTeamPullRequest -Id 123 + + This command gets the pull request with an Id of 123. + + + + + + Show-VSTeamPullRequest + + + + Add-VSTeamPullRequest + + + + Update-VSTeamPullRequest + + + + + + + Get-VSTeamQueue + Get + VSTeamQueue + + Gets a agent queue. + + + + Gets a agent queue. + + + + Get-VSTeamQueue + + ProjectName + + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + + String + + String + + + None + + + QueueName + + Name of the queue to return. + + String + + String + + + None + + + ActionFilter + + None, Manage or Use. + + String + + String + + + None + + + + Get-VSTeamQueue + + ProjectName + + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + + String + + String + + + None + + + Id + + Id of the queue to return. + + String + + String + + + None + + + + + + ProjectName + + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + + String + + String + + + None + + + QueueName + + Name of the queue to return. + + String + + String + + + None + + + ActionFilter + + None, Manage or Use. + + String + + String + + + None + + + Id + + Id of the queue to return. + + String + + String + + + None + + + + + + + Team.Queue + + + + + + + + + + + + + + + + + Get-VSTeamRelease + Get + VSTeamRelease + + Gets the releases for a team project. + + + + The Get-VSTeamRelease function gets the releases for a team project. + The project name is a Dynamic Parameter which may not be displayed in the syntax above but is mandatory. + With just a project name, this function gets all of the releases for that team project. + You can also specify a particular release definition by ID. + + + + Get-VSTeamRelease + + ProjectName + + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + + String + + String + + + None + + + Expand + + Specifies which property should be expanded in the list of Release (environments, artifacts, none). + + String + + String + + + None + + + StatusFilter + + Draft, Active or Abandoned. + + String + + String + + + None + + + DefinitionId + + Id of the release definition + + Int32 + + Int32 + + + 0 + + + Top + + Specifies the maximum number to return. + + Int32 + + Int32 + + + 0 + + + CreatedBy + + + + String + + String + + + None + + + MinCreatedTime + + + + DateTime + + DateTime + + + None + + + MaxCreatedTime + + + + DateTime + + DateTime + + + None + + + QueryOrder + + + + String + + String + + + None + + + ContinuationToken + + + + String + + String + + + None + + + + Get-VSTeamRelease + + ProjectName + + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + + String + + String + + + None + + + Id + + Specifies one or more releases by ID. + To specify multiple IDs, use commas to separate the IDs. + To find the ID of a release definition, type Get-VSTeamRelease. + + Int32[] + + Int32[] + + + None + + + + Get-VSTeamRelease + + ProjectName + + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + + String + + String + + + None + + + Id + + Specifies one or more releases by ID. + To specify multiple IDs, use commas to separate the IDs. + To find the ID of a release definition, type Get-VSTeamRelease. + + Int32[] + + Int32[] + + + None + + + JSON + + Converts the raw response into JSON and displays in the console. This is required when you need to use the object to send back. Without this switch the JSON produced from the returned object will not match the expected shape of the JSON for sending back to server. + + + SwitchParameter + + + False + + + + Get-VSTeamRelease + + ProjectName + + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + + String + + String + + + None + + + Id + + Specifies one or more releases by ID. + To specify multiple IDs, use commas to separate the IDs. + To find the ID of a release definition, type Get-VSTeamRelease. + + Int32[] + + Int32[] + + + None + + + Raw + + Returns the raw response. This is required when you need to use the object to send back. Without this switch the object produced from the returned object will not match the expected shape of the JSON for sending back to server. + + + SwitchParameter + + + False + + + + + + ProjectName + + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + + String + + String + + + None + + + Expand + + Specifies which property should be expanded in the list of Release (environments, artifacts, none). + + String + + String + + + None + + + StatusFilter + + Draft, Active or Abandoned. + + String + + String + + + None + + + DefinitionId + + Id of the release definition + + Int32 + + Int32 + + + 0 + + + Top + + Specifies the maximum number to return. + + Int32 + + Int32 + + + 0 + + + CreatedBy + + + + String + + String + + + None + + + MinCreatedTime + + + + DateTime + + DateTime + + + None + + + MaxCreatedTime + + + + DateTime + + DateTime + + + None + + + QueryOrder + + + + String + + String + + + None + + + ContinuationToken + + + + String + + String + + + None + + + Id + + Specifies one or more releases by ID. + To specify multiple IDs, use commas to separate the IDs. + To find the ID of a release definition, type Get-VSTeamRelease. + + Int32[] + + Int32[] + + + None + + + JSON + + Converts the raw response into JSON and displays in the console. This is required when you need to use the object to send back. Without this switch the JSON produced from the returned object will not match the expected shape of the JSON for sending back to server. + + SwitchParameter + + SwitchParameter + + + False + + + Raw + + Returns the raw response. This is required when you need to use the object to send back. Without this switch the object produced from the returned object will not match the expected shape of the JSON for sending back to server. + + SwitchParameter + + SwitchParameter + + + False + + + + + + + Team.Release + + + + + + + + + This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets releases. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + You can pipe release definition IDs to this function. + + + + + -------------------------- EXAMPLE 1 -------------------------- + PS C:\> Get-VSTeamRelease -ProjectName demo | Format-List * + + This command gets a list of all releases in the demo project. + The pipeline operator (|) passes the data to the Format-List cmdlet, which displays all available properties (*) of the release definition objects. + + + + -------------------------- EXAMPLE 2 -------------------------- + PS C:\> Get-VSTeamRelease -ProjectName demo -Id 10 -Raw + + This command returns the raw object returned from the server. + + + + -------------------------- EXAMPLE 3 -------------------------- + PS C:\> Get-VSTeamRelease -ProjectName demo -Id 10 -Json + + This command returns the raw object returned from the server formated as JSON. + + + + + + Set-VSTeamAccount + + + + Set-VSTeamDefaultProject + + + + Add-VSTeamRelease + + + + Remove-VSTeamRelease + + + + + + + Get-VSTeamReleaseDefinition + Get + VSTeamReleaseDefinition + + Gets the release definitions for a team project. + + + + The Get-VSTeamReleaseDefinition function gets the release definitions for a team project. + The project name is a Dynamic Parameter which may not be displayed in the syntax above but is mandatory. + With just a project name, this function gets all of the release definitions for that team project. + You can also specify a particular release definition by ID. + + + + Get-VSTeamReleaseDefinition + + ProjectName + + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + + String + + String + + + None + + + Expand + + Specifies which property should be expanded in the list of Release Definition (environments, artifacts, none). + + String + + String + + + None + + + + Get-VSTeamReleaseDefinition + + ProjectName + + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + + String + + String + + + None + + + Id + + Specifies one or more release definitions by ID. + To specify multiple IDs, use commas to separate the IDs. + To find the ID of a release definition, type Get-VSTeamReleaseDefinition. + + Int32[] + + Int32[] + + + None + + + + Get-VSTeamReleaseDefinition + + ProjectName + + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + + String + + String + + + None + + + JSON + + Converts the raw response into JSON and displays in the console. This is required when you need to use the object to send back. Without this switch the JSON produced from the returned object will not match the expected shape of the JSON for sending back to server. + + + SwitchParameter + + + False + + + + Get-VSTeamReleaseDefinition + + ProjectName + + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + + String + + String + + + None + + + Raw + + Returns the raw response. This is required when you need to use the object to send back. Without this switch the object produced from the returned object will not match the expected shape of the JSON for sending back to server. + + + SwitchParameter + + + False + + + + + + ProjectName + + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + + String + + String + + + None + + + Expand + + Specifies which property should be expanded in the list of Release Definition (environments, artifacts, none). + + String + + String + + + None + + + Id + + Specifies one or more release definitions by ID. + To specify multiple IDs, use commas to separate the IDs. + To find the ID of a release definition, type Get-VSTeamReleaseDefinition. + + Int32[] + + Int32[] + + + None + + + JSON + + Converts the raw response into JSON and displays in the console. This is required when you need to use the object to send back. Without this switch the JSON produced from the returned object will not match the expected shape of the JSON for sending back to server. + + SwitchParameter + + SwitchParameter + + + False + + + Raw + + Returns the raw response. This is required when you need to use the object to send back. Without this switch the object produced from the returned object will not match the expected shape of the JSON for sending back to server. + + SwitchParameter + + SwitchParameter + + + False + + + + + + Int[] + + + + + + + + + + Team.ReleaseDefinition + + + + + + + + + + + + + + -------------------------- EXAMPLE 1 -------------------------- + PS C:\> Get-VSTeamReleaseDefinition -ProjectName demo | Format-List * + + This command gets a list of all release definitions in the demo project. + The pipeline operator (|) passes the data to the Format-List cmdlet, which displays all available properties (*) of the release definition objects. + + + + -------------------------- EXAMPLE 2 -------------------------- + PS C:\> Get-VSTeamReleaseDefinition -ProjectName Demo -id 2 -Json + + This command returns the raw object returned from the server formatted as a JSON string. + + + + -------------------------- EXAMPLE 3 -------------------------- + PS C:\> Get-VSTeamReleaseDefinition -ProjectName Demo -id 2 -Raw + + This command returns the raw object returned from the server. + + + + + + Set-VSTeamAccount + + + + Set-VSTeamDefaultProject + + + + Add-VSTeamReleaseDefinition + + + + Remove-VSTeamReleaseDefinition + + + + + + + Get-VSTeamResourceArea + Get + VSTeamResourceArea + + List all the areas supported by this instance of TFS/VSTS. + + + + List all the areas supported by this instance of TFS/VSTS. + + + + Get-VSTeamResourceArea + + + + + + + + + + + + + -------------------------- EXAMPLE 1 -------------------------- + PS C:\> Get-VSTeamResourceArea + + This will display all the areas of supported APIs for your account. + + + + + + Set-VSTeamAccount + + + + Add-VSTeamOption + + + + + + + Get-VSTeamSecurityNamespace + Get + VSTeamSecurityNamespace + + List all security namespaces or just the specified namespace. + + + + List all security namespaces or just the specified namespace. + + + + Get-VSTeamSecurityNamespace + + Id + + Security namespace identifier. + + String + + String + + + None + + + + Get-VSTeamSecurityNamespace + + Name + + Security namespace name. + + String + + String + + + None + + + + Get-VSTeamSecurityNamespace + + LocalOnly + + If true, retrieve only local security namespaces. + + + SwitchParameter + + + False + + + + + + Id + + Security namespace identifier. + + String + + String + + + None + + + Name + + Security namespace name. + + String + + String + + + None + + + LocalOnly + + If true, retrieve only local security namespaces. + + SwitchParameter + + SwitchParameter + + + False + + + + + + + VSTeamSecurityNamespace + + + + + + + + + + + + + + + + + Get-VSTeamServiceEndpoint + Get + VSTeamServiceEndpoint + + Gets a service endpoint. + + + + Gets a service endpoint. + + + + Get-VSTeamServiceEndpoint + + ProjectName + + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + + String + + String + + + None + + + Id + + Id of the service endpoint + + String + + String + + + None + + + + + + ProjectName + + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + + String + + String + + + None + + + Id + + Id of the service endpoint + + String + + String + + + None + + + + + + System.String + + + + + + + + + + System.Object + + + + + + + + + + + + + + + + + Get-VSTeamServiceEndpointType + Get + VSTeamServiceEndpointType + + Get service endpoint types. + + + + Get service endpoint types. + + + + Get-VSTeamServiceEndpointType + + Type + + Name of service endpoint type to return. + + String + + String + + + None + + + Scheme + + Scheme of service endpoint + + String + + String + + + None + + + + + + Type + + Name of service endpoint type to return. + + String + + String + + + None + + + Scheme + + Scheme of service endpoint + + String + + String + + + None + + + + + + System.String + + + + + + + + + + System.Object + + + + + + + + + + + + + + + + + Get-VSTeamTaskGroup + Get + VSTeamTaskGroup + + Gets a task group + + + + Gets a task group + + + + Get-VSTeamTaskGroup + + ProjectName + + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + + String + + String + + + None + + + Id + + ID of the existing task group + + String + + String + + + None + + + + Get-VSTeamTaskGroup + + ProjectName + + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + + String + + String + + + None + + + Name + + Name of the existing task group + + String + + String + + + None + + + + + + ProjectName + + + + + + + + + None + + + ProjectName + + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + + String + + String + + + None + + + Id + + ID of the existing task group + + String + + String + + + None + + + Name + + Name of the existing task group + + String + + String + + + None + + + + + + System.String + + + + + + + + + + System.Object + + + + + + + + + + + + + + -------------------------- EXAMPLE 1 -------------------------- + $methodParameters = @{ + ProjectName = "some_project_name" +} + +Get-VSTeamTaskGroup @methodParameters + + Get all the task groups for the some_project_name project. Here we are splatting the parameter, but it may also be directly specified. See a non-splatting example below. + + + + -------------------------- EXAMPLE 2 -------------------------- + Get-VSTeamTaskGroup -ProjectName "some_project_name" -Id "Task_group_id" + + Get a task group when the ID is already known. + + + + -------------------------- EXAMPLE 3 -------------------------- + $methodParameters = @{ + ProjectName = "some_project_name" + Name = "Task_group_name" +} + +Get-VSTeamTaskGroup @methodParameters + + Get a task group by name, when the ID is not known. Here we are splatting the parameters, but they may also be directly specified. Getting by ID is preferred, as it's more efficient; but getting by name is, of course, handy. + + + + + + Add-VSTeamTaskGroup + + + + Update-VSTeamTaskGroup + + + + Remove-VSTeamTaskGroup + + + + + + + Get-VSTeamTfvcBranch + Get + VSTeamTfvcBranch + + Gets a branch for a given path from TFVC source control. + + + + Get-VSTeamTfvcBranch gets a branch for a given path from TFVC source control. + + + + Get-VSTeamTfvcBranch + + Path + + Full path to the branch. + + String[] + + String[] + + + None + + + IncludeChildren + + Return child branches, if there are any. + + + SwitchParameter + + + False + + + IncludeParent + + Return the parent branch, if there is one. + + + SwitchParameter + + + False + + + IncludeDeleted + + Return branches marked as deleted. + + + SwitchParameter + + + False + + + + + + Path + + Full path to the branch. + + String[] + + String[] + + + None + + + IncludeChildren + + Return child branches, if there are any. + + SwitchParameter + + SwitchParameter + + + False + + + IncludeParent + + Return the parent branch, if there is one. + + SwitchParameter + + SwitchParameter + + + False + + + IncludeDeleted + + Return branches marked as deleted. + + SwitchParameter + + SwitchParameter + + + False + + + + + + + You can pipe paths to this function. + + + + + -------------------------- EXAMPLE 1 -------------------------- + PS C:\> Get-VSTeamTfvcBranch -Path $/MyProject/MyBranch + + This command returns the branch object for the path $/MyProject/MyBranch + + + + -------------------------- EXAMPLE 2 -------------------------- + PS C:\> Get-VSTeamTfvcBranch -Path $/MyProject/MyBranch -IncludeChildren + + This command returns the branch object for the path $/MyProject/MyBranch and its child branches. + + + + -------------------------- EXAMPLE 3 -------------------------- + PS C:\> Get-VSTeamTfvcBranch -Path $/MyProject/MyBranch -IncludeParent + + This command returns the branch object for the path $/MyProject/MyBranch and its parent. + + + + -------------------------- EXAMPLE 4 -------------------------- + PS C:\> Get-VSTeamTfvcBranch -Path $/MyProject/MyBranch -IncludeDeleted + + This command returns the branch object for the path $/MyProject/MyBranch, even if it's marked as deleted. + + + + -------------------------- EXAMPLE 5 -------------------------- + PS C:\> '$/MyProject/MyBranch','$/AnotherProject/AnotherBranch' | Get-VSTeamTfvcBranch + + This command returns the branch objects for the paths $/MyProject/MyBranch and $/AnotherProject/AnotherBranch by using the pipeline. + + + + + + + + Get-VSTeamTfvcRootBranch + Get + VSTeamTfvcRootBranch + + Gets root branches for all projects with TFVC source control. + + + + Get-VSTeamTfvcRootBranch gets root branches for all projects with TFVC source control. + + + + Get-VSTeamTfvcRootBranch + + IncludeChildren + + Return the child branches for each root branch. + + + SwitchParameter + + + False + + + IncludeDeleted + + Return deleted branches. + + + SwitchParameter + + + False + + + + + + IncludeChildren + + Return the child branches for each root branch. + + SwitchParameter + + SwitchParameter + + + False + + + IncludeDeleted + + Return deleted branches. + + SwitchParameter + + SwitchParameter + + + False + + + + + + + + + + + + -------------------------- EXAMPLE 1 -------------------------- + PS C:\> Get-VSTeamTfvcRootBranch + + This command returns root branches for all projects. + + + + -------------------------- EXAMPLE 2 -------------------------- + PS C:\> Get-VSTeamTfvcRootBranch -IncludeChildren + + This command returns root branches for all projects and their respective child branches. + + + + -------------------------- EXAMPLE 3 -------------------------- + PS C:\> Get-VSTeamTfvcRootBranch -IncludeDeleted + + This command returns root branches for all projects, also those marked as deleted. + + + + + + + + Get-VSTeamUser + Get + VSTeamUser + + Returns a list of users for the account. + + + + Returns a list of users for the account. + + + + Get-VSTeamUser + + SubjectTypes + + A comma separated list of user subject subtypes to reduce the retrieved results. Valid subject types: + - vss (Azure DevOps User) + - aad (Azure Active Directory User) + - svc (Azure DevOps Service Identity) + - imp (Imported Identity) + - msa (Microsoft Account) + + String[] + + String[] + + + None + + + + Get-VSTeamUser + + Descriptor + + The descriptor of the desired graph user. + + String + + String + + + None + + + + + + SubjectTypes + + A comma separated list of user subject subtypes to reduce the retrieved results. Valid subject types: + - vss (Azure DevOps User) + - aad (Azure Active Directory User) + - svc (Azure DevOps Service Identity) + - imp (Imported Identity) + - msa (Microsoft Account) + + String[] + + String[] + + + None + + + Descriptor + + The descriptor of the desired graph user. + + String + + String + + + None + + + + + + + + + + + + + + + Get-VSTeamUserEntitlement + Get + VSTeamUserEntitlement + + Get User Entitlement for a user. + + + + Get User Entitlement for a user. + + + + Get-VSTeamUserEntitlement + + Skip + + The number of items to skip. + + Int32 + + Int32 + + + None + + + Top + + Specifies the maximum number to return. + + Int32 + + Int32 + + + None + + + Select + + Comma (",") separated list of properties to select in the result entitlements. The acceptable values for this parameter are: + - Projects + - Extensions + - GroupRules + + String + + String + + + None + + + + Get-VSTeamUserEntitlement + + UserId + + The id of the user to retrieve. + + String[] + + String[] + + + None + + + + + + Skip + + The number of items to skip. + + Int32 + + Int32 + + + None + + + UserId + + The id of the user to retrieve. + + String[] + + String[] + + + None + + + Top + + Specifies the maximum number to return. + + Int32 + + Int32 + + + None + + + Select + + Comma (",") separated list of properties to select in the result entitlements. The acceptable values for this parameter are: + - Projects + - Extensions + - GroupRules + + String + + String + + + None + + + + + + + + + + + + + + + Get-VSTeamVariableGroup + Get + VSTeamVariableGroup + + Gets a variable group + + + + Gets a variable group + + + + Get-VSTeamVariableGroup + + ProjectName + + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + + String + + String + + + None + + + Name + + Name of the existing variable group + + String + + String + + + None + + + + + + ProjectName + + + + + + + + + None + + + ProjectName + + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + + String + + String + + + None + + + Id + + ID of the existing variable group + + + + + + + None + + + Name + + Name of the existing variable group + + String + + String + + + None + + + + + + System.String + + + + + + + + + + System.Object + + + + + + + + + + + + + + -------------------------- EXAMPLE 1 -------------------------- + $methodParameters = @{ + ProjectName = "some_project_name" +} + +Get-VSTeamVariableGroup @methodParameters + + + + + + -------------------------- EXAMPLE 2 -------------------------- + $methodParameters = @{ + ProjectName = "some_project_name" + Id = "variable_group_id" +} + +Get-VSTeamVariableGroup @methodParameters + + + + + + -------------------------- EXAMPLE 3 -------------------------- + $methodParameters = @{ + ProjectName = "some_project_name" + Name = "variable_group_name" +} + +Get-VSTeamVariableGroup @methodParameters + + + + + + + + Add-VSTeamVariableGroup + + + + Update-VSTeamVariableGroup + + + + Remove-VSTeamVariableGroup + + + + + + + Get-VSTeamWiqlItem + Get + VSTeamWiqlItem + + Returns work items from the given WIQL query or a saved query by ID from your projects team. + + + + Returns work items from the given WIQL query or a saved query by ID from your projects team. + + + + Get-VSTeamWiqlItem + + Id + + The id query to return work items for. This is the ID of any saved query within a team in a project + + Int32 + + Int32 + + + None + + + Top + + The max number of results to return. + + String + + String + + + 100 + + + TimePrecision + + Whether or not to use time precision. + + + SwitchParameter + + + False + + + Expand + + The expand the work items with the selected attributes in the WIQL query. + + + SwitchParameter + + + False + + + + Get-VSTeamWiqlItem + + Query + + The WIQL query. For the syntax check the official documentation (https://docs.microsoft.com/en-us/azure/devops/boards/queries/wiql-syntax?view=azure-devops). + + String + + String + + + None + + + Top + + The max number of results to return. + + String + + String + + + 100 + + + TimePrecision + + Whether or not to use time precision. + + + SwitchParameter + + + False + + + Expand + + The expand the work items with the selected attributes in the WIQL query. + + + SwitchParameter + + + False + + + + + + Id + + The id query to return work items for. This is the ID of any saved query within a team in a project + + Int32 + + Int32 + + + None + + + Query + + The WIQL query. For the syntax check the official documentation (https://docs.microsoft.com/en-us/azure/devops/boards/queries/wiql-syntax?view=azure-devops). + + String + + String + + + None + + + Top + + The max number of results to return. + + String + + String + + + 100 + + + TimePrecision + + Whether or not to use time precision. + + SwitchParameter + + SwitchParameter + + + False + + + Expand + + The expand the work items with the selected attributes in the WIQL query. + + SwitchParameter + + SwitchParameter + + + False + + + + + + System.String + + + ProjectName + + + + + + + If you do not set the default project by called Set-VSTeamDefaultProject before calling Get-VSTeamWiql you will have to type in the names. + + + + + -------------------------- EXAMPLE 1 -------------------------- + PS C:\> Get-VSTeamWiql -Query "Select [System.Id], [System.Title], [System.State] From WorkItems" -Team "MyProject Team" -Project "MyProject" -Expand + + This command gets work items via a WIQL query and expands the return work items with only the selected fields System.Id, System.Title and System.State. + + + + -------------------------- EXAMPLE 2 -------------------------- + PS C:\> Get-VSTeamWiql -Query "Select [System.Id], [System.Title], [System.State] From WorkItems" -Team "MyProject Team" -Project "MyProject" + + This command gets work items via a WIQL query and returns the WIQL query result with only work item IDs. + + + + + + + + Get-VSTeamWorkItem + Get + VSTeamWorkItem + + Returns one or more a work items from your project. + + + + Returns one or more a work items from your project. + + + + Get-VSTeamWorkItem + + Id + + The id of one or more work items. + + Int32[] + + Int32[] + + + None + + + ErrorPolicy + + The flag to control error policy in a bulk get work items request. The acceptable values for this parameter are: + - Fail + - Omit + + String + + String + + + omit + + + Fields + + Comma-separated list of requested fields. + + String[] + + String[] + + + None + + + Expand + + Comma-separated list of requested fields. The acceptable values for this parameter are: + - None + - Relations + - Fields + - Links + - All + + String + + String + + + None + + + AsOf + + + + DateTime + + DateTime + + + None + + + + + + Id + + The id of one or more work items. + + Int32[] + + Int32[] + + + None + + + ErrorPolicy + + The flag to control error policy in a bulk get work items request. The acceptable values for this parameter are: + - Fail + - Omit + + String + + String + + + omit + + + Fields + + Comma-separated list of requested fields. + + String[] + + String[] + + + None + + + Expand + + Comma-separated list of requested fields. The acceptable values for this parameter are: + - None + - Relations + - Fields + - Links + - All + + String + + String + + + None + + + AsOf + + + + DateTime + + DateTime + + + None + + + + + + System.String + + + ProjectName + WorkItemType + + + + + + + WorkItemType is a dynamic parameter and use the default project value to query their validate set. + If you do not set the default project by called Set-VSTeamDefaultProject before calling Get-VSTeamWorkItem you will have to type in the names. + + + + + -------------------------- EXAMPLE 1 -------------------------- + PS C:\> Get-VSTeamWorkItem -Id 47,48 + + This command gets work items with IDs 47 and 48 by using the IDs parameter. + + + + + + + + Get-VSTeamWorkItemType + Get + VSTeamWorkItemType + + Gets a list of all Work Item Types or a single work item type. + + + + Gets a list of all Work Item Types or a single work item type. + + + + Get-VSTeamWorkItemType + + ProjectName + + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + + String + + String + + + None + + + WorkItemType + + The type of work item to retrieve. + + String + + String + + + None + + + + + + ProjectName + + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + + String + + String + + + None + + + WorkItemType + + The type of work item to retrieve. + + String + + String + + + None + + + + + + System.String + + + + + + + + + + System.Object + + + + + + + + + The JSON returned has empty named items i.e. "": "To Do" This causes issues with the ConvertFrom-Json CmdLet. Therefore, all "": are replaced with "_end": + + + + + -------------------------- EXAMPLE 1 -------------------------- + PS R:\repos\vsteam> Get-WorkItemType -ProjectName test -WorkItemType 'Code Review Response' + + This command gets a single work item type. + + + + + + Set-VSTeamAccount + + + + + + + Invoke-VSTeamRequest + Invoke + VSTeamRequest + + Allows you to call any TFS/AzD REST API. All the Auth and Route Structure is taken care of for you. Just provide the parts of the API call you need. If you need to send a non-standard URL use the -Url parameter. If the -Url is used the Url is not changed but the header and UserAgent are added for you. + + + + Invoke-VSTeamRequest allows you to call a TFS/AzD REST API much easier than using Invoke-WebRequest directly. The shape of the URI and authentication is all handled for you. + + + + Invoke-VSTeamRequest + + ProjectName + + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + + String + + String + + + None + + + ContentType + + Specifies the content type of the request. + If this parameter is omitted and the request method is POST, the content type will be set to application/json. + Otherwise, the content type is not specified in the call. + + String + + String + + + application/json + + + Method + + Specifies the method used for the request. The acceptable values for this parameter are: + - Get + - Post + - Patch + - Delete + - Options + - Put + - Default + - Trace + - Head + - Merge + + String + + String + + + Get + + + Body + + Specifies the body of the request. The body is the content of the request that follows the headers. You can also pipe a body value to Invoke-VSTeamRequest. + The Body parameter can be used to specify a list of query parameters or specify the content of the response. + When the input is a GET request and the body is an IDictionary (typically, a hash table), the body is added to the URI as query parameters. For other GET requests, the body is set as the value of the request body in the standard name=value format. + + Object + + Object + + + None + + + InFile + + Path and file name to the file that contains the contents of the request. If the path is omitted, the default is the current location. + + String + + String + + + None + + + OutFile + + Specifies the output file for which this function saves the response body. Enter a path and file name. If you omit the path, the default is the current location. + + String + + String + + + None + + + Area + + The area to find the resource. + + String + + String + + + None + + + Resource + + The name of the feature you want to manipulate. + + String + + String + + + None + + + Id + + The unique value of the item you want to work with. + + String + + String + + + None + + + Version + + The version of the API you wish to target. + + String + + String + + + None + + + SubDomain + + The SubDomain before .dev.azure.com. For example, to target Release Management you must use the SubDomain vsrm. + + String + + String + + + None + + + JSON + + Converts the PowerShell object into JSON and displays in the console. + + + SwitchParameter + + + False + + + AdditionalHeaders + + Adds additional headers to the request + + Hashtable + + Hashtable + + + None + + + + + + ProjectName + + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + + String + + String + + + None + + + ContentType + + Specifies the content type of the request. + If this parameter is omitted and the request method is POST, the content type will be set to application/json. + Otherwise, the content type is not specified in the call. + + String + + String + + + application/json + + + Method + + Specifies the method used for the request. The acceptable values for this parameter are: + - Get + - Post + - Patch + - Delete + - Options + - Put + - Default + - Trace + - Head + - Merge + + String + + String + + + Get + + + Body + + Specifies the body of the request. The body is the content of the request that follows the headers. You can also pipe a body value to Invoke-VSTeamRequest. + The Body parameter can be used to specify a list of query parameters or specify the content of the response. + When the input is a GET request and the body is an IDictionary (typically, a hash table), the body is added to the URI as query parameters. For other GET requests, the body is set as the value of the request body in the standard name=value format. + + Object + + Object + + + None + + + InFile + + Path and file name to the file that contains the contents of the request. If the path is omitted, the default is the current location. + + String + + String + + + None + + + OutFile + + Specifies the output file for which this function saves the response body. Enter a path and file name. If you omit the path, the default is the current location. + + String + + String + + + None + + + Area + + The area to find the resource. + + String + + String + + + None + + + Resource + + The name of the feature you want to manipulate. + + String + + String + + + None + + + Id + + The unique value of the item you want to work with. + + String + + String + + + None + + + Version + + The version of the API you wish to target. + + String + + String + + + None + + + SubDomain + + The SubDomain before .dev.azure.com. For example, to target Release Management you must use the SubDomain vsrm. + + String + + String + + + None + + + JSON + + Converts the PowerShell object into JSON and displays in the console. + + SwitchParameter + + SwitchParameter + + + False + + + AdditionalHeaders + + Adds additional headers to the request + + Hashtable + + Hashtable + + + None + + + + + + System.String + + + + + + + + + + System.Object + + + + + + + + + + + + + + -------------------------- EXAMPLE 1 -------------------------- + PS C:\> Invoke-VSTeamRequest -resource projectHistory -version '4.1-preview' -Verbose + + This command will return the project history. + + + + -------------------------- EXAMPLE 2 -------------------------- + PS C:\> ivr -area release -resource releases -version '4.1-preview' -subDomain vsrm -Verbose + + This command will return the releases for a project. + + + + + + + + Remove-VSTeam + Remove + VSTeam + + Removes a team from a project. + + + + Removes a team from a project. + + + + Remove-VSTeam + + ProjectName + + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + + String + + String + + + None + + + TeamId + + The id of the team to remove. + + String + + String + + + None + + + Confirm + + Prompts you for confirmation before running the function. + + + SwitchParameter + + + False + + + Force + + Forces the function without confirmation + + + SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the function runs. The function is not run. + + + SwitchParameter + + + False + + + + + + ProjectName + + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + + String + + String + + + None + + + TeamId + + The id of the team to remove. + + String + + String + + + None + + + Confirm + + Prompts you for confirmation before running the function. + + SwitchParameter + + SwitchParameter + + + False + + + Force + + Forces the function without confirmation + + SwitchParameter + + SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the function runs. The function is not run. + + SwitchParameter + + SwitchParameter + + + False + + + + + + + + + + + + + + + Remove-VSTeamAccessControlEntry + Remove + VSTeamAccessControlEntry + + Removes specified ACEs in the ACL for the provided token. The request URI contains the namespace ID, the target token, and a single or list of descriptors that should be removed. Only supports removing AzD based users/groups. + + + + Removes specified ACEs in the ACL for the provided token. The request URI contains the namespace ID, the target token, and a single or list of descriptors that should be removed. Only supports removing AzD based users/groups. + + + + Remove-VSTeamAccessControlEntry + + SecurityNamespace + + VSTeamSecurityNamespace object. + + VSTeamSecurityNamespace + + VSTeamSecurityNamespace + + + None + + + SecurityNamespaceId + + Security namespace identifier. + Valid IDs are: + AzD: - Analytics (58450c49-b02d-465a-ab12-59ae512d6531) + - AnalyticsViews (d34d3680-dfe5-4cc6-a949-7d9c68f73cba) + - ReleaseManagement (7c7d32f7-0e86-4cd6-892e-b35dbba870bd) + - ReleaseManagement2 (c788c23e-1b46-4162-8f5e-d7585343b5de) + - Identity (5a27515b-ccd7-42c9-84f1-54c998f03866) + - WorkItemTrackingAdministration (445d2788-c5fb-4132-bbef-09c4045ad93f) + - DistributedTask (101eae8c-1709-47f9-b228-0e476c35b3ba) + - WorkItemQueryFolders (71356614-aad7-4757-8f2c-0fb3bff6f680) + - GitRepositories (2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87) + - VersionControlItems2 (3c15a8b7-af1a-45c2-aa97-2cb97078332e) + - EventSubscriber (2bf24a2b-70ba-43d3-ad97-3d9e1f75622f) + - WorkItemTrackingProvision (5a6cd233-6615-414d-9393-48dbb252bd23) + - ServiceEndpoints (49b48001-ca20-4adc-8111-5b60c903a50c) + - ServiceHooks (cb594ebe-87dd-4fc9-ac2c-6a10a4c92046) + - Chat (bc295513-b1a2-4663-8d1a-7017fd760d18) + - Collection (3e65f728-f8bc-4ecd-8764-7e378b19bfa7) + - Proxy (cb4d56d2-e84b-457e-8845-81320a133fbb) + - Plan (bed337f8-e5f3-4fb9-80da-81e17d06e7a8) + - Process (2dab47f9-bd70-49ed-9bd5-8eb051e59c02) + - AccountAdminSecurity (11238e09-49f2-40c7-94d0-8f0307204ce4) + - Library (b7e84409-6553-448a-bbb2-af228e07cbeb) + - Environment (83d4c2e6-e57d-4d6e-892b-b87222b7ad20) + - Project (52d39943-cb85-4d7f-8fa8-c6baac873819) + - EventSubscription (58b176e7-3411-457a-89d0-c6d0ccb3c52b) + - CSS (83e28ad4-2d72-4ceb-97b0-c7726d5502c3) + - TeamLabSecurity (9e4894c3-ff9a-4eac-8a85-ce11cafdc6f1) + - ProjectAnalysisLanguageMetrics (fc5b7b85-5d6b-41eb-8534-e128cb10eb67) + - Tagging (bb50f182-8e5e-40b8-bc21-e8752a1e7ae2) + - MetaTask (f6a4de49-dbe2-4704-86dc-f8ec1a294436) + - Iteration (bf7bfa03-b2b7-47db-8113-fa2e002cc5b1) + - Favorites (fa557b48-b5bf-458a-bb2b-1b680426fe8b) + - Registry (4ae0db5d-8437-4ee8-a18b-1f6fb38bd34c) + - Graph (c2ee56c9-e8fa-4cdd-9d48-2c44f697a58e) + - ViewActivityPaneSecurity (dc02bf3d-cd48-46c3-8a41-345094ecc94b) + - Job (2a887f97-db68-4b7c-9ae3-5cebd7add999) + - WorkItemTracking (73e71c45-d483-40d5-bdba-62fd076f7f87) + - StrongBox (4a9e8381-289a-4dfd-8460-69028eaa93b3) + - Server (1f4179b3-6bac-4d01-b421-71ea09171400) + - TestManagement (e06e1c24-e93d-4e4a-908a-7d951187b483) + - SettingEntries (6ec4592e-048c-434e-8e6c-8671753a8418) + - BuildAdministration (302acaca-b667-436d-a946-87133492041c) + - Location (2725d2bc-7520-4af4-b0e3-8d876494731f) + - Boards (251e12d9-bea3-43a8-bfdb-901b98c0125e) + - UtilizationPermissions (83abde3a-4593-424e-b45f-9898af99034d) + - WorkItemsHub (c0e7a722-1cad-4ae6-b340-a8467501e7ce) + - WebPlatform (0582eb05-c896-449a-b933-aa3d99e121d6) + - VersionControlPrivileges (66312704-deb5-43f9-b51c-ab4ff5e351c3) + - Workspaces (93bafc04-9075-403a-9367-b7164eac6b5c) + - CrossProjectWidgetView (093cbb02-722b-4ad6-9f88-bc452043fa63) + - WorkItemTrackingConfiguration (35e35e8e-686d-4b01-aff6-c369d6e36ce0) + - Discussion Threads (0d140cae-8ac1-4f48-b6d1-c93ce0301a12) + - BoardsExternalIntegration (5ab15bc8-4ea1-d0f3-8344-cab8fe976877) + - DataProvider (7ffa7cf4-317c-4fea-8f1d-cfda50cfa956) + - Social (81c27cc8-7a9f-48ee-b63f-df1e1d0412dd) + - Security (9a82c708-bfbe-4f31-984c-e860c2196781) + - IdentityPicker (a60e0d84-c2f8-48e4-9c0c-f32da48d5fd1) + - ServicingOrchestration (84cc1aa4-15bc-423d-90d9-f97c450fc729) + - Build (33344d9c-fc72-4d6f-aba5-fa317101a7e9) + - DashboardsPrivileges (8adf73b7-389a-4276-b638-fe1653f7efc7) + - VersionControlItems (a39371cf-0841-4c16-bbd3-276e341bc052) + + VSSPS: - EventSubscriber (2bf24a2b-70ba-43d3-ad97-3d9e1f75622f) (VSSPS) + - EventSubscription (58b176e7-3411-457a-89d0-c6d0ccb3c52b) (VSSPS) + - Registry (4ae0db5d-8437-4ee8-a18b-1f6fb38bd34c) (VSSPS) + - Graph (c2ee56c9-e8fa-4cdd-9d48-2c44f697a58e) (VSSPS) + - Invitation (ea0b4d1e-577a-4797-97b5-2f5755e548d5) (VSSPS) + - SystemGraph (b24dfdf1-285a-4ea6-a55b-32549a68121d) (VSSPS) + - Job (2a887f97-db68-4b7c-9ae3-5cebd7add999) (VSSPS) + - CommerceCollectionSecurity (307be2d3-12ed-45c2-aacf-6598760efca7) (VSSPS) + - StrongBox (4a9e8381-289a-4dfd-8460-69028eaa93b3) (VSSPS) + - GroupLicensing (c6a4fd35-b508-49eb-8ea7-7189df5f3698) (VSSPS) + - Server (1f4179b3-6bac-4d01-b421-71ea09171400) (VSSPS) + - SettingEntries (6ec4592e-048c-434e-8e6c-8671753a8418) (VSSPS) + - RemotableTemplateTest (ccdcb71c-4780-4a42-9bb4-8bce07a7628f) (VSSPS) + - Location (2725d2bc-7520-4af4-b0e3-8d876494731f) (VSSPS) + - WebPlatform (0582eb05-c896-449a-b933-aa3d99e121d6) (VSSPS) + - DataProvider (7ffa7cf4-317c-4fea-8f1d-cfda50cfa956) (VSSPS) + - Security (9a82c708-bfbe-4f31-984c-e860c2196781) (VSSPS) + - IdentityPicker (a60e0d84-c2f8-48e4-9c0c-f32da48d5fd1) (VSSPS) + - ServicingOrchestration (84cc1aa4-15bc-423d-90d9-f97c450fc729) (VSSPS) + + String + + String + + + None + + + Token + + The security Token + Valid token formats are: + - Git Repository (repov2/$projectID/$repositoryID) + - Build Definition ($projectID/$buildDefinitionID) + - Release Definition ($projectID/$releaseDefinitionID, $projectID/Path/to/Release/$releaseDefinitionID) + + String + + String + + + None + + + Descriptor + + An array of descriptors of users/groups to be removed + + System.Array + + System.Array + + + None + + + + + + SecurityNamespace + + VSTeamSecurityNamespace object. + + VSTeamSecurityNamespace + + VSTeamSecurityNamespace + + + None + + + SecurityNamespaceId + + Security namespace identifier. + Valid IDs are: + AzD: - Analytics (58450c49-b02d-465a-ab12-59ae512d6531) + - AnalyticsViews (d34d3680-dfe5-4cc6-a949-7d9c68f73cba) + - ReleaseManagement (7c7d32f7-0e86-4cd6-892e-b35dbba870bd) + - ReleaseManagement2 (c788c23e-1b46-4162-8f5e-d7585343b5de) + - Identity (5a27515b-ccd7-42c9-84f1-54c998f03866) + - WorkItemTrackingAdministration (445d2788-c5fb-4132-bbef-09c4045ad93f) + - DistributedTask (101eae8c-1709-47f9-b228-0e476c35b3ba) + - WorkItemQueryFolders (71356614-aad7-4757-8f2c-0fb3bff6f680) + - GitRepositories (2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87) + - VersionControlItems2 (3c15a8b7-af1a-45c2-aa97-2cb97078332e) + - EventSubscriber (2bf24a2b-70ba-43d3-ad97-3d9e1f75622f) + - WorkItemTrackingProvision (5a6cd233-6615-414d-9393-48dbb252bd23) + - ServiceEndpoints (49b48001-ca20-4adc-8111-5b60c903a50c) + - ServiceHooks (cb594ebe-87dd-4fc9-ac2c-6a10a4c92046) + - Chat (bc295513-b1a2-4663-8d1a-7017fd760d18) + - Collection (3e65f728-f8bc-4ecd-8764-7e378b19bfa7) + - Proxy (cb4d56d2-e84b-457e-8845-81320a133fbb) + - Plan (bed337f8-e5f3-4fb9-80da-81e17d06e7a8) + - Process (2dab47f9-bd70-49ed-9bd5-8eb051e59c02) + - AccountAdminSecurity (11238e09-49f2-40c7-94d0-8f0307204ce4) + - Library (b7e84409-6553-448a-bbb2-af228e07cbeb) + - Environment (83d4c2e6-e57d-4d6e-892b-b87222b7ad20) + - Project (52d39943-cb85-4d7f-8fa8-c6baac873819) + - EventSubscription (58b176e7-3411-457a-89d0-c6d0ccb3c52b) + - CSS (83e28ad4-2d72-4ceb-97b0-c7726d5502c3) + - TeamLabSecurity (9e4894c3-ff9a-4eac-8a85-ce11cafdc6f1) - ProjectAnalysisLanguageMetrics (fc5b7b85-5d6b-41eb-8534-e128cb10eb67) - Tagging (bb50f182-8e5e-40b8-bc21-e8752a1e7ae2) - MetaTask (f6a4de49-dbe2-4704-86dc-f8ec1a294436) @@ -17903,29 +20749,168 @@ PS C:\> Remove-VSTeamMembership -MemberDescriptor $user.Descriptor -Container - + + + + + + -------------------------- EXAMPLE 1 -------------------------- + PS C:\> Remove-VSTeamProject 'MyProject' + + You will be prompted for confirmation and the project will be deleted. + + + + -------------------------- EXAMPLE 2 -------------------------- + PS C:\> Remove-VSTeamProject 'MyProject' -Force + + You will NOT be prompted for confirmation and the project will be deleted. + + + + -------------------------- EXAMPLE 3 -------------------------- + PS C:\> Get-VSTeamProject | Remove-VSTeamProject -Force + + This will remove all projects + + + + + + Set-VSTeamAccount + + + + Add-VSTeamProject + + + + + + + Remove-VSTeamRelease + Remove + VSTeamRelease + + Removes the releases for a team project. + + + + The Remove-VSTeamRelease function removes the releases for a team project. + The project name is a Dynamic Parameter which may not be displayed in the syntax above but is mandatory. + + + + Remove-VSTeamRelease + + ProjectName + + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + + String + + String + + + None + + + Id + + Specifies one or more releases by ID. + To specify multiple IDs, use commas to separate the IDs. + To find the ID of a release definition, type Get-VSTeamRelease. + + Int32[] + + Int32[] + + + None + + + Force + + Forces the function without confirmation + + + SwitchParameter + + + False + + + + + + ProjectName + + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + + String + + String + + + None + + + Id + + Specifies one or more releases by ID. + To specify multiple IDs, use commas to separate the IDs. + To find the ID of a release definition, type Get-VSTeamRelease. + + Int32[] + + Int32[] + + + None + + + Force + + Forces the function without confirmation + + SwitchParameter + + SwitchParameter + + + False + + + + + + + None + + + + + + + + + This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets releases. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + You can pipe release definition IDs to this function. -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Remove-VSTeamProject 'MyProject' - - You will be prompted for confirmation and the project will be deleted. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Remove-VSTeamProject 'MyProject' -Force - - You will NOT be prompted for confirmation and the project will be deleted. - - - - -------------------------- EXAMPLE 3 -------------------------- - PS C:\> Get-VSTeamProject | Remove-VSTeamProject -Force + PS C:\> Get-VSTeamRelease -ProjectName demo | Remove-VSTeamRelease - This will remove all projects + This command gets a list of all releases in the demo project. + The pipeline operator (|) passes the data to the Remove-VSTeamRelease function, which removes each release definition object. @@ -17935,27 +20920,35 @@ PS C:\> Remove-VSTeamMembership -MemberDescriptor $user.Descriptor -Container - Add-VSTeamProject + Set-VSTeamDefaultProject + + + + Add-VSTeamRelease + + + + Get-VSTeamRelease - Remove-VSTeamRelease + Remove-VSTeamReleaseDefinition Remove - VSTeamRelease + VSTeamReleaseDefinition - Removes the releases for a team project. + Removes the release definitions for a team project. - The Remove-VSTeamRelease function removes the releases for a team project. + The Remove-VSTeamReleaseDefinition function removes the release definitions for a team project. The project name is a Dynamic Parameter which may not be displayed in the syntax above but is mandatory. - Remove-VSTeamRelease + Remove-VSTeamReleaseDefinition ProjectName @@ -17973,9 +20966,9 @@ PS C:\> Remove-VSTeamMembership -MemberDescriptor $user.Descriptor -Container Id - Specifies one or more releases by ID. + Specifies one or more release definitions by ID. To specify multiple IDs, use commas to separate the IDs. - To find the ID of a release definition, type Get-VSTeamRelease. + To find the ID of a release definition, type Get-VSTeamReleaseDefinition. Int32[] @@ -18015,9 +21008,9 @@ PS C:\> Remove-VSTeamMembership -MemberDescriptor $user.Descriptor -Container Id - Specifies one or more releases by ID. + Specifies one or more release definitions by ID. To specify multiple IDs, use commas to separate the IDs. - To find the ID of a release definition, type Get-VSTeamRelease. + To find the ID of a release definition, type Get-VSTeamReleaseDefinition. Int32[] @@ -18052,7 +21045,7 @@ PS C:\> Remove-VSTeamMembership -MemberDescriptor $user.Descriptor -Container - This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets releases. + This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets release definitions. You can tab complete from a list of available projects. You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. You can pipe release definition IDs to this function. @@ -18061,10 +21054,10 @@ PS C:\> Remove-VSTeamMembership -MemberDescriptor $user.Descriptor -Container -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamRelease -ProjectName demo | Remove-VSTeamRelease + PS C:\> Get-VSTeamReleaseDefinition -ProjectName demo | Remove-VSTeamReleaseDefinition - This command gets a list of all releases in the demo project. - The pipeline operator (|) passes the data to the Remove-VSTeamRelease function, which removes each release definition object. + This command gets a list of all release definitions in the demo project. + The pipeline operator (|) passes the data to the Remove-VSTeamReleaseDefinition function, which removes each release definition object. @@ -18078,31 +21071,30 @@ PS C:\> Remove-VSTeamMembership -MemberDescriptor $user.Descriptor -Container - Add-VSTeamRelease + Add-VSTeamReleaseDefinition - Get-VSTeamRelease + Get-VSTeamReleaseDefinition - Remove-VSTeamReleaseDefinition + Remove-VSTeamServiceEndpoint Remove - VSTeamReleaseDefinition + VSTeamServiceEndpoint - Removes the release definitions for a team project. + Removes a service endpoint. - The Remove-VSTeamReleaseDefinition function removes the release definitions for a team project. - The project name is a Dynamic Parameter which may not be displayed in the syntax above but is mandatory. + Removes a service endpoint. - Remove-VSTeamReleaseDefinition + Remove-VSTeamServiceEndpoint ProjectName @@ -18120,13 +21112,11 @@ PS C:\> Remove-VSTeamMembership -MemberDescriptor $user.Descriptor -Container Id - Specifies one or more release definitions by ID. - To specify multiple IDs, use commas to separate the IDs. - To find the ID of a release definition, type Get-VSTeamReleaseDefinition. + Id of the service endpoint - Int32[] + String[] - Int32[] + String[] None @@ -18162,13 +21152,11 @@ PS C:\> Remove-VSTeamMembership -MemberDescriptor $user.Descriptor -Container Id - Specifies one or more release definitions by ID. - To specify multiple IDs, use commas to separate the IDs. - To find the ID of a release definition, type Get-VSTeamReleaseDefinition. + Id of the service endpoint - Int32[] + String[] - Int32[] + String[] None @@ -18186,11 +21174,182 @@ PS C:\> Remove-VSTeamMembership -MemberDescriptor $user.Descriptor -Container False - + + + + + + + + + + + + + Remove-VSTeamTaskGroup + Remove + VSTeamTaskGroup + + Removes a task group + + + + Removes a task group + + + + Remove-VSTeamTaskGroup + + ProjectName + + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + + String + + String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + SwitchParameter + + + False + + + Force + + Does not prompt + + + SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + SwitchParameter + + + False + + + Id + + ID of the existing task group + + String + + String + + + None + + + + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + SwitchParameter + + SwitchParameter + + + False + + + Force + + Does not prompt + + SwitchParameter + + SwitchParameter + + + False + + + ProjectName + + + + + + + + + None + + + ProjectName + + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + + String + + String + + + None + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + SwitchParameter + + SwitchParameter + + + False + + + Id + + ID of the existing task group + + String + + String + + + None + + + + + + System.String[] + + + System.String + + + - None + System.Object @@ -18199,62 +21358,63 @@ PS C:\> Remove-VSTeamMembership -MemberDescriptor $user.Descriptor -Container - This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets release definitions. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - You can pipe release definition IDs to this function. + -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamReleaseDefinition -ProjectName demo | Remove-VSTeamReleaseDefinition + $projectName = "some_project_name" +$taskGroup = Get-VSTeamTaskGroup -Name "taskName" -ProjectName $projectName + +$methodParameters = @{ + Id = $taskGroup.id + ProjectName = $projectName + Force = $true +} + +Remove-VSTeamTaskGroup @methodParameters - This command gets a list of all release definitions in the demo project. - The pipeline operator (|) passes the data to the Remove-VSTeamReleaseDefinition function, which removes each release definition object. + - Set-VSTeamAccount - - - - Set-VSTeamDefaultProject + Add-VSTeamTaskGroup - Add-VSTeamReleaseDefinition + Get-VSTeamTaskGroup - Get-VSTeamReleaseDefinition + Update-VSTeamTaskGroup - Remove-VSTeamServiceEndpoint + Remove-VSTeamUserEntitlement Remove - VSTeamServiceEndpoint + VSTeamUserEntitlement - Removes a service endpoint. + Delete a user from the account. + The delete operation includes unassigning Extensions and Licenses and removing the user from all project memberships. The user would continue to have access to the account if she is member of an AAD group, that is added directly to the account. - Removes a service endpoint. + Delete a user from the account. + The delete operation includes unassigning Extensions and Licenses and removing the user from all project memberships. The user would continue to have access to the account if she is member of an AAD group, that is added directly to the account. - Remove-VSTeamServiceEndpoint - - ProjectName + Remove-VSTeamUserEntitlement + + UserId - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + The id of the user to remove. String @@ -18263,18 +21423,65 @@ PS C:\> Remove-VSTeamMembership -MemberDescriptor $user.Descriptor -Container None - - Id + + Confirm - Id of the service endpoint + Prompts you for confirmation before running the function. - String[] - String[] + SwitchParameter + + + False + + + Force + + Forces the function without confirmation + + + SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the function runs. The function is not run. + + + SwitchParameter + + + False + + + + Remove-VSTeamUserEntitlement + + Email + + The email of the user to remove. + + String + + String None + + Confirm + + Prompts you for confirmation before running the function. + + + SwitchParameter + + + False + Force @@ -18286,15 +21493,48 @@ PS C:\> Remove-VSTeamMembership -MemberDescriptor $user.Descriptor -Container False + + WhatIf + + Shows what would happen if the function runs. The function is not run. + + + SwitchParameter + + + False + - - ProjectName + + Confirm - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + Prompts you for confirmation before running the function. + + SwitchParameter + + SwitchParameter + + + False + + + Force + + Forces the function without confirmation + + SwitchParameter + + SwitchParameter + + + False + + + UserId + + The id of the user to remove. String @@ -18303,22 +21543,22 @@ PS C:\> Remove-VSTeamMembership -MemberDescriptor $user.Descriptor -Container None - - Id + + Email - Id of the service endpoint + The email of the user to remove. - String[] + String - String[] + String None - - Force + + WhatIf - Forces the function without confirmation + Shows what would happen if the function runs. The function is not run. SwitchParameter @@ -18328,8 +21568,26 @@ PS C:\> Remove-VSTeamMembership -MemberDescriptor $user.Descriptor -Container False - - + + + + System.String + + + + + + + + + + System.Object + + + + + + @@ -18340,19 +21598,19 @@ PS C:\> Remove-VSTeamMembership -MemberDescriptor $user.Descriptor -Container - Remove-VSTeamTaskGroup + Remove-VSTeamVariableGroup Remove - VSTeamTaskGroup + VSTeamVariableGroup - Removes a task group + Removes a variable group - Removes a task group + Removes a variable group - Remove-VSTeamTaskGroup + Remove-VSTeamVariableGroup ProjectName @@ -18367,10 +21625,10 @@ PS C:\> Remove-VSTeamMembership -MemberDescriptor $user.Descriptor -Container None - - Confirm + + Force - Prompts you for confirmation before running the cmdlet. + Forces the function without confirmation SwitchParameter @@ -18378,10 +21636,10 @@ PS C:\> Remove-VSTeamMembership -MemberDescriptor $user.Descriptor -Container False - - Force + + Confirm - Does not prompt + Prompts you for confirmation before running the function. SwitchParameter @@ -18389,10 +21647,10 @@ PS C:\> Remove-VSTeamMembership -MemberDescriptor $user.Descriptor -Container False - + WhatIf - Shows what would happen if the cmdlet runs. The cmdlet is not run. + Shows what would happen if the function runs. The function is not run. SwitchParameter @@ -18403,7 +21661,7 @@ PS C:\> Remove-VSTeamMembership -MemberDescriptor $user.Descriptor -Container Id - ID of the existing task group + ID of the existing variable group String @@ -18415,60 +21673,48 @@ PS C:\> Remove-VSTeamMembership -MemberDescriptor $user.Descriptor -Container - - Confirm - - Prompts you for confirmation before running the cmdlet. - - SwitchParameter - - SwitchParameter - - - False - - - Force + + ProjectName - Does not prompt + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - SwitchParameter + String - SwitchParameter + String - False + None - ProjectName + Force - + Forces the function without confirmation - + SwitchParameter - + SwitchParameter - None + False - - ProjectName + + Confirm - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + Prompts you for confirmation before running the function. - String + SwitchParameter - String + SwitchParameter - None + False - + WhatIf - Shows what would happen if the cmdlet runs. The cmdlet is not run. + Shows what would happen if the function runs. The function is not run. SwitchParameter @@ -18480,7 +21726,7 @@ PS C:\> Remove-VSTeamMembership -MemberDescriptor $user.Descriptor -Container Id - ID of the existing task group + ID of the existing variable group String @@ -18518,16 +21764,28 @@ PS C:\> Remove-VSTeamMembership -MemberDescriptor $user.Descriptor -Container -------------------------- EXAMPLE 1 -------------------------- - $projectName = "some_project_name" -$taskGroup = Get-VSTeamTaskGroup -Name "taskName" -ProjectName $projectName + $methodParameters = @{ + ProjectName = "some_project_name" + Name = "new_variable_group" + Description = "Describe the Variable Group" + Type = "Vsts" + Variables = @{ + key1 = @{ + value = "value1" + isSecret = $true + } + } +} + +$newVariableGroup = Add-VSTeamVariableGroup @methodParameters $methodParameters = @{ - Id = $taskGroup.id - ProjectName = $projectName + Id = $newVariableGroup.id + ProjectName = "some_project_name" Force = $true } -Remove-VSTeamTaskGroup @methodParameters +Remove-VSTeamVariableGroup @methodParameters @@ -18535,52 +21793,50 @@ Remove-VSTeamTaskGroup @methodParameters - Add-VSTeamTaskGroup + Add-VSTeamVariableGroup - Get-VSTeamTaskGroup + Get-VSTeamVariableGroup - Update-VSTeamTaskGroup + Update-VSTeamVariableGroup - Remove-VSTeamUserEntitlement + Remove-VSTeamWorkItem Remove - VSTeamUserEntitlement + VSTeamWorkItem - Delete a user from the account. - The delete operation includes unassigning Extensions and Licenses and removing the user from all project memberships. The user would continue to have access to the account if she is member of an AAD group, that is added directly to the account. + Deletes the specified work item and sends it to the Recycle Bin, so that it can be restored back, if required. Optionally, if the destroy parameter has been set to true, it destroys the work item permanently. WARNING: If the destroy parameter is set to true, work items deleted by this command will NOT go to recycle-bin and there is no way to restore/recover them after deletion. It is recommended NOT to use this parameter. If you do, please use this parameter with extreme caution. - Delete a user from the account. - The delete operation includes unassigning Extensions and Licenses and removing the user from all project memberships. The user would continue to have access to the account if she is member of an AAD group, that is added directly to the account. + Deletes the specified work item and sends it to the Recycle Bin, so that it can be restored back, if required. Optionally, if the destroy parameter has been set to true, it destroys the work item permanently. WARNING: If the destroy parameter is set to true, work items deleted by this command will NOT go to recycle-bin and there is no way to restore/recover them after deletion. It is recommended NOT to use this parameter. If you do, please use this parameter with extreme caution. - Remove-VSTeamUserEntitlement - - UserId + Remove-VSTeamWorkItem + + Id - The id of the user to remove. + The id of one or more work items. - String + Int32[] - String + Int32[] None - - Confirm + + Destroy - Prompts you for confirmation before running the function. + Optional parameter, if set to true, the work item is deleted permanently. Please note: the destroy action is PERMANENT and cannot be undone. SwitchParameter @@ -18599,32 +21855,6 @@ Remove-VSTeamTaskGroup @methodParameters False - - WhatIf - - Shows what would happen if the function runs. The function is not run. - - - SwitchParameter - - - False - - - - Remove-VSTeamUserEntitlement - - Email - - The email of the user to remove. - - String - - String - - - None - Confirm @@ -18636,17 +21866,6 @@ Remove-VSTeamTaskGroup @methodParameters False - - Force - - Forces the function without confirmation - - - SwitchParameter - - - False - WhatIf @@ -18661,22 +21880,22 @@ Remove-VSTeamTaskGroup @methodParameters - - Confirm + + Id - Prompts you for confirmation before running the function. + The id of one or more work items. - SwitchParameter + Int32[] - SwitchParameter + Int32[] - False + None - Force + Destroy - Forces the function without confirmation + Optional parameter, if set to true, the work item is deleted permanently. Please note: the destroy action is PERMANENT and cannot be undone. SwitchParameter @@ -18685,29 +21904,29 @@ Remove-VSTeamTaskGroup @methodParameters False - - UserId + + Force - The id of the user to remove. + Forces the function without confirmation - String + SwitchParameter - String + SwitchParameter - None + False - - Email + + Confirm - The email of the user to remove. + Prompts you for confirmation before running the function. - String + SwitchParameter - String + SwitchParameter - None + False WhatIf @@ -18728,49 +21947,109 @@ Remove-VSTeamTaskGroup @methodParameters System.String - + ProjectName - - - - System.Object - - - - - - + - + If you do not set the default project by called Set-VSTeamDefaultProject before calling Get-VSTeamWorkItem you will have to type in the names. - + + + -------------------------- EXAMPLE 1 -------------------------- + PS C:\> Remove-VSTeamWorkItem -Id 47,48 -Force + + This command deletes work items with IDs 47 and 48 by using the IDs parameter. + + + + -------------------------- EXAMPLE 2 -------------------------- + PS C:\> Remove-VSTeamWorkItem -Id 47 + + This command deletes the work item with ID 47 by using the ID parameter. + + + + -------------------------- EXAMPLE 3 -------------------------- + PS C:\> Remove-VSTeamWorkItem -Id 47 -Destroy -Force + + This command deletes work item with IDs 47 permanently by using the Destroy parameter. + + + - Remove-VSTeamVariableGroup - Remove - VSTeamVariableGroup + Set-VSTeamAccount + Set + VSTeamAccount - Removes a variable group + Stores your account name and personal access token for use with the other functions in this module. - Removes a variable group + On Windows you have to option to store the information at the process, user or machine (you must be running PowerShell as administrator to store at the machine level) level. + On Linux and Mac you can only store at the process level. + Calling Set-VSTeamAccount will clear any default project. - Remove-VSTeamVariableGroup - - ProjectName + Set-VSTeamAccount + + Account + + The Azure DevOps (AzD) account name to use. DO NOT enter the entire URL. + Just the portion after dev.azure.com. For example in the following url mydemos is the account name. <https://dev.azure.com/mydemos> or The full Team Foundation Server (TFS) url including the collection. <http://localhost:8080/tfs/DefaultCollection> + + String + + String + + + None + + + Version + + Specifies the version to use. The acceptable values for this parameter are: + - TFS2017 + - TFS2018 + - AzD2019 + - VSTS + - AzD + + If you are on AzD it will default to Azd otherwise it will default to TFS2017 + + String + + String + + + TFS2017 for TFS and AzD for AzD + + + SecurePersonalAccessToken + + A secured string to capture your personal access token. + This will allow you to provide your personal access token without displaying it in plain text. + To use pat simply omit it from the Set-VSTeamAccount command. + + SecureString + + SecureString + + + None + + + Level - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + On Windows allows you to store your account information at the Process, User or Machine levels. When saved at the User or Machine level your account information will be in any future PowerShell processes. + To store at the Machine level you must be running PowerShell as an Administrator. String @@ -18780,9 +22059,9 @@ Remove-VSTeamTaskGroup @methodParameters None - Force + UseBearerToken - Forces the function without confirmation + Switches the authorization from Basic to Bearer. You still use the PAT for PersonalAccessToken parameters to store the token. SwitchParameter @@ -18790,21 +22069,22 @@ Remove-VSTeamTaskGroup @methodParameters False - - Confirm + + Drive - Prompts you for confirmation before running the function. + The name of the drive you want to mount to this account. The command you need to run will be presented. Simply copy and paste the command to mount the drive. To use the drive run Set-Location [driveName]: + String - SwitchParameter + String - False + None - - WhatIf + + Force - Shows what would happen if the function runs. The function is not run. + Forces the function without confirmation SwitchParameter @@ -18812,10 +22092,14 @@ Remove-VSTeamTaskGroup @methodParameters False - - Id + + + Set-VSTeamAccount + + Account - ID of the existing variable group + The Azure DevOps (AzD) account name to use. DO NOT enter the entire URL. + Just the portion after dev.azure.com. For example in the following url mydemos is the account name. <https://dev.azure.com/mydemos> or The full Team Foundation Server (TFS) url including the collection. <http://localhost:8080/tfs/DefaultCollection> String @@ -18824,173 +22108,136 @@ Remove-VSTeamTaskGroup @methodParameters None - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - Force - - Forces the function without confirmation - - SwitchParameter - - SwitchParameter - - - False - - - Confirm - - Prompts you for confirmation before running the function. - - SwitchParameter - - SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the function runs. The function is not run. - - SwitchParameter - - SwitchParameter - - - False - - - Id - - ID of the existing variable group - - String - - String - - - None - - - - - - System.String[] - - - System.String - - - - - - - System.Object - - - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - $methodParameters = @{ - ProjectName = "some_project_name" - Name = "new_variable_group" - Description = "Describe the Variable Group" - Type = "Vsts" - Variables = @{ - key1 = @{ - value = "value1" - isSecret = $true - } - } -} - -$newVariableGroup = Add-VSTeamVariableGroup @methodParameters - -$methodParameters = @{ - Id = $newVariableGroup.id - ProjectName = "some_project_name" - Force = $true -} - -Remove-VSTeamVariableGroup @methodParameters - - - - - - - - Add-VSTeamVariableGroup - - - - Get-VSTeamVariableGroup - - - - Update-VSTeamVariableGroup - - - - - - - Remove-VSTeamWorkItem - Remove - VSTeamWorkItem - - Deletes the specified work item and sends it to the Recycle Bin, so that it can be restored back, if required. Optionally, if the destroy parameter has been set to true, it destroys the work item permanently. WARNING: If the destroy parameter is set to true, work items deleted by this command will NOT go to recycle-bin and there is no way to restore/recover them after deletion. It is recommended NOT to use this parameter. If you do, please use this parameter with extreme caution. - - - - Deletes the specified work item and sends it to the Recycle Bin, so that it can be restored back, if required. Optionally, if the destroy parameter has been set to true, it destroys the work item permanently. WARNING: If the destroy parameter is set to true, work items deleted by this command will NOT go to recycle-bin and there is no way to restore/recover them after deletion. It is recommended NOT to use this parameter. If you do, please use this parameter with extreme caution. - - + + PersonalAccessToken + + The personal access token from AzD/TFS to use to access this account. + + String + + String + + + None + + + Version + + Specifies the version to use. The acceptable values for this parameter are: + - TFS2017 + - TFS2018 + - AzD2019 + - VSTS + - AzD + + If you are on AzD it will default to Azd otherwise it will default to TFS2017 + + String + + String + + + TFS2017 for TFS and AzD for AzD + + + Level + + On Windows allows you to store your account information at the Process, User or Machine levels. When saved at the User or Machine level your account information will be in any future PowerShell processes. + To store at the Machine level you must be running PowerShell as an Administrator. + + String + + String + + + None + + + UseBearerToken + + Switches the authorization from Basic to Bearer. You still use the PAT for PersonalAccessToken parameters to store the token. + + + SwitchParameter + + + False + + + Drive + + The name of the drive you want to mount to this account. The command you need to run will be presented. Simply copy and paste the command to mount the drive. To use the drive run Set-Location [driveName]: + + String + + String + + + None + + + Force + + Forces the function without confirmation + + + SwitchParameter + + + False + + - Remove-VSTeamWorkItem - - Id + Set-VSTeamAccount + + Account - The id of one or more work items. + The Azure DevOps (AzD) account name to use. DO NOT enter the entire URL. + Just the portion after dev.azure.com. For example in the following url mydemos is the account name. <https://dev.azure.com/mydemos> or The full Team Foundation Server (TFS) url including the collection. <http://localhost:8080/tfs/DefaultCollection> - Int32[] + String - Int32[] + String + + + None + + + Version + + Specifies the version to use. The acceptable values for this parameter are: + - TFS2017 + - TFS2018 + - AzD2019 + - VSTS + - AzD + + If you are on AzD it will default to Azd otherwise it will default to TFS2017 + + String + + String + + + TFS2017 for TFS and AzD for AzD + + + Level + + On Windows allows you to store your account information at the Process, User or Machine levels. When saved at the User or Machine level your account information will be in any future PowerShell processes. + To store at the Machine level you must be running PowerShell as an Administrator. + + String + + String None - Destroy + UseWindowsAuthentication - Optional parameter, if set to true, the work item is deleted permanently. Please note: the destroy action is PERMANENT and cannot be undone. + Allows the use of the current user's Windows credentials to authenticate against a local Team Foundation Server or Azure DevOps Server. This cannot be used to connect to Azure DevOps Services. SwitchParameter @@ -18998,6 +22245,18 @@ Remove-VSTeamVariableGroup @methodParameters False + + Drive + + The name of the drive you want to mount to this account. The command you need to run will be presented. Simply copy and paste the command to mount the drive. To use the drive run Set-Location [driveName]: + + String + + String + + + None + Force @@ -19009,21 +22268,37 @@ Remove-VSTeamVariableGroup @methodParameters False - - Confirm + + + Set-VSTeamAccount + + Profile - Prompts you for confirmation before running the function. + The profile name stored using Add-VSTeamProfile function. You can tab complete through existing profile names. + String - SwitchParameter + String - False + None - - WhatIf + + Drive - Shows what would happen if the function runs. The function is not run. + The name of the drive you want to mount to this account. The command you need to run will be presented. Simply copy and paste the command to mount the drive. To use the drive run Set-Location [driveName]: + + String + + String + + + None + + + Force + + Forces the function without confirmation SwitchParameter @@ -19034,34 +22309,62 @@ Remove-VSTeamVariableGroup @methodParameters - - Id + + Account - The id of one or more work items. + The Azure DevOps (AzD) account name to use. DO NOT enter the entire URL. + Just the portion after dev.azure.com. For example in the following url mydemos is the account name. <https://dev.azure.com/mydemos> or The full Team Foundation Server (TFS) url including the collection. <http://localhost:8080/tfs/DefaultCollection> - Int32[] + String - Int32[] + String + + + None + + + SecurePersonalAccessToken + + A secured string to capture your personal access token. + This will allow you to provide your personal access token without displaying it in plain text. + To use pat simply omit it from the Set-VSTeamAccount command. + + SecureString + + SecureString None - Destroy + Level - Optional parameter, if set to true, the work item is deleted permanently. Please note: the destroy action is PERMANENT and cannot be undone. + On Windows allows you to store your account information at the Process, User or Machine levels. When saved at the User or Machine level your account information will be in any future PowerShell processes. + To store at the Machine level you must be running PowerShell as an Administrator. - SwitchParameter + String - SwitchParameter + String - False + None + + + PersonalAccessToken + + The personal access token from AzD/TFS to use to access this account. + + String + + String + + + None - Force + UseWindowsAuthentication - Forces the function without confirmation + Allows the use of the current user's Windows credentials to authenticate against a local Team Foundation Server or Azure DevOps Server. This cannot be used to connect to Azure DevOps Services. SwitchParameter @@ -19070,10 +22373,10 @@ Remove-VSTeamVariableGroup @methodParameters False - - Confirm + + UseBearerToken - Prompts you for confirmation before running the function. + Switches the authorization from Basic to Bearer. You still use the PAT for PersonalAccessToken parameters to store the token. SwitchParameter @@ -19082,10 +22385,53 @@ Remove-VSTeamVariableGroup @methodParameters False - - WhatIf + + Profile - Shows what would happen if the function runs. The function is not run. + The profile name stored using Add-VSTeamProfile function. You can tab complete through existing profile names. + + String + + String + + + None + + + Version + + Specifies the version to use. The acceptable values for this parameter are: + - TFS2017 + - TFS2018 + - AzD2019 + - VSTS + - AzD + + If you are on AzD it will default to Azd otherwise it will default to TFS2017 + + String + + String + + + TFS2017 for TFS and AzD for AzD + + + Drive + + The name of the drive you want to mount to this account. The command you need to run will be presented. Simply copy and paste the command to mount the drive. To use the drive run Set-Location [driveName]: + + String + + String + + + None + + + Force + + Forces the function without confirmation SwitchParameter @@ -19095,146 +22441,101 @@ Remove-VSTeamVariableGroup @methodParameters False - - - - System.String - - - ProjectName - - - + - If you do not set the default project by called Set-VSTeamDefaultProject before calling Get-VSTeamWorkItem you will have to type in the names. + - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Remove-VSTeamWorkItem -Id 47,48 -Force + -------------------------- EXAMPLE 1 -------------------------- + PS C:\> Set-VSTeamAccount + + You will be prompted for the account name and personal access token. + + + + -------------------------- EXAMPLE 2 -------------------------- + PS C:\> Set-VSTeamAccount -Account mydemos -PersonalAccessToken 7a8ilh6db4aforlrnrthisisnotreal4uhlh5vgbmgap3mziwnga + + Allows you to provide all the information on the command line. + + + + -------------------------- EXAMPLE 3 -------------------------- + PS C:\> Set-VSTeamAccount -Account http://localtfs:8080/tfs/DefaultCollection -UseWindowsAuthentication + + On Windows, allows you use to use Windows authentication against a local TFS server. + + + + -------------------------- EXAMPLE 4 -------------------------- + PS C:\> Set-VSTeamAccount -Profile demonstrations + + Will add the account from the profile provided. + + + + -------------------------- EXAMPLE 5 -------------------------- + PS C:\> Set-VSTeamAccount -Profile demonstrations -Drive demo | Invoke-Expression +PS C:\> Set-Location demo: +PS demo:\> Get-ChildItem - This command deletes work items with IDs 47 and 48 by using the IDs parameter. + Will add the account from the profile provided and mount a drive named demo that you can navigate like a file system. If you do not pipe to Invoke-Expression you can simply copy and paste the output and execute it. - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Remove-VSTeamWorkItem -Id 47 + -------------------------- EXAMPLE 6 -------------------------- + PS C:\> Set-VSTeamAccount -Profile demonstrations -Level Machine - This command deletes the work item with ID 47 by using the ID parameter. + Will add the account from the profile provided and store the information at the Machine level. Now any new PowerShell sessions will auto load this account. + Note: You must run PowerShell as an Administrator to store at the Machine level. - -------------------------- EXAMPLE 3 -------------------------- - PS C:\> Remove-VSTeamWorkItem -Id 47 -Destroy -Force + -------------------------- EXAMPLE 7 -------------------------- + PS C:\> Set-VSTeamAccount -Account mydemos -Token $(System.AccessToken) -UseBearerToken - This command deletes work item with IDs 47 permanently by using the Destroy parameter. + Will add the account and use the OAuth Token provided by AzD when you check the Allow scripts to access OAuth token checkbox on the phase. Using this method removes the need to create a Personal Access Token. Note -Token is just an alias for -PersonalAccessToken. The token is scoped to only allow access to the account running the build or release. To access other accounts you will have to use a personal access token. - + + + Set-VSTeamAccount + + + + Add-VSTeamProfile + + + + Clear-VSTeamDefaultProject + + + + Set-VSTeamDefaultProject + + + - Set-VSTeamAccount + Set-VSTeamAlias Set - VSTeamAccount + VSTeamAlias - Stores your account name and personal access token for use with the other functions in this module. + In version 6.0 the default aliases were removed to prevent conflicts with other modules. If you want to use the original aliases you can run this function to restore them. - On Windows you have to option to store the information at the process, user or machine (you must be running PowerShell as administrator to store at the machine level) level. - On Linux and Mac you can only store at the process level. - Calling Set-VSTeamAccount will clear any default project. + In version 6.0 the default aliases were removed to prevent conflicts with other modules. If you want to use the original aliases you can run this function to restore them. - Set-VSTeamAccount - - Account - - The Azure DevOps (AzD) account name to use. DO NOT enter the entire URL. - Just the portion after dev.azure.com. For example in the following url mydemos is the account name. <https://dev.azure.com/mydemos> or The full Team Foundation Server (TFS) url including the collection. <http://localhost:8080/tfs/DefaultCollection> - - String - - String - - - None - - - Version - - Specifies the version to use. The acceptable values for this parameter are: - - TFS2017 - - TFS2018 - - AzD2019 - - VSTS - - AzD - - If you are on AzD it will default to Azd otherwise it will default to TFS2017 - - String - - String - - - TFS2017 for TFS and AzD for AzD - - - SecurePersonalAccessToken - - A secured string to capture your personal access token. - This will allow you to provide your personal access token without displaying it in plain text. - To use pat simply omit it from the Set-VSTeamAccount command. - - SecureString - - SecureString - - - None - - - Level - - On Windows allows you to store your account information at the Process, User or Machine levels. When saved at the User or Machine level your account information will be in any future PowerShell processes. - To store at the Machine level you must be running PowerShell as an Administrator. - - String - - String - - - None - - - UseBearerToken - - Switches the authorization from Basic to Bearer. You still use the PAT for PersonalAccessToken parameters to store the token. - - - SwitchParameter - - - False - - - Drive - - The name of the drive you want to mount to this account. The command you need to run will be presented. Simply copy and paste the command to mount the drive. To use the drive run Set-Location [driveName]: - - String - - String - - - None - + Set-VSTeamAlias Force @@ -19247,87 +22548,80 @@ Remove-VSTeamVariableGroup @methodParameters False - - Set-VSTeamAccount - - Account - - The Azure DevOps (AzD) account name to use. DO NOT enter the entire URL. - Just the portion after dev.azure.com. For example in the following url mydemos is the account name. <https://dev.azure.com/mydemos> or The full Team Foundation Server (TFS) url including the collection. <http://localhost:8080/tfs/DefaultCollection> - - String - - String - - - None - - - PersonalAccessToken - - The personal access token from AzD/TFS to use to access this account. - - String - - String - - - None - - - Version - - Specifies the version to use. The acceptable values for this parameter are: - - TFS2017 - - TFS2018 - - AzD2019 - - VSTS - - AzD - - If you are on AzD it will default to Azd otherwise it will default to TFS2017 - - String - - String - - - TFS2017 for TFS and AzD for AzD - - - Level - - On Windows allows you to store your account information at the Process, User or Machine levels. When saved at the User or Machine level your account information will be in any future PowerShell processes. - To store at the Machine level you must be running PowerShell as an Administrator. - - String - - String - - - None - - - UseBearerToken - - Switches the authorization from Basic to Bearer. You still use the PAT for PersonalAccessToken parameters to store the token. - - - SwitchParameter - - - False - - - Drive + + + + Force + + Forces the function without confirmation + + SwitchParameter + + SwitchParameter + + + False + + + + + + System.String + + + + + + + + + + System.Object + + + + + + + + + + + + + + + + + Set-VSTeamAPIVersion + Set + VSTeamAPIVersion + + Sets the API versions to support either TFS2017, TFS2018, AzD2019 or AzD. + + + + Set-VSTeamAPIVersion sets the versions of APIs used. + + + + Set-VSTeamAPIVersion + + Target - The name of the drive you want to mount to this account. The command you need to run will be presented. Simply copy and paste the command to mount the drive. To use the drive run Set-Location [driveName]: + Specifies the version to use. The acceptable values for this parameter are: + - TFS2017 + - TFS2018 + - AzD2019 + - VSTS + - AzD String String - None + TFS2017 Force @@ -19342,12 +22636,21 @@ Remove-VSTeamVariableGroup @methodParameters - Set-VSTeamAccount - - Account + Set-VSTeamAPIVersion + + Service - The Azure DevOps (AzD) account name to use. DO NOT enter the entire URL. - Just the portion after dev.azure.com. For example in the following url mydemos is the account name. <https://dev.azure.com/mydemos> or The full Team Foundation Server (TFS) url including the collection. <http://localhost:8080/tfs/DefaultCollection> + Specifies the service to change. The acceptable values for this parameter are: + - Build + - Release + - Core + - Git + - DistributedTask + - Tfvc + - Packaging + - MemberEntitlementManagement + - ExtensionsManagement + - ServiceFabricEndpoint String @@ -19356,30 +22659,10 @@ Remove-VSTeamVariableGroup @methodParameters None - + Version - Specifies the version to use. The acceptable values for this parameter are: - - TFS2017 - - TFS2018 - - AzD2019 - - VSTS - - AzD - - If you are on AzD it will default to Azd otherwise it will default to TFS2017 - - String - - String - - - TFS2017 for TFS and AzD for AzD - - - Level - - On Windows allows you to store your account information at the Process, User or Machine levels. When saved at the User or Machine level your account information will be in any future PowerShell processes. - To store at the Machine level you must be running PowerShell as an Administrator. + Specifies the version to use. String @@ -19389,9 +22672,9 @@ Remove-VSTeamVariableGroup @methodParameters None - UseWindowsAuthentication + Force - Allows the use of the current user's Windows credentials to authenticate against a local Team Foundation Server or Azure DevOps Server. This cannot be used to connect to Azure DevOps Services. + Forces the function without confirmation SwitchParameter @@ -19399,10 +22682,119 @@ Remove-VSTeamVariableGroup @methodParameters False - - Drive + + + + + Target + + Specifies the version to use. The acceptable values for this parameter are: + - TFS2017 + - TFS2018 + - AzD2019 + - VSTS + - AzD + + String + + String + + + TFS2017 + + + Service + + Specifies the service to change. The acceptable values for this parameter are: + - Build + - Release + - Core + - Git + - DistributedTask + - Tfvc + - Packaging + - MemberEntitlementManagement + - ExtensionsManagement + - ServiceFabricEndpoint + + String + + String + + + None + + + Version + + Specifies the version to use. + + String + + String + + + None + + + Force + + Forces the function without confirmation + + SwitchParameter + + SwitchParameter + + + False + + + + + + + + + + + + -------------------------- EXAMPLE 1 -------------------------- + PS C:\> Set-VSTeamAPIVersion AzD + + This command sets the API versions to support AzD. + + + + -------------------------- EXAMPLE 2 -------------------------- + PS C:\> Set-VSTeamAPIVersion -Service Release -Version '5.0' + + This command sets the version of the Release calls to 5.0. + + + + + + + + Set-VSTeamApproval + Set + VSTeamApproval + + Sets the status of approval to Approved, Rejected, Pending, or ReAssigned. + + + + Set-VSTeamApproval sets the status of approval to Approved, Rejected, Pending, or ReAssigned. + + + + Set-VSTeamApproval + + ProjectName - The name of the drive you want to mount to this account. The command you need to run will be presented. Simply copy and paste the command to mount the drive. To use the drive run Set-Location [driveName]: + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. String @@ -19411,24 +22803,38 @@ Remove-VSTeamVariableGroup @methodParameters None - - Force + + Id - Forces the function without confirmation + Specifies the approval IDs of the approvals to set. + Int32[] - SwitchParameter + Int32[] - False + None - - - Set-VSTeamAccount - Profile + Status - The profile name stored using Add-VSTeamProfile function. You can tab complete through existing profile names. + Specifies the status to set for the approval. The acceptable values for this parameter are: + - Approved + - Rejected + - Pending + - ReAssigned + + String + + String + + + Approved + + + Approver + + Specifies the user to whom the approval has been re-assigned to Alias of the user chuckreinhart@outlook.com, for example. String @@ -19438,9 +22844,9 @@ Remove-VSTeamVariableGroup @methodParameters None - Drive + Comment - The name of the drive you want to mount to this account. The command you need to run will be presented. Simply copy and paste the command to mount the drive. To use the drive run Set-Location [driveName]: + Specifies the comment to be stored with this approval. String @@ -19456,45 +22862,19 @@ Remove-VSTeamVariableGroup @methodParameters SwitchParameter - - - False - - - - - - Account - - The Azure DevOps (AzD) account name to use. DO NOT enter the entire URL. - Just the portion after dev.azure.com. For example in the following url mydemos is the account name. <https://dev.azure.com/mydemos> or The full Team Foundation Server (TFS) url including the collection. <http://localhost:8080/tfs/DefaultCollection> - - String - - String - - - None - - - SecurePersonalAccessToken - - A secured string to capture your personal access token. - This will allow you to provide your personal access token without displaying it in plain text. - To use pat simply omit it from the Set-VSTeamAccount command. - - SecureString - - SecureString - - - None - - - Level + + + False + + + + + + ProjectName - On Windows allows you to store your account information at the Process, User or Machine levels. When saved at the User or Machine level your account information will be in any future PowerShell processes. - To store at the Machine level you must be running PowerShell as an Administrator. + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. String @@ -19503,77 +22883,50 @@ Remove-VSTeamVariableGroup @methodParameters None - - PersonalAccessToken + + Id - The personal access token from AzD/TFS to use to access this account. + Specifies the approval IDs of the approvals to set. - String + Int32[] - String + Int32[] None - - UseWindowsAuthentication - - Allows the use of the current user's Windows credentials to authenticate against a local Team Foundation Server or Azure DevOps Server. This cannot be used to connect to Azure DevOps Services. - - SwitchParameter - - SwitchParameter - - - False - - - UseBearerToken - - Switches the authorization from Basic to Bearer. You still use the PAT for PersonalAccessToken parameters to store the token. - - SwitchParameter - - SwitchParameter - - - False - - Profile + Status - The profile name stored using Add-VSTeamProfile function. You can tab complete through existing profile names. + Specifies the status to set for the approval. The acceptable values for this parameter are: + - Approved + - Rejected + - Pending + - ReAssigned String String - None + Approved - - Version + + Approver - Specifies the version to use. The acceptable values for this parameter are: - - TFS2017 - - TFS2018 - - AzD2019 - - VSTS - - AzD - - If you are on AzD it will default to Azd otherwise it will default to TFS2017 + Specifies the user to whom the approval has been re-assigned to Alias of the user chuckreinhart@outlook.com, for example. String String - TFS2017 for TFS and AzD for AzD + None - Drive + Comment - The name of the drive you want to mount to this account. The command you need to run will be presented. Simply copy and paste the command to mount the drive. To use the drive run Set-Location [driveName]: + Specifies the comment to be stored with this approval. String @@ -19605,206 +22958,43 @@ Remove-VSTeamVariableGroup @methodParameters -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Set-VSTeamAccount + PS C:\> Get-VSTeamApproval | Set-VSTeamApproval - You will be prompted for the account name and personal access token. + This command sets all pending approvals to approved. -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Set-VSTeamAccount -Account mydemos -PersonalAccessToken 7a8ilh6db4aforlrnrthisisnotreal4uhlh5vgbmgap3mziwnga - - Allows you to provide all the information on the command line. - - - - -------------------------- EXAMPLE 3 -------------------------- - PS C:\> Set-VSTeamAccount -Account http://localtfs:8080/tfs/DefaultCollection -UseWindowsAuthentication - - On Windows, allows you use to use Windows authentication against a local TFS server. - - - - -------------------------- EXAMPLE 4 -------------------------- - PS C:\> Set-VSTeamAccount -Profile demonstrations - - Will add the account from the profile provided. - - - - -------------------------- EXAMPLE 5 -------------------------- - PS C:\> Set-VSTeamAccount -Profile demonstrations -Drive demo | Invoke-Expression -PS C:\> Set-Location demo: -PS demo:\> Get-ChildItem - - Will add the account from the profile provided and mount a drive named demo that you can navigate like a file system. If you do not pipe to Invoke-Expression you can simply copy and paste the output and execute it. - - - - -------------------------- EXAMPLE 6 -------------------------- - PS C:\> Set-VSTeamAccount -Profile demonstrations -Level Machine - - Will add the account from the profile provided and store the information at the Machine level. Now any new PowerShell sessions will auto load this account. - Note: You must run PowerShell as an Administrator to store at the Machine level. - - - - -------------------------- EXAMPLE 7 -------------------------- - PS C:\> Set-VSTeamAccount -Account mydemos -Token $(System.AccessToken) -UseBearerToken + PS C:\> Set-VSTeamApproval -Id 1 -Status Rejected - Will add the account and use the OAuth Token provided by AzD when you check the Allow scripts to access OAuth token checkbox on the phase. Using this method removes the need to create a Personal Access Token. Note -Token is just an alias for -PersonalAccessToken. The token is scoped to only allow access to the account running the build or release. To access other accounts you will have to use a personal access token. + This command rejects approval with Id of 1. - - - Set-VSTeamAccount - - - - Add-VSTeamProfile - - - - Clear-VSTeamDefaultProject - - - - Set-VSTeamDefaultProject - - - - - - - Set-VSTeamAlias - Set - VSTeamAlias - - In version 6.0 the default aliases were removed to prevent conflicts with other modules. If you want to use the original aliases you can run this function to restore them. - - - - In version 6.0 the default aliases were removed to prevent conflicts with other modules. If you want to use the original aliases you can run this function to restore them. - - - - Set-VSTeamAlias - - Force - - Forces the function without confirmation - - - SwitchParameter - - - False - - - - - - Force - - Forces the function without confirmation - - SwitchParameter - - SwitchParameter - - - False - - - - - - System.String - - - - - - - - - - System.Object - - - - - - - - - - - - - Set-VSTeamAPIVersion + Set-VSTeamDefaultProject Set - VSTeamAPIVersion + VSTeamDefaultProject - Sets the API versions to support either TFS2017, TFS2018, AzD2019 or AzD. + Sets the default project to be used with other calls in the module. - Set-VSTeamAPIVersion sets the versions of APIs used. + The majority of the functions in this module require a project name. + By setting a default project you can omit that parameter from your function calls and this default will be used instead. - Set-VSTeamAPIVersion - - Target - - Specifies the version to use. The acceptable values for this parameter are: - - TFS2017 - - TFS2018 - - AzD2019 - - VSTS - - AzD - - String - - String - - - TFS2017 - - - Force - - Forces the function without confirmation - - - SwitchParameter - - - False - - - - Set-VSTeamAPIVersion - - Service + Set-VSTeamDefaultProject + + Project - Specifies the service to change. The acceptable values for this parameter are: - - Build - - Release - - Core - - Git - - DistributedTask - - Tfvc - - Packaging - - MemberEntitlementManagement - - ExtensionsManagement - - ServiceFabricEndpoint + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. String @@ -19813,10 +23003,11 @@ PS demo:\> Get-ChildItem None - - Version + + Level - Specifies the version to use. + On Windows allows you to store your default project at the Process, User or Machine levels. + When saved at the User or Machine level your default project will be in any future PowerShell processes. String @@ -19839,37 +23030,24 @@ PS demo:\> Get-ChildItem - - Target + + Force - Specifies the version to use. The acceptable values for this parameter are: - - TFS2017 - - TFS2018 - - AzD2019 - - VSTS - - AzD + Forces the function without confirmation - String + SwitchParameter - String + SwitchParameter - TFS2017 + False - - Service + + Project - Specifies the service to change. The acceptable values for this parameter are: - - Build - - Release - - Core - - Git - - DistributedTask - - Tfvc - - Packaging - - MemberEntitlementManagement - - ExtensionsManagement - - ServiceFabricEndpoint + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. String @@ -19878,10 +23056,11 @@ PS demo:\> Get-ChildItem None - - Version + + Level - Specifies the version to use. + On Windows allows you to store your default project at the Process, User or Machine levels. + When saved at the User or Machine level your default project will be in any future PowerShell processes. String @@ -19890,39 +23069,39 @@ PS demo:\> Get-ChildItem None - - Force - - Forces the function without confirmation - - SwitchParameter + + + - SwitchParameter - + System.String - False - - - - + + + + + + + + + System.Object + + + + + + - + Setting a default project also enables tab completion of dynamic parameters when you call Add-VSTeamBuild. -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Set-VSTeamAPIVersion AzD - - This command sets the API versions to support AzD. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Set-VSTeamAPIVersion -Service Release -Version '5.0' + PS C:\> Set-VSTeamDefaultProject Demo - This command sets the version of the Release calls to 5.0. + This command sets Demo as the default project. + You can now call other functions that require a project name without passing the project. @@ -19930,19 +23109,19 @@ PS demo:\> Get-ChildItem - Set-VSTeamApproval + Set-VSTeamEnvironmentStatus Set - VSTeamApproval + VSTeamEnvironmentStatus - Sets the status of approval to Approved, Rejected, Pending, or ReAssigned. + Sets the status of a environment to canceled, inProgress, notStarted, partiallySucceeded, queued, rejected, scheduled, succeeded or undefined. - Set-VSTeamApproval sets the status of approval to Approved, Rejected, Pending, or ReAssigned. + Sets the status of a environment to canceled, inProgress, notStarted, partiallySucceeded, queued, rejected, scheduled, succeeded or undefined. - Set-VSTeamApproval + Set-VSTeamEnvironmentStatus ProjectName @@ -19957,10 +23136,13 @@ PS demo:\> Get-ChildItem None - - Id + + EnvironmentId - Specifies the approval IDs of the approvals to set. + Specifies one or more environments by ID you wish to deploy. + The Environment Ids are unique for each environment and in each release. + To specify multiple IDs, use commas to separate the IDs. + To find the ID of an environment type Get-VSTeamRelease -expand environments. Int32[] @@ -19969,26 +23151,22 @@ PS demo:\> Get-ChildItem None - - Status + + ReleaseId - Specifies the status to set for the approval. The acceptable values for this parameter are: - - Approved - - Rejected - - Pending - - ReAssigned + Specifies the release by ID. - String + Int32 - String + Int32 - Approved + None - Approver + Status - Specifies the user to whom the approval has been re-assigned to Alias of the user chuckreinhart@outlook.com, for example. + The status to set for the environment to canceled, inProgress, notStarted, partiallySucceeded, queued, rejected, scheduled, succeeded or undefined. String @@ -20000,7 +23178,7 @@ PS demo:\> Get-ChildItem Comment - Specifies the comment to be stored with this approval. + The comment to set for the status change. String @@ -20009,6 +23187,18 @@ PS demo:\> Get-ChildItem None + + ScheduledDeploymentTime + + The date and time to schedule when setting the status to scheduled. + + DateTime + + DateTime + + + None + Force @@ -20037,10 +23227,13 @@ PS demo:\> Get-ChildItem None - - Id + + EnvironmentId - Specifies the approval IDs of the approvals to set. + Specifies one or more environments by ID you wish to deploy. + The Environment Ids are unique for each environment and in each release. + To specify multiple IDs, use commas to separate the IDs. + To find the ID of an environment type Get-VSTeamRelease -expand environments. Int32[] @@ -20049,26 +23242,22 @@ PS demo:\> Get-ChildItem None - - Status + + ReleaseId - Specifies the status to set for the approval. The acceptable values for this parameter are: - - Approved - - Rejected - - Pending - - ReAssigned + Specifies the release by ID. - String + Int32 - String + Int32 - Approved + None - Approver + Status - Specifies the user to whom the approval has been re-assigned to Alias of the user chuckreinhart@outlook.com, for example. + The status to set for the environment to canceled, inProgress, notStarted, partiallySucceeded, queued, rejected, scheduled, succeeded or undefined. String @@ -20080,7 +23269,7 @@ PS demo:\> Get-ChildItem Comment - Specifies the comment to be stored with this approval. + The comment to set for the status change. String @@ -20089,6 +23278,18 @@ PS demo:\> Get-ChildItem None + + ScheduledDeploymentTime + + The date and time to schedule when setting the status to scheduled. + + DateTime + + DateTime + + + None + Force @@ -20106,22 +23307,17 @@ PS demo:\> Get-ChildItem - + This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets releases. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamApproval | Set-VSTeamApproval - - This command sets all pending approvals to approved. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Set-VSTeamApproval -Id 1 -Status Rejected + PS C:\> Set-VSTeamEnvironmentStatus -ReleaseId 54 -Id 5 -status inProgress - This command rejects approval with Id of 1. + This command will set the status of environment with id 5 of release 54 to inProgress. You can use this call to redeploy an environment. @@ -20129,22 +23325,21 @@ PS demo:\> Get-ChildItem - Set-VSTeamDefaultProject + Set-VSTeamPermissionInheritance Set - VSTeamDefaultProject + VSTeamPermissionInheritance - Sets the default project to be used with other calls in the module. + Sets the permission inheritance to true or false. - The majority of the functions in this module require a project name. - By setting a default project you can omit that parameter from your function calls and this default will be used instead. + Sets the permission inheritance to true or false. - Set-VSTeamDefaultProject - - Project + Set-VSTeamPermissionInheritance + + ProjectName Specifies the team project for which this function operates. You can tab complete from a list of available projects. @@ -20157,15 +23352,41 @@ PS demo:\> Get-ChildItem None - - Level + + Name + + Specifies the name of the resource. + + String + + String + + + None + + + ResourceType + + Specifies the type of resource. The acceptable values for this parameter are: + - Repository + - BuildDefinition + - ReleaseDefinition + + String + + String + + + None + + + NewState - On Windows allows you to store your default project at the Process, User or Machine levels. - When saved at the User or Machine level your default project will be in any future PowerShell processes. + The new state to set - String + Boolean - String + Boolean None @@ -20184,24 +23405,24 @@ PS demo:\> Get-ChildItem - - Force + + ProjectName - Forces the function without confirmation + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - SwitchParameter + String - SwitchParameter + String - False + None - Project + Name - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + Specifies the name of the resource. String @@ -20210,11 +23431,13 @@ PS demo:\> Get-ChildItem None - - Level + + ResourceType - On Windows allows you to store your default project at the Process, User or Machine levels. - When saved at the User or Machine level your default project will be in any future PowerShell processes. + Specifies the type of resource. The acceptable values for this parameter are: + - Repository + - BuildDefinition + - ReleaseDefinition String @@ -20223,59 +23446,84 @@ PS demo:\> Get-ChildItem None - - - + + NewState + + The new state to set + + Boolean - System.String + Boolean + - - - - - - - + None + + + Force + + Forces the function without confirmation + + SwitchParameter - System.Object + SwitchParameter + - - - - - + False + + + + - Setting a default project also enables tab completion of dynamic parameters when you call Add-VSTeamBuild. + -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Set-VSTeamDefaultProject Demo + PS C:\> Set-VSTeamPermissionInheritance -ProjectName Demo -Name Demo-CI -ResourceType BuildDefinition -NewState $true -Force - This command sets Demo as the default project. - You can now call other functions that require a project name without passing the project. + This command sets the permission inheritance to true. + + + + -------------------------- EXAMPLE 2 -------------------------- + PS C:\> Get-VSTeamBuildDefinition | Set-VSTeamPermissionInheritance -ResourceType BuildDefinition -NewState $true -Force + + ThisThis command sets the permission inheritance to true for every build definition returned from Get-VSTeamBuildDefinition. - + + + Add-VSTeamPolicy + + + + Remove-VSTeamPolicy + + + + Set-VSTeamPermissionInheritanceType + + + - Set-VSTeamEnvironmentStatus + Set-VSTeamPermissionInheritance Set - VSTeamEnvironmentStatus + VSTeamPermissionInheritance - Sets the status of a environment to canceled, inProgress, notStarted, partiallySucceeded, queued, rejected, scheduled, succeeded or undefined. + Sets the permission inheritance to true or false. - Sets the status of a environment to canceled, inProgress, notStarted, partiallySucceeded, queued, rejected, scheduled, succeeded or undefined. + Sets the permission inheritance to true or false. - Set-VSTeamEnvironmentStatus + Set-VSTeamPermissionInheritance ProjectName @@ -20290,37 +23538,10 @@ PS demo:\> Get-ChildItem None - - EnvironmentId - - Specifies one or more environments by ID you wish to deploy. - The Environment Ids are unique for each environment and in each release. - To specify multiple IDs, use commas to separate the IDs. - To find the ID of an environment type Get-VSTeamRelease -expand environments. - - Int32[] - - Int32[] - - - None - - ReleaseId - - Specifies the release by ID. - - Int32 - - Int32 - - - None - - - Status + Name - The status to set for the environment to canceled, inProgress, notStarted, partiallySucceeded, queued, rejected, scheduled, succeeded or undefined. + Specifies the name of the resource. String @@ -20329,10 +23550,13 @@ PS demo:\> Get-ChildItem None - - Comment + + ResourceType - The comment to set for the status change. + Specifies the type of resource. The acceptable values for this parameter are: + - Repository + - BuildDefinition + - ReleaseDefinition String @@ -20341,14 +23565,14 @@ PS demo:\> Get-ChildItem None - - ScheduledDeploymentTime + + NewState - The date and time to schedule when setting the status to scheduled. + The new state to set - DateTime + Boolean - DateTime + Boolean None @@ -20381,37 +23605,10 @@ PS demo:\> Get-ChildItem None - - EnvironmentId - - Specifies one or more environments by ID you wish to deploy. - The Environment Ids are unique for each environment and in each release. - To specify multiple IDs, use commas to separate the IDs. - To find the ID of an environment type Get-VSTeamRelease -expand environments. - - Int32[] - - Int32[] - - - None - - ReleaseId - - Specifies the release by ID. - - Int32 - - Int32 - - - None - - - Status + Name - The status to set for the environment to canceled, inProgress, notStarted, partiallySucceeded, queued, rejected, scheduled, succeeded or undefined. + Specifies the name of the resource. String @@ -20420,10 +23617,13 @@ PS demo:\> Get-ChildItem None - - Comment + + ResourceType - The comment to set for the status change. + Specifies the type of resource. The acceptable values for this parameter are: + - Repository + - BuildDefinition + - ReleaseDefinition String @@ -20432,14 +23632,14 @@ PS demo:\> Get-ChildItem None - - ScheduledDeploymentTime + + NewState - The date and time to schedule when setting the status to scheduled. + The new state to set - DateTime + Boolean - DateTime + Boolean None @@ -20461,21 +23661,39 @@ PS demo:\> Get-ChildItem - This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets releases. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Set-VSTeamEnvironmentStatus -ReleaseId 54 -Id 5 -status inProgress + PS C:\> Set-VSTeamPermissionInheritance -ProjectName Demo -Name Demo-CI -ResourceType BuildDefinition -NewState $true -Force - This command will set the status of environment with id 5 of release 54 to inProgress. You can use this call to redeploy an environment. + This command sets the permission inheritance to true. + + + + -------------------------- EXAMPLE 2 -------------------------- + PS C:\> Get-VSTeamBuildDefinition | Set-VSTeamPermissionInheritance -ResourceType BuildDefinition -NewState $true -Force + + ThisThis command sets the permission inheritance to true for every build definition returned from Get-VSTeamBuildDefinition. - + + + Add-VSTeamPolicy + + + + Remove-VSTeamPolicy + + + + Set-VSTeamPermissionInheritanceType + + + diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d96261375..db89bfee5 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -226,7 +226,7 @@ stages: - template: build/integrationTests.yml parameters: - displayName: 'TFS 2018 Integration Tests' + displayName: 'Windows TFS 2018' os: 'Windows' pool: 'windows-latest' start2018: 'true' @@ -237,7 +237,7 @@ stages: - template: build/integrationTests.yml parameters: - displayName: 'AzD Integration Tests' + displayName: 'Windows AzD' os: 'Windows' pool: 'windows-latest' name: 'windowsAzD' diff --git a/integration/test/000_team.Tests.ps1 b/integration/test/000_team.Tests.ps1 index 72098df85..a4e7f5ddc 100644 --- a/integration/test/000_team.Tests.ps1 +++ b/integration/test/000_team.Tests.ps1 @@ -1,10 +1,5 @@ Set-StrictMode -Version Latest -# if ($null -eq $env:TEAM_CIBUILD) { -# Get-Module VSTeam | Remove-Module -Force -# Import-Module $PSScriptRoot\..\..\dist\VSTeam.psd1 -Force -# } - ############################################################## # THESE TEST ARE DESTRUCTIVE. USE AN EMPTY ACCOUNT. # ############################################################## @@ -22,60 +17,54 @@ Set-StrictMode -Version Latest Set-VSTeamAPIVersion -Target $env:API_VERSION -InModuleScope VSTeam { - Describe 'Team' -Tag 'integration' { - BeforeAll { - $pat = $env:PAT - $acct = $env:ACCT - $api = $env:API_VERSION - Set-VSTeamAccount -a $acct -pe $pat -version $api +Describe 'Team' -Tag 'integration' { + BeforeAll { + $pat = $env:PAT + $acct = $env:ACCT + $api = $env:API_VERSION + Set-VSTeamAccount -a $acct -pe $pat -version $api - Get-VSTeamProject | Remove-VSTeamProject -Force - } + ############################################################## + # THIS DELETES ALL EXISTING TEAM PROJECTS!!!! # + ############################################################## + Get-VSTeamProject | Remove-VSTeamProject -Force + } - Context 'Get-VSTeamInfo' { - It 'should return account and default project' { - [VSTeamVersions]::Account = "mydemos" - $Global:PSDefaultParameterValues['*:projectName'] = 'MyProject' + Context 'Get-VSTeamInfo' { + # Set-VSTeamAccount is set in the Before All + # so just set the default project here + # Arrange + Set-VSTeamDefaultProject -Project 'MyProject' - $info = Get-VSTeamInfo + # Act + $info = Get-VSTeamInfo - $info.Account | Should Be "mydemos" - $info.DefaultProject | Should Be "MyProject" + # Assert + It 'should return account' { + # The account for Server is formated different than for Services + if ($acct -like "http://*") { + $info.Account | Should Be $acct + } + else { + $info.Account | Should Be "https://dev.azure.com/$($env:ACCT)" } } - Context 'Set-VSTeamAccount vsts' { - It 'should set env at process level' { - $pat = $env:PAT - $acct = $env:ACCT - $api = $env:API_VERSION - Set-VSTeamAccount -a $acct -pe $pat -version $api - - $info = Get-VSTeamInfo - - $info.DefaultProject | Should Be $null - - if ($acct -like "http://*") { - $info.Account | Should Be $acct - } - else { - $info.Account | Should Be "https://dev.azure.com/$acct" - } - } + It 'should return default project' { + $info.DefaultProject | Should Be "MyProject" } + } - Context 'Remove-TeamAccount run as normal user' { - It 'should clear env at process level' { - # Act - Remove-VSTeamAccount + Context 'Remove-VSTeamAccount run as normal user' { + It 'should clear env at process level' { + # Act + Remove-VSTeamAccount - # Assert - $info = Get-VSTeamInfo + # Assert + $info = Get-VSTeamInfo - $info.Account | Should Be '' - $info.DefaultProject | Should Be $null - } + $info.Account | Should Be '' + $info.DefaultProject | Should Be $null } } } \ No newline at end of file diff --git a/integration/test/010_projects.Tests.ps1 b/integration/test/010_projects.Tests.ps1 index ddd4f9ccb..e52ab8dcf 100644 --- a/integration/test/010_projects.Tests.ps1 +++ b/integration/test/010_projects.Tests.ps1 @@ -1,10 +1,5 @@ Set-StrictMode -Version Latest -if ($null -eq $env:TEAM_CIBUILD) { - Get-Module VSTeam | Remove-Module -Force - Import-Module $PSScriptRoot\..\..\dist\VSTeam.psd1 -Force -} - ############################################################## # THESE TEST ARE DESTRUCTIVE. USE AN EMPTY ACCOUNT. # ############################################################## @@ -22,549 +17,557 @@ if ($null -eq $env:TEAM_CIBUILD) { Set-VSTeamAPIVersion -Target $env:API_VERSION -InModuleScope VSTeam { - Describe 'VSTeam Integration Tests' -Tag 'integration' { - BeforeAll { - $pat = $env:PAT - $acct = $env:ACCT - $api = $env:API_VERSION - $email = $env:EMAIL - $projectName = 'TeamModuleIntegration' + [guid]::NewGuid().toString().substring(0, 5) - $newProjectName = $projectName + [guid]::NewGuid().toString().substring(0, 5) + '1' - - $originalLocation = Get-Location - - # The way we search for the account is different for VSTS and TFS - $search = "*$acct*" - if ($api -eq 'VSTS') { - $search = "*//$acct.*" - } +Describe 'VSTeam Integration Tests' -Tag 'integration' { + BeforeAll { + $pat = $env:PAT + $acct = $env:ACCT + $email = $env:EMAIL + $api = $env:API_VERSION + $projectName = 'TeamModuleIntegration' + [guid]::NewGuid().toString().substring(0, 5) + $newProjectName = $projectName + [guid]::NewGuid().toString().substring(0, 5) + '1' + + $originalLocation = Get-Location + + # The way we search for the account is different for VSTS and TFS + $search = "*$acct*" + if ($api -eq 'VSTS') { + $search = "*//$acct.*" + } - $oAcct = $null - $profile = Get-VSTeamProfile | Where-Object url -like $search + $oAcct = $null + $profile = Get-VSTeamProfile | Where-Object url -like $search - if ($profile) { - # Save original profile data - $oAcct = $profile.URL - $oVersion = $profile.Version - $oName = $profile.Name - } + if ($profile) { + # Save original profile data + $oAcct = $profile.URL + $oVersion = $profile.Version + $oName = $profile.Name + } - Add-VSTeamProfile -Account $acct -PersonalAccessToken $pat -Version $api -Name intTests - Set-VSTeamAccount -Profile intTests -Drive int + Add-VSTeamProfile -Account $acct -PersonalAccessToken $pat -Version $api -Name intTests + Set-VSTeamAccount -Profile intTests -Drive int + } + + AfterAll { + # Put everything back + Set-Location $originalLocation + + if ($oAcct) { + Add-VSTeamProfile -Account $oAcct -PersonalAccessToken $pat -Version $oVersion -Name $oName + Set-VSTeamAccount -Profile $oName } + } - AfterAll { - # Put everything back - Set-Location $originalLocation + Context 'Set-VSTeamDefaultProject' { + It 'should set default project' { + Set-VSTeamDefaultProject -Project 'MyProject' - if ($oAcct) { - Add-VSTeamProfile -Account $oAcct -PersonalAccessToken $pat -Version $oVersion -Name $oName - Set-VSTeamAccount -Profile $oName - } + $info = Get-VSTeamInfo + + $info.DefaultProject | Should be 'MyProject' } - Context 'Set-VSTeamDefaultProject' { - It 'should set default project' { - Set-VSTeamDefaultProject 'MyProject' + It 'should update default project' { + Set-VSTeamDefaultProject -Project $newProjectName - $Global:PSDefaultParameterValues['*:projectName'] | Should be 'MyProject' - } + $info = Get-VSTeamInfo + + $info.DefaultProject | Should be $newProjectName + } + } - It 'should update default project' { - $Global:PSDefaultParameterValues['*:projectName'] = 'MyProject' + Context 'Clear-VSTeamDefaultProject' { + It 'should clear default project' { + Set-VSTeamDefaultProject -Project 'MyProject' - Set-VSTeamDefaultProject -Project 'NextProject' + Clear-VSTeamDefaultProject - $Global:PSDefaultParameterValues['*:projectName'] | Should be 'NextProject' - } + $info = Get-VSTeamInfo + + $info.DefaultProject | Should BeNullOrEmpty } + } - Context 'Clear-VSTeamDefaultProject' { - It 'should clear default project' { - $Global:PSDefaultParameterValues['*:projectName'] = 'MyProject' + Context 'Profile full exercise' { + It 'Get-VSTeamProfile' { + Get-VSTeamProfile inttests | Should Not Be $null + } - Clear-VSTeamDefaultProject + It 'Remove-VSTeamProfile' { + Remove-VSTeamProfile inttests -Force + } + } - $Global:PSDefaultParameterValues['*:projectName'] | Should BeNullOrEmpty - } + Context 'Project full exercise' { + It 'Add-VSTeamProject Should create project' { + Add-VSTeamProject -Name $projectName | Should Not Be $null } - Context 'Profile full exercise' { - It 'Get-VSTeamProfile' { - Get-VSTeamProfile inttests | Should Not Be $null - } + It 'Get-VSTeamProject Should return projects' { + Get-VSTeamProject -Name $projectName -IncludeCapabilities | Should Not Be $null + } - It 'Remove-VSTeamProfile' { - Remove-VSTeamProfile inttests -Force - } + It 'Update-VSTeamProject Should update description' { + Update-VSTeamProject -Name $projectName -NewDescription 'Test Description' -Force + + Get-VSTeamProject -Name $projectName | Select-Object -ExpandProperty 'Description' | Should Be 'Test Description' } - Context 'Project full exercise' { - It 'Add-VSTeamProject Should create project' { - Add-VSTeamProject -Name $projectName | Should Not Be $null - } + It 'Update-VSTeamProject Should update name' { + Update-VSTeamProject -Name $projectName -NewName $newProjectName -Force - It 'Get-VSTeamProject Should return projects' { - Get-VSTeamProject -Name $projectName -IncludeCapabilities | Should Not Be $null - } + Get-VSTeamProject -Name $newProjectName | Select-Object -ExpandProperty 'Description' | Should Be 'Test Description' + } + } - It 'Update-VSTeamProject Should update description' { - Update-VSTeamProject -Name $projectName -NewDescription 'Test Description' -Force + Context 'PS Drive full exercise' { + New-PSDrive -Name int -PSProvider SHiPS -Root 'VSTeam#VSTeamAccount' + $actual = Set-Location int: -PassThru - Get-VSTeamProject -Name $projectName | Select-Object -ExpandProperty 'Description' | Should Be 'Test Description' - } + It 'Should be able to mount drive' { + $actual | Should Not Be $null + } - It 'Update-VSTeamProject Should update name' { - Update-VSTeamProject -Name $projectName -NewName $newProjectName -Force + It 'Should list projects' { + Get-ChildItem | Should Not Be $null + } - Get-VSTeamProject -Name $newProjectName | Select-Object -ExpandProperty 'Description' | Should Be 'Test Description' - } + It 'Should list Builds, Releases and Teams' { + Set-Location $newProjectName + Get-ChildItem | Should Not Be $null } - Context 'PS Drive full exercise' { - New-PSDrive -Name int -PSProvider SHiPS -Root 'VSTeam#VSTeamAccount' - $actual = Set-Location int: -PassThru + It 'Should list Teams' { + Set-Location 'Teams' + Get-ChildItem | Should Not Be $null + } + } - It 'Should be able to mount drive' { - $actual | Should Not Be $null - } + Context 'Git full exercise' { - It 'Should list projects' { - Get-ChildItem | Should Not Be $null - } + It 'Get-VSTeamGitRepository Should return repository' { + Get-VSTeamGitRepository -ProjectName $newProjectName | Select-Object -ExpandProperty Name | Should Be $newProjectName + } - It 'Should list Builds, Releases and Teams' { - Set-Location $newProjectName - Get-ChildItem | Should Not Be $null - } + It 'Add-VSTeamGitRepository Should create repository' { + Add-VSTeamGitRepository -ProjectName $newProjectName -Name 'testing' + (Get-VSTeamGitRepository -ProjectName $newProjectName).Count | Should Be 2 + Get-VSTeamGitRepository -ProjectName $newProjectName -Name 'testing' | Select-Object -ExpandProperty Name | Should Be 'testing' + } - It 'Should list Teams' { - Set-Location 'Teams' - Get-ChildItem | Should Not Be $null - } + It 'Remove-VSTeamGitRepository Should delete repository' { + Get-VSTeamGitRepository -ProjectName $newProjectName -Name 'testing' | Select-Object -ExpandProperty Id | Remove-VSTeamGitRepository -Force + Get-VSTeamGitRepository -ProjectName $newProjectName | Where-Object { $_.Name -eq 'testing' } | Should Be $null } + } - Context 'Git full exercise' { + Context 'BuildDefinition full exercise' { - It 'Get-VSTeamGitRepository Should return repository' { - Get-VSTeamGitRepository -ProjectName $newProjectName | Select-Object -ExpandProperty Name | Should Be $newProjectName - } + Add-VSTeamGitRepository -ProjectName $newProjectName -Name 'CI' + $project = $repo = Get-VSTeamProject -Name $newProjectName + $repo = Get-VSTeamGitRepository -ProjectName $newProjectName -Name 'CI' - It 'Add-VSTeamGitRepository Should create repository' { - Add-VSTeamGitRepository -ProjectName $newProjectName -Name 'testing' - (Get-VSTeamGitRepository -ProjectName $newProjectName).Count | Should Be 2 - Get-VSTeamGitRepository -ProjectName $newProjectName -Name 'testing' | Select-Object -ExpandProperty Name | Should Be 'testing' - } + if ($acct -like "http://*") { + $defaultQueue = Get-VSTeamQueue -ProjectName $newProjectName | Where-Object { $_.poolName -eq "Default" } + } + else { + $defaultQueue = Get-VSTeamQueue -ProjectName $newProjectName | Where-Object { $_.poolName -eq "Hosted" } + } - It 'Remove-VSTeamGitRepository Should delete repository' { - Get-VSTeamGitRepository -ProjectName $newProjectName -Name 'testing' | Select-Object -ExpandProperty Id | Remove-VSTeamGitRepository -Force - Get-VSTeamGitRepository -ProjectName $newProjectName | Where-Object { $_.Name -eq 'testing' } | Should Be $null + $srcBuildDef = Get-Content "$PSScriptRoot\sampleFiles\010_builddef_1.json" -Raw | ConvertFrom-Json + $srcBuildDef.project.id = $project.Id + $srcBuildDef.queue.id = $defaultQueue.Id + $srcBuildDef.repository.id = $repo.Id + $srcBuildDef.name = $newProjectName + "-CI1" + $tmpBuildDef1 = (New-TemporaryFile).FullName + $srcBuildDef | ConvertTo-Json -Depth 10 | Set-Content -Path $tmpBuildDef1 + + $srcBuildDef = Get-Content "$PSScriptRoot\sampleFiles\010_builddef_2.json" -Raw | ConvertFrom-Json + $srcBuildDef.project.id = $project.Id + $srcBuildDef.queue.id = $defaultQueue.Id + $srcBuildDef.repository.id = $repo.Id + $srcBuildDef.name = $newProjectName + "-CI2" + $tmpBuildDef2 = (New-TemporaryFile).FullName + $srcBuildDef | ConvertTo-Json -Depth 10 | Set-Content -Path $tmpBuildDef2 + + It 'Add-VSTeamBuildDefinition should add a build definition' { + Add-VSTeamBuildDefinition -ProjectName $newProjectName -InFile $tmpBuildDef1 + $buildDef = Get-VSTeamBuildDefinition -ProjectName $newProjectName + $buildDef | Should Not Be $null + } + + It 'Add-VSTeamBuildDefinition should add another build definition' { + Add-VSTeamBuildDefinition -ProjectName $newProjectName -InFile $tmpBuildDef2 + $buildDefs = Get-VSTeamBuildDefinition -ProjectName $newProjectName + $buildDefs.Count | Should Be 2 + } + + It 'Get-VSTeamBuildDefinition by Type "build" should return 2 build definitions' { + $buildDefs = Get-VSTeamBuildDefinition -ProjectName $newProjectName -Type build + $buildDefs.Count | Should Be 2 + } + + ### issue #87 validity of this test needs to be checked first + # It 'Get-VSTeamBuildDefinition by Type "xaml" should return no build definitions' { + # $buildDefs = Get-VSTeamBuildDefinition -ProjectName $newProjectName -Type xaml + # $buildDefs.Count | Should Be 0 + # } + + # Only run for VSTS + if ($api -eq 'VSTS') { + It 'Get-VSTeamBuildDefinition by Id should return intended attribute values for 1st build definition' { + $buildDefId = (Get-VSTeamBuildDefinition -ProjectName $newProjectName | Where-Object { $_.Name -eq $($newProjectName + "-CI1") }).Id + $buildDefId | Should Not Be $null + $buildDef = Get-VSTeamBuildDefinition -ProjectName $newProjectName -Id $buildDefId + $buildDef.Name | Should Be $($newProjectName + "-CI1") + $buildDef.GitRepository | Should Not be $null + $buildDef.Process.Phases.Count | Should Be 1 + $buildDef.Process.Phases[0].Name | Should Be "Phase 1" + $buildDef.Process.Phases[0].Steps.Count | Should Be 1 + $buildDef.Process.Phases[0].Steps[0].Name | Should Be "PowerShell Script" + $buildDef.Process.Phases[0].Steps[0].Inputs.targetType | Should Be "inline" + } + + It 'Get-VSTeamBuildDefinition by Id should return 2 phases for 2nd build definition' { + $buildDefId = (Get-VSTeamBuildDefinition -ProjectName $newProjectName | Where-Object { $_.Name -eq $($newProjectName + "-CI2") }).Id + ((Get-VSTeamBuildDefinition -ProjectName $newProjectName -Id $buildDefId).Process.Phases).Count | Should Be 2 } } - Context 'BuildDefinition full exercise' { + It 'Remove-VSTeamBuildDefinition should delete build definition' { + Get-VSTeamBuildDefinition -ProjectName $newProjectName | Remove-VSTeamBuildDefinition -ProjectName $newProjectName -Force + Get-VSTeamBuildDefinition -ProjectName $newProjectName | Should Be $null + } + } - Add-VSTeamGitRepository -ProjectName $newProjectName -Name 'CI' - $project = $repo = Get-VSTeamProject -Name $newProjectName - $repo = Get-VSTeamGitRepository -ProjectName $newProjectName -Name 'CI' + Context 'Pool full exercise' { + It 'Get-VSTeamPool Should return agent pools' { + $actual = Get-VSTeamPool + # Test differently for TFS and VSTS if ($acct -like "http://*") { - $defaultQueue = Get-VSTeamQueue -ProjectName $newProjectName | Where-Object { $_.poolName -eq "Default" } + $actual.name | Should Be 'Default' } else { - $defaultQueue = Get-VSTeamQueue -ProjectName $newProjectName | Where-Object { $_.poolName -eq "Hosted" } + $actual.Count | Should -Not -Be 0 } + } + } - $srcBuildDef = Get-Content $(Join-Path $PSScriptRoot "010_builddef_1.json") | ConvertFrom-Json - $srcBuildDef.project.id = $project.Id - $srcBuildDef.queue.id = $defaultQueue.Id - $srcBuildDef.repository.id = $repo.Id - $srcBuildDef.name = $newProjectName + "-CI1" - $tmpBuildDef1 = (New-TemporaryFile).FullName - $srcBuildDef | ConvertTo-Json -Depth 10 | Set-Content -Path $tmpBuildDef1 - - $srcBuildDef = Get-Content $(Join-Path $PSScriptRoot "010_builddef_2.json") | ConvertFrom-Json - $srcBuildDef.project.id = $project.Id - $srcBuildDef.queue.id = $defaultQueue.Id - $srcBuildDef.repository.id = $repo.Id - $srcBuildDef.name = $newProjectName + "-CI2" - $tmpBuildDef2 = (New-TemporaryFile).FullName - $srcBuildDef | ConvertTo-Json -Depth 10 | Set-Content -Path $tmpBuildDef2 - - It 'Add-VSTeamBuildDefinition should add a build definition' { - Add-VSTeamBuildDefinition -ProjectName $newProjectName -InFile $tmpBuildDef1 - $buildDef = Get-VSTeamBuildDefinition -ProjectName $newProjectName - $buildDef | Should Not Be $null + Context 'Agent full exercise' { + It 'Get-VSTeamAgent Should return agents' { + if ($acct -like "http://*") { + $pool = (Get-VSTeamPool)[0] } - - It 'Add-VSTeamBuildDefinition should add another build definition' { - Add-VSTeamBuildDefinition -ProjectName $newProjectName -InFile $tmpBuildDef2 - $buildDefs = Get-VSTeamBuildDefinition -ProjectName $newProjectName - $buildDefs.Count | Should Be 2 + else { + # Grabbing the first hosted pool on VSTS. Skipping index 0 which is + # default and is empty on some accounts + $pool = (Get-VSTeamPool)[1] } + $actual = Get-VSTeamAgent -PoolId $pool.Id - It 'Get-VSTeamBuildDefinition by Type "build" should return 2 build definitions' { - $buildDefs = Get-VSTeamBuildDefinition -ProjectName $newProjectName -Type build - $buildDefs.Count | Should Be 2 - } + $actual | Should Not Be $null + } + } - ### issue #87 validity of this test needs to be checked first - # It 'Get-VSTeamBuildDefinition by Type "xaml" should return no build definitions' { - # $buildDefs = Get-VSTeamBuildDefinition -ProjectName $newProjectName -Type xaml - # $buildDefs.Count | Should Be 0 - # } - - # Only run for VSTS - if ($api -eq 'VSTS') { - It 'Get-VSTeamBuildDefinition by Id should return intended attribute values for 1st build definition' { - $buildDefId = (Get-VSTeamBuildDefinition -ProjectName $newProjectName | Where-Object { $_.Name -eq $($newProjectName + "-CI1") }).Id - $buildDefId | Should Not Be $null - $buildDef = Get-VSTeamBuildDefinition -ProjectName $newProjectName -Id $buildDefId - $buildDef.Name | Should Be $($newProjectName + "-CI1") - $buildDef.GitRepository | Should Not be $null - $buildDef.Process.Phases.Count | Should Be 1 - $buildDef.Process.Phases[0].Name | Should Be "Phase 1" - $buildDef.Process.Phases[0].Steps.Count | Should Be 1 - $buildDef.Process.Phases[0].Steps[0].Name | Should Be "PowerShell Script" - $buildDef.Process.Phases[0].Steps[0].Inputs.targetType | Should Be "inline" - } + Context 'Queue full exercise' { + It 'Get-VSTeamQueue Should return agent Queues' { + $actual = Get-VSTeamQueue -ProjectName $newProjectName - It 'Get-VSTeamBuildDefinition by Id should return 2 phases for 2nd build definition' { - $buildDefId = (Get-VSTeamBuildDefinition -ProjectName $newProjectName | Where-Object { $_.Name -eq $($newProjectName + "-CI2") }).Id - ((Get-VSTeamBuildDefinition -ProjectName $newProjectName -Id $buildDefId).Process.Phases).Count | Should Be 2 - } + if ($acct -like "http://*") { + $global:queueId = $actual.id + $actual.name | Should Be 'Default' } - - It 'Remove-VSTeamBuildDefinition should delete build definition' { - Get-VSTeamBuildDefinition -ProjectName $newProjectName | Remove-VSTeamBuildDefinition -ProjectName $newProjectName -Force - Get-VSTeamBuildDefinition -ProjectName $newProjectName | Should Be $null + else { + $global:queueId = $actual[0].id + $actual.Count | Should -Not -Be 0 } } - Context 'Pool full exercise' { - It 'Get-VSTeamPool Should return agent pools' { - $actual = Get-VSTeamPool + It 'Get-VSTeamQueue By Id Should return agent Queue' { + $actual = Get-VSTeamQueue -ProjectName $newProjectName -Id $global:queueId - # Test differently for TFS and VSTS - if ($acct -like "http://*") { - $actual.name | Should Be 'Default' - } - else { - $actual.Count | Should -Not -Be 0 - } - } + $actual | Should Not Be $null } + } - Context 'Agent full exercise' { - It 'Get-VSTeamAgent Should return agents' { - if ($acct -like "http://*") { - $pool = (Get-VSTeamPool)[0] - } - else { - # Grabbing the first hosted pool on VSTS. Skipping index 0 which is - # default and is empty on some accounts - $pool = (Get-VSTeamPool)[1] - } - $actual = Get-VSTeamAgent -PoolId $pool.Id + Context 'Get Service Endpoint types' { + It 'Get-VSTeamServiceEndpointType' { + Get-VSTeamServiceEndpointType | Should Not Be $null + } + } - $actual | Should Not Be $null - } + Context 'Get Work Item Types' { + It 'Get-VSTeamWorkItemType' { + Get-VSTeamWorkItemType -ProjectName $newProjectName | Should Not Be $null } - Context 'Queue full exercise' { - It 'Get-VSTeamQueue Should return agent Queues' { - $actual = Get-VSTeamQueue -ProjectName $newProjectName + It 'Get-VSTeamWorkItemType By Type' { + Get-VSTeamWorkItemType -ProjectName $newProjectName -WorkItemType Bug | Should Not Be $null + } + } - if ($acct -like "http://*") { - $global:queueId = $actual.id - $actual.name | Should Be 'Default' - } - else { - $global:queueId = $actual[0].id - $actual.Count | Should -Not -Be 0 + Context 'Simple Variable Group' { + $variableGroupName = "TestVariableGroup1" + $variableGroupUpdatedName = "TestVariableGroup2" + It 'Add-VSTeamVariableGroup Should add a variable group' { + $parameters = @{ + ProjectName = $newProjectName + Name = $variableGroupName + Description = "A test variable group" + Variables = @{ + key1 = @{ + value = "value1" + } + key2 = @{ + value = "value2" + isSecret = $true + } } } - - It 'Get-VSTeamQueue By Id Should return agent Queue' { - $actual = Get-VSTeamQueue -ProjectName $newProjectName -Id $global:queueId - - $actual | Should Not Be $null + if ($api -ne 'TFS2017') { + $parameters.Add("Type", "Vsts") } - } - Context 'Get Service Endpoint types' { - It 'Get-VSTeamServiceEndpointType' { - Get-VSTeamServiceEndpointType | Should Not Be $null - } + $newVariableGroup = Add-VSTeamVariableGroup @parameters + $newVariableGroup | Should Not Be $null } - Context 'Get Work Item Types' { - It 'Get-VSTeamWorkItemType' { - Get-VSTeamWorkItemType -ProjectName $newProjectName | Should Not Be $null - } + It 'Get-VSTeamVariableGroup Should get the variable group created first by list then by id' { + $existingVariableGroups = , (Get-VSTeamVariableGroup -ProjectName $newProjectName) + $existingVariableGroups.Count | Should BeGreaterThan 0 - It 'Get-VSTeamWorkItemType By Type' { - Get-VSTeamWorkItemType -ProjectName $newProjectName -WorkItemType Bug | Should Not Be $null - } + $newVariableGroup = ($existingVariableGroups | Where-Object { $_.Name -eq $variableGroupName }) + $newVariableGroup | Should Not Be $null + + $existingVariableGroup = Get-VSTeamVariableGroup -ProjectName $newProjectName -Id $newVariableGroup.Id + $existingVariableGroup | Should Not Be $null } - Context 'Simple Variable Group' { - $variableGroupName = "TestVariableGroup1" - $variableGroupUpdatedName = "TestVariableGroup2" - It 'Add-VSTeamVariableGroup Should add a variable group' { - $parameters = @{ - ProjectName = $newProjectName - Name = $variableGroupName - Description = "A test variable group" - Variables = @{ - key1 = @{ - value = "value1" - } - key2 = @{ - value = "value2" - isSecret = $true - } + It 'Update-VSTeamVariableGroup Should update the variable group' { + $newVariableGroup = (Get-VSTeamVariableGroup -ProjectName $newProjectName | Where-Object { $_.Name -eq $variableGroupName }) + $newVariableGroup | Should Not Be $null + + $parameters = @{ + ProjectName = $newProjectName + Id = $newVariableGroup.Id + Name = $variableGroupUpdatedName + Description = "A test variable group update" + Variables = @{ + key3 = @{ + value = "value3" } } - if ($api -ne 'TFS2017') { - $parameters.Add("Type", "Vsts") - } - - $newVariableGroup = Add-VSTeamVariableGroup @parameters - $newVariableGroup | Should Not Be $null } - - It 'Get-VSTeamVariableGroup Should get the variable group created first by list then by id' { - $existingVariableGroups = ,(Get-VSTeamVariableGroup -ProjectName $newProjectName) - $existingVariableGroups.Count | Should BeGreaterThan 0 - - $newVariableGroup = ($existingVariableGroups | Where-Object { $_.Name -eq $variableGroupName }) - $newVariableGroup | Should Not Be $null - - $existingVariableGroup = Get-VSTeamVariableGroup -ProjectName $newProjectName -Id $newVariableGroup.Id - $existingVariableGroup | Should Not Be $null + if ($api -ne 'TFS2017') { + $parameters.Add("Type", "Vsts") } - It 'Update-VSTeamVariableGroup Should update the variable group' { - $newVariableGroup = (Get-VSTeamVariableGroup -ProjectName $newProjectName | Where-Object { $_.Name -eq $variableGroupName }) - $newVariableGroup | Should Not Be $null - - $parameters = @{ - ProjectName = $newProjectName - Id = $newVariableGroup.Id - Name = $variableGroupUpdatedName - Description = "A test variable group update" - Variables = @{ - key3 = @{ - value = "value3" - } - } - } - if ($api -ne 'TFS2017') { - $parameters.Add("Type", "Vsts") - } - - $updatedVariableGroup = Update-VSTeamVariableGroup @parameters - $updatedVariableGroup | Should Not Be $null - } + $updatedVariableGroup = Update-VSTeamVariableGroup @parameters + $updatedVariableGroup | Should Not Be $null + } - It 'Remove-VSTeamVariableGroup Should remove the variable group' { - $updatedVariableGroup = (Get-VSTeamVariableGroup -ProjectName $newProjectName | Where-Object { $_.Name -eq $variableGroupUpdatedName }) - $updatedVariableGroup | Should Not Be $null - {Remove-VSTeamVariableGroup -ProjectName $newProjectName -Id $updatedVariableGroup.Id -Force} | Should Not Throw - } + It 'Remove-VSTeamVariableGroup Should remove the variable group' { + $updatedVariableGroup = (Get-VSTeamVariableGroup -ProjectName $newProjectName | Where-Object { $_.Name -eq $variableGroupUpdatedName }) + $updatedVariableGroup | Should Not Be $null + { Remove-VSTeamVariableGroup -ProjectName $newProjectName -Id $updatedVariableGroup.Id -Force } | Should Not Throw } + } - Context 'Service Endpoints full exercise' { - It 'Add-VSTeamSonarQubeEndpoint Should add service endpoint' { - { Add-VSTeamSonarQubeEndpoint -ProjectName $newProjectName -EndpointName 'TestSonarQube' ` - -SonarQubeURl 'http://sonarqube.somewhereIn.cloudapp.azure.com:9000' -PersonalAccessToken 'Faketoken' } | Should Not Throw - } + Context 'Service Endpoints full exercise' { + It 'Add-VSTeamSonarQubeEndpoint Should add service endpoint' { + { Add-VSTeamSonarQubeEndpoint -ProjectName $newProjectName -EndpointName 'TestSonarQube' ` + -SonarQubeURl 'http://sonarqube.somewhereIn.cloudapp.azure.com:9000' -PersonalAccessToken 'Faketoken' } | Should Not Throw + } - It 'Add-VSTeamAzureRMServiceEndpoint Should add service endpoint' { - { Add-VSTeamAzureRMServiceEndpoint -ProjectName $newProjectName -displayName 'AzureEndoint' ` - -subscriptionId '00000000-0000-0000-0000-000000000000' -subscriptionTenantId '00000000-0000-0000-0000-000000000000' ` - -servicePrincipalId '00000000-0000-0000-0000-000000000000' -servicePrincipalKey 'fakekey' } | Should Not Throw - } + It 'Add-VSTeamAzureRMServiceEndpoint Should add service endpoint' { + { Add-VSTeamAzureRMServiceEndpoint -ProjectName $newProjectName -displayName 'AzureEndoint' ` + -subscriptionId '00000000-0000-0000-0000-000000000000' -subscriptionTenantId '00000000-0000-0000-0000-000000000000' ` + -servicePrincipalId '00000000-0000-0000-0000-000000000000' -servicePrincipalKey 'fakekey' } | Should Not Throw + } - It 'Get-VSTeamServiceEndpoint Should return service endpoints' { - $actual = Get-VSTeamServiceEndpoint -ProjectName $newProjectName + It 'Get-VSTeamServiceEndpoint Should return service endpoints' { + $actual = Get-VSTeamServiceEndpoint -ProjectName $newProjectName - $actual.Count | Should Be 2 - } + $actual.Count | Should Be 2 + } - It 'Remove-VSTeamServiceEndpoint Should delete service endpoints' { - Get-VSTeamServiceEndpoint -ProjectName $newProjectName | Remove-VSTeamServiceEndpoint -ProjectName $newProjectName -Force + It 'Remove-VSTeamServiceEndpoint Should delete service endpoints' { + Get-VSTeamServiceEndpoint -ProjectName $newProjectName | Remove-VSTeamServiceEndpoint -ProjectName $newProjectName -Force - Get-VSTeamServiceEndpoint -ProjectName $newProjectName | Should Be $null - } + Get-VSTeamServiceEndpoint -ProjectName $newProjectName | Should Be $null + } - # Not supported on TFS 2017 - if ($api -ne 'TFS2017') { - It 'Add-VSTeamServiceFabricEndpoint Should add service endpoint' { - { Add-VSTeamServiceFabricEndpoint -ProjectName $newProjectName -endpointName 'ServiceFabricTestEndoint' ` - -url "tcp://10.0.0.1:19000" -useWindowsSecurity $false } | Should Not Be $null - } + # Not supported on TFS 2017 + if ($api -ne 'TFS2017') { + It 'Add-VSTeamServiceFabricEndpoint Should add service endpoint' { + { Add-VSTeamServiceFabricEndpoint -ProjectName $newProjectName -endpointName 'ServiceFabricTestEndoint' ` + -url "tcp://10.0.0.1:19000" -useWindowsSecurity $false } | Should Not Be $null } - else { - It 'Add-VSTeamServiceFabricEndpoint not supported on TFS2017 Should throw' { - { Add-VSTeamServiceFabricEndpoint -ProjectName $newProjectName -endpointName 'ServiceFabricTestEndoint' ` - -url "tcp://10.0.0.1:19000" -useWindowsSecurity $false } | Should Throw - } + } + else { + It 'Add-VSTeamServiceFabricEndpoint not supported on TFS2017 Should throw' { + { Add-VSTeamServiceFabricEndpoint -ProjectName $newProjectName -endpointName 'ServiceFabricTestEndoint' ` + -url "tcp://10.0.0.1:19000" -useWindowsSecurity $false } | Should Throw } } + } - # Not supported on TFS - if (-not ($acct -like "http://*")) { - Context 'Users exercise' { + # Not supported on TFS + if (-not ($acct -like "http://*")) { + Context 'Users exercise' { - It 'Get-VSTeamUserEntitlement Should return all users' { - Get-VSTeamUserEntitlement | Should Not Be $null - } + It 'Get-VSTeamUserEntitlement Should return all users' { + Get-VSTeamUserEntitlement | Should Not Be $null + } - It 'Get-VSTeamUserEntitlement ById Should return Teams' { - $id = (Get-VSTeamUserEntitlement | Where-Object email -eq $email).Id - Get-VSTeamUserEntitlement -Id $id | Should Not Be $null - } + It 'Get-VSTeamUserEntitlement ById Should return Teams' { + $id = (Get-VSTeamUserEntitlement | Where-Object email -eq $email).Id + Get-VSTeamUserEntitlement -Id $id | Should Not Be $null + } - It 'Remove-VSTeamUserEntitlement should fail' { - { Remove-VSTeamUserEntitlement -Email fake@NoteReal.foo -Force } | Should Throw - } + It 'Remove-VSTeamUserEntitlement should fail' { + { Remove-VSTeamUserEntitlement -Email fake@NoteReal.foo -Force } | Should Throw + } - It 'Remove-VSTeamUserEntitlement should delete the user' { - Remove-VSTeamUserEntitlement -Email $email -Force - Get-VSTeamUserEntitlement | Where-Object Email -eq $email | Should Be $null - } + It 'Remove-VSTeamUserEntitlement should delete the user' { + Remove-VSTeamUserEntitlement -Email $email -Force + Get-VSTeamUserEntitlement | Where-Object Email -eq $email | Should Be $null + } - It 'Add-VSTeamUserEntitlement should add a user' { - Add-VSTeamUserEntitlement -Email $email -License StakeHolder | Should Not Be $null - (Get-VSTeamUserEntitlement).Count | Should Be 3 - } + It 'Add-VSTeamUserEntitlement should add a user' { + Add-VSTeamUserEntitlement -Email $email -License StakeHolder | Should Not Be $null + (Get-VSTeamUserEntitlement).Count | Should Be 3 + } - It 'Remove-VSTeamUserEntitlement should delete the user' { - Remove-VSTeamUserEntitlement -Email $email -Force - Get-VSTeamUserEntitlement | Where-Object Email -eq $email | Should Be $null - } + It 'Remove-VSTeamUserEntitlement should delete the user' { + Remove-VSTeamUserEntitlement -Email $email -Force + Get-VSTeamUserEntitlement | Where-Object Email -eq $email | Should Be $null + } - It 'Add-VSTeamUserEntitlement should add a user with MSDN license' { - Add-VSTeamUserEntitlement -Email $email -License none -LicensingSource msdn -MSDNLicenseType professional | Should not be $null - (Get-VSTeamUserEntitlement).Count | Should Be 3 - } + It 'Add-VSTeamUserEntitlement should add a user with MSDN license' { + Add-VSTeamUserEntitlement -Email $email -License none -LicensingSource msdn -MSDNLicenseType professional | Should not be $null + (Get-VSTeamUserEntitlement).Count | Should Be 3 } } + } - # Not supported on TFS - if (-not ($acct -like "http://*")) { + # Not supported on TFS + if (-not ($acct -like "http://*")) { - $FeedName = 'TeamModuleIntegration' + [guid]::NewGuid().toString().substring(0, 5) + $FeedName = 'TeamModuleIntegration' + [guid]::NewGuid().toString().substring(0, 5) - Context 'Feed exercise' { + Context 'Feed exercise' { - It 'Add-VSTeamFeed should add a feed' { - Add-VSTeamFeed -Name $FeedName | Should Not Be $null - } + It 'Add-VSTeamFeed should add a feed' { + Add-VSTeamFeed -Name $FeedName | Should Not Be $null + } - It 'Get-VSTeamFeed Should return all feeds' { - Get-VSTeamFeed | Should Not Be $null - } + It 'Get-VSTeamFeed Should return all feeds' { + Get-VSTeamFeed | Should Not Be $null + } - It 'Get-VSTeamFeed ById Should return feed' { - $FeedID = (Get-VSTeamFeed | Where-Object name -eq $FeedName).Id - Get-VSTeamFeed -Id $FeedID | Should Not Be $null - } + It 'Get-VSTeamFeed ById Should return feed' { + $FeedID = (Get-VSTeamFeed | Where-Object name -eq $FeedName).Id + Get-VSTeamFeed -Id $FeedID | Should Not Be $null + } - It 'Remove-VSTeamFeed should fail' { - { Remove-VSTeamFeed -Id '00000000-0000-0000-0000-000000000000' -Force } | Should Throw - } + It 'Remove-VSTeamFeed should fail' { + { Remove-VSTeamFeed -Id '00000000-0000-0000-0000-000000000000' -Force } | Should Throw + } - It 'Remove-VSTeamFeed should delete the feed' { - Get-VSTeamFeed | Remove-VSTeamFeed -Force - Get-VSTeamFeed | Where-Object name -eq $FeedName | Should Be $null - } + It 'Remove-VSTeamFeed should delete the feed' { + Get-VSTeamFeed | Remove-VSTeamFeed -Force + Get-VSTeamFeed | Where-Object name -eq $FeedName | Should Be $null } } + } - # Not supported on TFS - if (-not ($acct -like "http://*")) { - Context 'Access control list' { - It 'Get-VSTeamAccessControlList should return without error' { - $(Get-VSTeamSecurityNamespace | Select-Object -First 1 | Get-VSTeamAccessControlList) | Should Not Be $null - } + # Not supported on TFS + if (-not ($acct -like "http://*")) { + Context 'Access control list' { + It 'Get-VSTeamAccessControlList should return without error' { + $(Get-VSTeamSecurityNamespace | Select-Object -First 1 | Get-VSTeamAccessControlList) | Should Not Be $null + } - It 'Get-VSTeamAccessControlList -IncludeExtendedInfo should return without error' { - $(Get-VSTeamSecurityNamespace | Select-Object -First 1 | Get-VSTeamAccessControlList -IncludeExtendedInfo) | Should Not Be $null - } + It 'Get-VSTeamAccessControlList -IncludeExtendedInfo should return without error' { + $(Get-VSTeamSecurityNamespace | Select-Object -First 1 | Get-VSTeamAccessControlList -IncludeExtendedInfo) | Should Not Be $null } } + } - Context 'Teams full exercise' { - It 'Get-VSTeam ByName Should return Teams' { - Get-VSTeam -ProjectName $newProjectName -Name "$newProjectName Team" | Should Not Be $null - } + Context 'Teams full exercise' { + It 'Get-VSTeam ByName Should return Teams' { + Get-VSTeam -ProjectName $newProjectName -Name "$newProjectName Team" | Should Not Be $null + } - $global:id = (Get-VSTeam -ProjectName $newProjectName).Id + $global:id = (Get-VSTeam -ProjectName $newProjectName).Id - It 'Get-VSTeam ById Should return Teams' { - Get-VSTeam -ProjectName $newProjectName -Id $global:id | Should Not Be $null - } + It 'Get-VSTeam ById Should return Teams' { + Get-VSTeam -ProjectName $newProjectName -Id $global:id | Should Not Be $null + } - It 'Get-VSTeamMembers Should return TeamMembers' { - Get-VSTeamMember -ProjectName $newProjectName -TeamId $global:id | Should Not Be $null - } + It 'Get-VSTeamMembers Should return TeamMembers' { + Get-VSTeamMember -ProjectName $newProjectName -TeamId $global:id | Should Not Be $null + } - It 'Add-VSTeam should add a team' { - Add-VSTeam -ProjectName $newProjectName -Name 'testing' | Should Not Be $null - (Get-VSTeam -ProjectName $newProjectName).Count | Should Be 2 - } + It 'Add-VSTeam should add a team' { + Add-VSTeam -ProjectName $newProjectName -Name 'testing' | Should Not Be $null + (Get-VSTeam -ProjectName $newProjectName).Count | Should Be 2 + } - It 'Update-VSTeam should update a team' { - Update-VSTeam -ProjectName $newProjectName -Name 'testing' -NewTeamName 'testing123' - Get-VSTeam -ProjectName $newProjectName -Name 'testing123' | Should Not Be $null - } + It 'Update-VSTeam should update a team' { + Update-VSTeam -ProjectName $newProjectName -Name 'testing' -NewTeamName 'testing123' + Get-VSTeam -ProjectName $newProjectName -Name 'testing123' | Should Not Be $null + } - It 'Remove-VSTeam should delete the team' { - Remove-VSTeam -ProjectName $newProjectName -Name 'testing123' -Force - Get-VSTeam -ProjectName $newProjectName | Where-Object { $_.Name -eq 'testing123' } | Should Be $null - } + It 'Remove-VSTeam should delete the team' { + Remove-VSTeam -ProjectName $newProjectName -Name 'testing123' -Force + Get-VSTeam -ProjectName $newProjectName | Where-Object { $_.Name -eq 'testing123' } | Should Be $null } + } - Context 'Team full exercise' { - It 'Set-VSTeamAPIVersion to TFS2018' { - Set-VSTeamAPIVersion TFS2018 + Context 'Team full exercise' { + It 'Set-VSTeamAPIVersion to TFS2018' { + Set-VSTeamAPIVersion TFS2018 - [VSTeamVersions]::Version | Should Be 'TFS2018' - } + $info = Get-VSTeamInfo - It 'Set-VSTeamAPIVersion to TFS2017' { - Set-VSTeamAPIVersion TFS2017 + $info.Version | Should Be 'TFS2018' + } - [VSTeamVersions]::Version | Should Be 'TFS2017' - } + It 'Set-VSTeamAPIVersion to TFS2017' { + Set-VSTeamAPIVersion TFS2017 - It 'Clear-VSTeamDefaultProject should clear project' { - $Global:PSDefaultParameterValues['*:projectName'] = $newProjectName + $info = Get-VSTeamInfo - Clear-VSTeamDefaultProject + $info.Version | Should Be 'TFS2017' + } - $Global:PSDefaultParameterValues['*:projectName'] | Should BeNullOrEmpty - } + It 'Clear-VSTeamDefaultProject should clear project' { + Set-VSTeamDefaultProject -Project $newProjectName - It 'Remove-VSTeamProject Should remove Project' { - Set-VSTeamAPIVersion $env:API_VERSION + Clear-VSTeamDefaultProject - # I have noticed that if the delete happens too soon you will get a - # 400 response and told to try again later. So this test needs to be - # retried. We need to wait a minute after the rename before we try - # and delete - Start-Sleep -Seconds 60 + $info = Get-VSTeamInfo - Remove-VSTeamProject -ProjectName $newProjectName -Force - } + $info.DefaultProject | Should BeNullOrEmpty + } - It 'Remove-VSTeamAccount Should remove account' { - Remove-VSTeamAccount - } + It 'Remove-VSTeamProject Should remove Project' { + Set-VSTeamAPIVersion $env:API_VERSION + + # I have noticed that if the delete happens too soon you will get a + # 400 response and told to try again later. So this test needs to be + # retried. We need to wait a minute after the rename before we try + # and delete + Start-Sleep -Seconds 60 + + Remove-VSTeamProject -ProjectName $newProjectName -Force + } + + It 'Remove-VSTeamAccount Should remove account' { + Remove-VSTeamAccount } } } \ No newline at end of file diff --git a/integration/test/010_builddef_1.json b/integration/test/sampleFiles/010_builddef_1.json similarity index 100% rename from integration/test/010_builddef_1.json rename to integration/test/sampleFiles/010_builddef_1.json diff --git a/integration/test/010_builddef_2.json b/integration/test/sampleFiles/010_builddef_2.json similarity index 100% rename from integration/test/010_builddef_2.json rename to integration/test/sampleFiles/010_builddef_2.json diff --git a/unit/Invokepester.ps1 b/unit/Invokepester.ps1 index 5a7de0d92..c780dc951 100644 --- a/unit/Invokepester.ps1 +++ b/unit/Invokepester.ps1 @@ -55,6 +55,6 @@ function Invoke-PesterJob { $params = $PSBoundParameters - Start-Job -ScriptBlock { Set-Location $using:pwd; Import-Module ..\source\vsteam.psd1; Invoke-Pester @using:params } | + Start-Job -ScriptBlock { Set-Location $using:pwd; Invoke-Pester @using:params } | Receive-Job -Wait -AutoRemoveJob } \ No newline at end of file diff --git a/unit/test/Add-VSTeam.Tests.ps1 b/unit/test/Add-VSTeam.Tests.ps1 index b971cfbc1..81522bd6b 100644 --- a/unit/test/Add-VSTeam.Tests.ps1 +++ b/unit/test/Add-VSTeam.Tests.ps1 @@ -6,82 +6,48 @@ Import-Module SHiPS $here = Split-Path -Parent $MyInvocation.MyCommand.Path $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +. "$here/../../Source/Private/common.ps1" . "$here/../../Source/Classes/VSTeamLeaf.ps1" -. "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamTeam.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" -. "$here/../../Source/Private/applyTypes.ps1" -. "$here/../../Source/Private/common.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Public/$sut" #endregion - Describe "VSTeam" { - $singleResult = [PSCustomObject]@{ - id = '6f365a7143e492e911c341451a734401bcacadfd' - name = 'refs/heads/master' - description = 'team description' - } - Context "Add-VSTeam" { - Context "Services" { - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } - - . "$PSScriptRoot\mocks\mockProjectNameDynamicParam.ps1" - - Context 'Add-VSTeam with team name only' { - Mock Invoke-RestMethod { return $singleResult } - - It 'Should create a team' { - Add-VSTeam -ProjectName Test -TeamName "TestTeam" - - $expectedBody = '{ "name": "TestTeam", "description": "" }' - - Assert-MockCalled Invoke-RestMethod -Exactly 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/projects/Test/teams?api-version=$(_getApiVersion Core)" -and - $Method -eq "Post" -and - $Body -eq $expectedBody - } - } - } - - Context 'Add-VSTeam with team name and description' { - Mock Invoke-RestMethod { return $singleResult } - - It 'Should create a team' { - Add-VSTeam -ProjectName Test -TeamName "TestTeam" -Description "Test Description" - - $expectedBody = '{ "name": "TestTeam", "description": "Test Description" }' - - Assert-MockCalled Invoke-RestMethod -Exactly 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/projects/Test/teams?api-version=$(_getApiVersion Core)" -and - $Method -eq "Post" -and - $Body -eq $expectedBody - } - } + $singleResult = Get-Content "$PSScriptRoot\sampleFiles\get-vsteam.json" -Raw | ConvertFrom-Json + + Mock _callAPI { return $singleResult } + Mock _hasProjectCacheExpired { return $false } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } + + It 'with team name only should create a team' { + Add-VSTeam -ProjectName Test -TeamName "TestTeam" + + Assert-MockCalled _callAPI -Exactly -Times 1 -Scope It -ParameterFilter { + $NoProject -eq $true -and + $Area -eq 'projects' -and + $Resource -eq 'Test' -and + $Method -eq 'Post' -and + $ContentType -eq 'application/json' -and + $Body -eq '{ "name": "TestTeam", "description": "" }' + $Version -eq '1.0-unitTests' } } - Context "Server" { - . "$PSScriptRoot\mocks\mockProjectNameDynamicParam.ps1" - - Mock _useWindowsAuthenticationOnPremise { return $true } - - Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } - - Mock Invoke-RestMethod { return $singleResult } - - It 'with team name only on TFS local Auth should create a team' { - Add-VSTeam -ProjectName Test -TeamName "TestTeam" - - $expectedBody = '{ "name": "TestTeam", "description": "" }' - - Assert-MockCalled Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -eq "http://localhost:8080/tfs/defaultcollection/_apis/projects/Test/teams?api-version=$(_getApiVersion Core)" -and - $Method -eq "Post" -and - $Body -eq $expectedBody - } + It 'with team name and description should create a team' { + Add-VSTeam -ProjectName Test -TeamName "TestTeam" -Description "Test Description" + + Assert-MockCalled _callAPI -Exactly -Times 1 -Scope It -ParameterFilter { + $NoProject -eq $true -and + $Area -eq 'projects' -and + $Resource -eq 'Test' -and + $Method -eq 'Post' -and + $ContentType -eq 'application/json' -and + $Body -eq '{ "name": "TestTeam", "description": "Test Description" }' + $Version -eq '1.0-unitTests' } } } diff --git a/unit/test/Add-VSTeamAccessControlEntry.Tests.ps1 b/unit/test/Add-VSTeamAccessControlEntry.Tests.ps1 index 980a9aa1d..aa71e50f9 100644 --- a/unit/test/Add-VSTeamAccessControlEntry.Tests.ps1 +++ b/unit/test/Add-VSTeamAccessControlEntry.Tests.ps1 @@ -1,121 +1,116 @@ -Set-StrictMode -Version Latest - -#region include -Import-Module SHiPS - -$here = Split-Path -Parent $MyInvocation.MyCommand.Path -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") - -. "$here/../../Source/Classes/VSTeamLeaf.ps1" -. "$here/../../Source/Classes/VSTeamVersions.ps1" -. "$here/../../Source/Classes/VSTeamProjectCache.ps1" -. "$here/../../Source/Classes/VSTeamSecurityNamespace.ps1" -. "$here/../../Source/Classes/VSTeamAccessControlEntry.ps1" -. "$here/../../Source/Private/common.ps1" -. "$here/../../Source/Public/Set-VSTeamDefaultProject.ps1" -. "$here/../../Source/Public/Get-VSTeamSecurityNamespace.ps1" -. "$here/../../Source/Public/$sut" -#endregion - -Describe 'VSTeamAccessControlEntry' { - Context 'Add-VSTeamAccessControlEntry' { - ## Arrange - # Load sample files you need for mocks below - $securityNamespace = Get-Content "$PSScriptRoot\sampleFiles\securityNamespace.json" -Raw | ConvertFrom-Json - $accessControlEntryResult = Get-Content "$PSScriptRoot\sampleFiles\accessControlEntryResult.json" -Raw | ConvertFrom-Json - - # Some of the functions return VSTeam classes so turn the PSCustomeObject - # into the correct type. - $securityNamespaceObject = [VSTeamSecurityNamespace]::new($securityNamespace.value[0]) - - ## Arrange - # This value being left around can cause other tests to fail. - AfterAll { $Global:PSDefaultParameterValues.Remove("*:projectName") } - - # Set the account to use for testing. A normal user would do this using the - # Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } - - Mock _getApiVersion { return '5.0-unitTests' } -ParameterFilter { $Service -eq 'Core'} - - # This is only called when you need to test that the function can handle an - # exception. To make sure this mock is called make sure the descriptor in - # the body of your call has the value of 'boom'. - Mock Invoke-RestMethod { throw 'Error' } -ParameterFilter { $Body -like "*`"descriptor`": `"boom`",*" } - - Mock Invoke-RestMethod { return $accessControlEntryResult } - - It 'by SecurityNamespace (pipeline) should return ACEs' { - ## Act - $securityNamespaceObject | Add-VSTeamAccessControlEntry -Descriptor abc -Token xyz -AllowMask 12 -DenyMask 15 - - ## Assert - Assert-MockCalled Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - # The write-host below is great for seeing how many ways the mock is called. - # Write-Host "Assert Mock $Uri" - $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/58450c49-b02d-465a-ab12-59ae512d6531*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Body -like "*`"token`": `"xyz`",*" -and - $Body -like "*`"descriptor`": `"abc`",*" -and - $Body -like "*`"allow`": 12,*" -and - $Body -like "*`"deny`": 15,*" -and - $ContentType -eq "application/json" -and - $Method -eq "Post" - } - } - - It 'by SecurityNamespaceId should return ACEs' { - # Even with a default set this URI should not have the project added. - # So set the default project to Testing here and test below that the - # project is NOT added to the Uri. - ## Arange - Set-VSTeamDefaultProject -Project Testing - - ## Act - Add-VSTeamAccessControlEntry -SecurityNamespaceId 5a27515b-ccd7-42c9-84f1-54c998f03866 -Descriptor abc -Token xyz -AllowMask 12 -DenyMask 15 - - ## Assert - Assert-MockCalled Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - # The write-host below is great for seeing how many ways the mock is called. - # Write-Host "Assert Mock $Uri" - $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/5a27515b-ccd7-42c9-84f1-54c998f03866*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Body -like "*`"token`": `"xyz`",*" -and - $Body -like "*`"descriptor`": `"abc`",*" -and - $Body -like "*`"allow`": 12,*" -and - $Body -like "*`"deny`": 15,*" -and - $ContentType -eq "application/json" -and - $Method -eq "Post" - } - } - - It 'by SecurityNamespace should return ACEs' { - ## Act - Add-VSTeamAccessControlEntry -SecurityNamespace $securityNamespaceObject -Descriptor abc -Token xyz -AllowMask 12 -DenyMask 15 - - ## Assert - Assert-MockCalled Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - # The write-host below is great for seeing how many ways the mock is called. - # Write-Host "Assert Mock $Uri" - $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/58450c49-b02d-465a-ab12-59ae512d6531*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Body -like "*`"token`": `"xyz`",*" -and - $Body -like "*`"descriptor`": `"abc`",*" -and - $Body -like "*`"allow`": 12,*" -and - $Body -like "*`"deny`": 15,*" -and - $ContentType -eq "application/json" -and - $Method -eq "Post" - } - } - - It 'by securityNamespaceId throws should throw' { - ## Act / Assert - { Add-VSTeamAccessControlEntry -SecurityNamespaceId 5a27515b-ccd7-42c9-84f1-54c998f03866 -Descriptor boom -Token xyz -AllowMask 12 -DenyMask 15 } | Should Throw - } - - It 'by SecurityNamespace should throw' { - ## Act / Assert - { Add-VSTeamAccessControlEntry -SecurityNamespace $securityNamespaceObject -Descriptor boom -Token xyz -AllowMask 12 -DenyMask 15 } | Should Throw - } - } +Set-StrictMode -Version Latest + +#region include +Import-Module SHiPS + +$here = Split-Path -Parent $MyInvocation.MyCommand.Path +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") + +. "$here/../../Source/Classes/VSTeamLeaf.ps1" +. "$here/../../Source/Classes/VSTeamVersions.ps1" +. "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/VSTeamSecurityNamespace.ps1" +. "$here/../../Source/Classes/VSTeamAccessControlEntry.ps1" +. "$here/../../Source/Private/common.ps1" +. "$here/../../Source/Public/Set-VSTeamDefaultProject.ps1" +. "$here/../../Source/Public/Get-VSTeamSecurityNamespace.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" +. "$here/../../Source/Public/$sut" +#endregion + +Describe 'VSTeamAccessControlEntry' { + Context 'Add-VSTeamAccessControlEntry' { + ## Arrange + # Load sample files you need for mocks below + $securityNamespace = Get-Content "$PSScriptRoot\sampleFiles\securityNamespace.json" -Raw | ConvertFrom-Json + $accessControlEntryResult = Get-Content "$PSScriptRoot\sampleFiles\accessControlEntryResult.json" -Raw | ConvertFrom-Json + + # Some of the functions return VSTeam classes so turn the PSCustomeObject + # into the correct type. + $securityNamespaceObject = [VSTeamSecurityNamespace]::new($securityNamespace.value[0]) + + ## Arrange + Mock _getDefaultProject { return "Testing" } + + # Set the account to use for testing. A normal user would do this using the + # Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } + + Mock _getApiVersion { return '5.0-unitTests' } -ParameterFilter { $Service -eq 'Core'} + + # This is only called when you need to test that the function can handle an + # exception. To make sure this mock is called make sure the descriptor in + # the body of your call has the value of 'boom'. + Mock Invoke-RestMethod { throw 'Error' } -ParameterFilter { $Body -like "*`"descriptor`": `"boom`",*" } + + Mock Invoke-RestMethod { return $accessControlEntryResult } + + It 'by SecurityNamespace (pipeline) should return ACEs' { + ## Act + $securityNamespaceObject | Add-VSTeamAccessControlEntry -Descriptor abc -Token xyz -AllowMask 12 -DenyMask 15 + + ## Assert + Assert-MockCalled Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + # The write-host below is great for seeing how many ways the mock is called. + # Write-Host "Assert Mock $Uri" + $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/58450c49-b02d-465a-ab12-59ae512d6531*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Body -like "*`"token`": `"xyz`",*" -and + $Body -like "*`"descriptor`": `"abc`",*" -and + $Body -like "*`"allow`": 12,*" -and + $Body -like "*`"deny`": 15,*" -and + $ContentType -eq "application/json" -and + $Method -eq "Post" + } + } + + It 'by SecurityNamespaceId should return ACEs' { + ## Act + Add-VSTeamAccessControlEntry -SecurityNamespaceId 5a27515b-ccd7-42c9-84f1-54c998f03866 -Descriptor abc -Token xyz -AllowMask 12 -DenyMask 15 + + ## Assert + Assert-MockCalled Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + # The write-host below is great for seeing how many ways the mock is called. + # Write-Host "Assert Mock $Uri" + $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/5a27515b-ccd7-42c9-84f1-54c998f03866*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Body -like "*`"token`": `"xyz`",*" -and + $Body -like "*`"descriptor`": `"abc`",*" -and + $Body -like "*`"allow`": 12,*" -and + $Body -like "*`"deny`": 15,*" -and + $ContentType -eq "application/json" -and + $Method -eq "Post" + } + } + + It 'by SecurityNamespace should return ACEs' { + ## Act + Add-VSTeamAccessControlEntry -SecurityNamespace $securityNamespaceObject -Descriptor abc -Token xyz -AllowMask 12 -DenyMask 15 + + ## Assert + Assert-MockCalled Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + # The write-host below is great for seeing how many ways the mock is called. + # Write-Host "Assert Mock $Uri" + $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/58450c49-b02d-465a-ab12-59ae512d6531*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Body -like "*`"token`": `"xyz`",*" -and + $Body -like "*`"descriptor`": `"abc`",*" -and + $Body -like "*`"allow`": 12,*" -and + $Body -like "*`"deny`": 15,*" -and + $ContentType -eq "application/json" -and + $Method -eq "Post" + } + } + + It 'by securityNamespaceId throws should throw' { + ## Act / Assert + { Add-VSTeamAccessControlEntry -SecurityNamespaceId 5a27515b-ccd7-42c9-84f1-54c998f03866 -Descriptor boom -Token xyz -AllowMask 12 -DenyMask 15 } | Should Throw + } + + It 'by SecurityNamespace should throw' { + ## Act / Assert + { Add-VSTeamAccessControlEntry -SecurityNamespace $securityNamespaceObject -Descriptor boom -Token xyz -AllowMask 12 -DenyMask 15 } | Should Throw + } + } } \ No newline at end of file diff --git a/unit/test/Add-VSTeamBuild.Tests.ps1 b/unit/test/Add-VSTeamBuild.Tests.ps1 index f29a81eae..dc77b3b3e 100644 --- a/unit/test/Add-VSTeamBuild.Tests.ps1 +++ b/unit/test/Add-VSTeamBuild.Tests.ps1 @@ -31,6 +31,10 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamPool.ps1" . "$here/../../Source/Classes/VSTeamQueue.ps1" . "$here/../../Source/Classes/VSTeamBuildDefinition.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/TeamQueueCompleter.ps1" +. "$here/../../Source/Classes/BuildDefinitionCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Public/Get-VSTeamQueue.ps1" @@ -48,14 +52,6 @@ Describe 'VSTeamBuild' { Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Build' } Context 'Services' { - ## Arrange - BeforeAll { - $Global:PSDefaultParameterValues.Remove("*:projectName") - } - - # Load the mocks to create the project name dynamic parameter - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" - # Set the account to use for testing. A normal user would do this # using the Set-VSTeamAccount function. Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable @@ -70,7 +66,7 @@ Describe 'VSTeamBuild' { ## Assert # Call to queue build. Assert-MockCalled Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - ($Body | ConvertFrom-Json).definition.id -eq 699 -and + $Body -like "*699*" -and $Uri -eq "https://dev.azure.com/test/project/_apis/build/builds?api-version=$(_getApiVersion Build)" } } @@ -82,7 +78,7 @@ Describe 'VSTeamBuild' { ## Assert # Call to queue build. Assert-MockCalled Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - ($Body | ConvertFrom-Json).definition.id -eq 2 -and + $Body -like "*2*" -and $Uri -eq "https://dev.azure.com/test/project/_apis/build/builds?api-version=$(_getApiVersion Build)" } } @@ -94,8 +90,8 @@ Describe 'VSTeamBuild' { ## Assert # Call to queue build. Assert-MockCalled Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - ($Body | ConvertFrom-Json).definition.id -eq 2 -and - ($Body | ConvertFrom-Json).sourceBranch -eq 'refs/heads/dev' -and + $Body -like "*2*" -and + $Body -like "*refs/heads/dev*" -and $Uri -eq "https://dev.azure.com/test/project/_apis/build/builds?api-version=$(_getApiVersion Build)" } } @@ -107,8 +103,8 @@ Describe 'VSTeamBuild' { ## Assert # Call to queue build. Assert-MockCalled Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - ($Body | ConvertFrom-Json).definition.id -eq 2 -and - (($Body | ConvertFrom-Json).parameters | ConvertFrom-Json).'system.debug' -eq 'true' -and + $Body -like "*2*" -and + $Body -like "*true*" -and $Uri -eq "https://dev.azure.com/test/project/_apis/build/builds?api-version=$(_getApiVersion Build)" } } @@ -116,15 +112,9 @@ Describe 'VSTeamBuild' { Context 'Server' { ## Arrange - . "$PSScriptRoot\mocks\mockProjectNameDynamicParam.ps1" - Mock _useWindowsAuthenticationOnPremise { return $true } Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } -Verifiable - AfterAll { - $Global:PSDefaultParameterValues.Remove("*:projectName") - } - Mock Invoke-RestMethod { # Write-Host $args return $singleResult @@ -139,58 +129,43 @@ Describe 'VSTeamBuild' { Mock Get-VSTeamBuildDefinition { return @{ name = "MyBuildDef" } } It 'by id on TFS local Auth should add build' { - ## Arrange - $Global:PSDefaultParameterValues["*:projectName"] = 'Project' - ## Act Add-VSTeamBuild -projectName project -BuildDefinitionId 2 -QueueName MyQueue ## Assert # Call to queue build. Assert-MockCalled Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - # The write-host below is great for seeing how many ways the mock is called. - # Write-Host "Assert Mock $Uri" $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/build/builds?api-version=$(_getApiVersion Build)" -and - ($Body | ConvertFrom-Json).definition.id -eq 2 -and - ($Body | ConvertFrom-Json).queue.id -eq 3 + $Body -like "*2*" -and + $Body -like "*3*" } } It 'with parameters on TFS local Auth should add build' { - ## Arrange - $Global:PSDefaultParameterValues["*:projectName"] = 'Project' - ## Act Add-VSTeamBuild -projectName project -BuildDefinitionId 2 -QueueName MyQueue -BuildParameters @{'system.debug' = 'true' } ## Assert # Call to queue build. Assert-MockCalled Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - # The write-host below is great for seeing how many ways the mock is called. - # Write-Host "Assert Mock $Uri" $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/build/builds?api-version=$(_getApiVersion Build)" -and - ($Body | ConvertFrom-Json).definition.id -eq 2 -and - ($Body | ConvertFrom-Json).queue.id -eq 3 -and + $Body -like "*2*" -and + $Body -like "*3*" -and $Body -like "*system.debug*" } } It 'with source branch on TFS local auth should add build' { - ## Arrange - $Global:PSDefaultParameterValues["*:projectName"] = 'Project' - ## Act Add-VSTeamBuild -projectName project -BuildDefinitionId 2 -QueueName MyQueue -SourceBranch refs/heads/dev ## Assert # Call to queue build. Assert-MockCalled Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - # The write-host below is great for seeing how many ways the mock is called. - # Write-Host "Assert Mock $Uri" $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/build/builds?api-version=$(_getApiVersion Build)" -and - ($Body | ConvertFrom-Json).definition.id -eq 2 -and - ($Body | ConvertFrom-Json).queue.id -eq 3 -and - ($Body | ConvertFrom-Json).sourceBranch -eq 'refs/heads/dev' + $Body -like "*2*" -and + $Body -like "*3*" -and + $Body -like "*refs/heads/dev*" } } } diff --git a/unit/test/Add-VSTeamBuildDefinition.Tests.ps1 b/unit/test/Add-VSTeamBuildDefinition.Tests.ps1 index 42ffe628f..5583b1d7f 100644 --- a/unit/test/Add-VSTeamBuildDefinition.Tests.ps1 +++ b/unit/test/Add-VSTeamBuildDefinition.Tests.ps1 @@ -5,19 +5,20 @@ $here = Split-Path -Parent $MyInvocation.MyCommand.Path $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" +. "$here/../../Source/Classes/VSTeamProjectCache.ps1" . "$here/../../Source/Private/common.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Public/$sut" #endregion Describe 'VSTeamBuildDefinition' { Context 'Add-VSTeamBuildDefinition' { ## Arrange - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" - $resultsVSTS = Get-Content "$PSScriptRoot\sampleFiles\buildDefvsts.json" -Raw | ConvertFrom-Json Mock Invoke-RestMethod { return $resultsVSTS } - + Mock _getProjects { return @() } Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Build' } Context 'Services' { diff --git a/unit/test/Add-VSTeamBuildTag.Tests.ps1 b/unit/test/Add-VSTeamBuildTag.Tests.ps1 index 2e5e8c997..7c9977207 100644 --- a/unit/test/Add-VSTeamBuildTag.Tests.ps1 +++ b/unit/test/Add-VSTeamBuildTag.Tests.ps1 @@ -5,7 +5,10 @@ $here = Split-Path -Parent $MyInvocation.MyCommand.Path $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" +. "$here/../../Source/Classes/VSTeamProjectCache.ps1" . "$here/../../Source/Private/common.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Public/$sut" #endregion @@ -17,9 +20,6 @@ Describe 'Add-VSTeamBuildTag' { Context 'Services' { ## Arrange - # Load the mocks to create the project name dynamic parameter - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" - # Set the account to use for testing. A normal user would do this # using the Set-VSTeamAccount function. Mock _getInstance { return 'https://dev.azure.com/test' } @@ -42,8 +42,6 @@ Describe 'Add-VSTeamBuildTag' { Context 'Server' { ## Arrange - . "$PSScriptRoot\mocks\mockProjectNameDynamicParam.ps1" - Mock _useWindowsAuthenticationOnPremise { return $true } Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } diff --git a/unit/test/Add-VSTeamFeed.Tests.ps1 b/unit/test/Add-VSTeamFeed.Tests.ps1 index 1a47b4001..5b9eaed11 100644 --- a/unit/test/Add-VSTeamFeed.Tests.ps1 +++ b/unit/test/Add-VSTeamFeed.Tests.ps1 @@ -10,6 +10,7 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamFeed.ps1" . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/$sut" #endregion diff --git a/unit/test/Add-VSTeamGitRepository.Tests.ps1 b/unit/test/Add-VSTeamGitRepository.Tests.ps1 index d55bd1ca9..0fded7b07 100644 --- a/unit/test/Add-VSTeamGitRepository.Tests.ps1 +++ b/unit/test/Add-VSTeamGitRepository.Tests.ps1 @@ -31,6 +31,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamPool.ps1" . "$here/../../Source/Classes/VSTeamQueue.ps1" . "$here/../../Source/Classes/VSTeamBuildDefinition.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Public/Get-VSTeamQueue.ps1" @@ -67,8 +69,6 @@ Describe "VSTeamGitRepository" { Mock _hasProjectCacheExpired { return $false } - . "$PSScriptRoot\mocks\mockProjectNameDynamicParam.ps1" - Mock Invoke-RestMethod { return $singleResult } Mock _getInstance { return 'https://dev.azure.com/test' } diff --git a/unit/test/Add-VSTeamGitRepositoryPermission.Tests.ps1 b/unit/test/Add-VSTeamGitRepositoryPermission.Tests.ps1 index 54737e77a..e9bc95ff2 100644 --- a/unit/test/Add-VSTeamGitRepositoryPermission.Tests.ps1 +++ b/unit/test/Add-VSTeamGitRepositoryPermission.Tests.ps1 @@ -10,6 +10,7 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamDirectory.ps1" . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Classes/VSTeamRepositories.ps1" . "$here/../../Source/Classes/VSTeamTask.ps1" . "$here/../../Source/Classes/VSTeamAttempt.ps1" diff --git a/unit/test/Add-VSTeamKubernetesEndpoint.Tests.ps1 b/unit/test/Add-VSTeamKubernetesEndpoint.Tests.ps1 index 7216b425b..75e90b52d 100644 --- a/unit/test/Add-VSTeamKubernetesEndpoint.Tests.ps1 +++ b/unit/test/Add-VSTeamKubernetesEndpoint.Tests.ps1 @@ -10,6 +10,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/Add-VSTeamServiceEndpoint.ps1" . "$here/../../Source/Public/Get-VSTeamServiceEndpoint.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Public/$sut" #endregion @@ -17,8 +19,6 @@ Describe 'VSTeamKubernetesEndpoint' { Context 'Add-VSTeamKubernetesEndpoint' { Mock _hasProjectCacheExpired { return $false } - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" - Mock _getInstance { return 'https://dev.azure.com/test' } Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'ServiceFabricEndpoint' } diff --git a/unit/test/Add-VSTeamMembership.Tests.ps1 b/unit/test/Add-VSTeamMembership.Tests.ps1 index a0fa178cc..292e79aa7 100644 --- a/unit/test/Add-VSTeamMembership.Tests.ps1 +++ b/unit/test/Add-VSTeamMembership.Tests.ps1 @@ -6,6 +6,7 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Private/callMembershipAPI.ps1" . "$here/../../Source/Public/Get-VSTeamProject.ps1" diff --git a/unit/test/Add-VSTeamNuGetEndpoint.Tests.ps1 b/unit/test/Add-VSTeamNuGetEndpoint.Tests.ps1 index 4a12d2956..6bdafc3cc 100644 --- a/unit/test/Add-VSTeamNuGetEndpoint.Tests.ps1 +++ b/unit/test/Add-VSTeamNuGetEndpoint.Tests.ps1 @@ -10,6 +10,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/Add-VSTeamServiceEndpoint.ps1" . "$here/../../Source/Public/Get-VSTeamServiceEndpoint.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Public/$sut" #endregion @@ -17,8 +19,6 @@ Describe 'VSTeamNuGetEndpoint' { Context 'Add-VSTeamNuGetEndpoint' { Mock _hasProjectCacheExpired { return $false } - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" - Mock _getInstance { return 'https://dev.azure.com/test' } Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'DistributedTask' } diff --git a/unit/test/Add-VSTeamPolicy.Tests.ps1 b/unit/test/Add-VSTeamPolicy.Tests.ps1 index 9f402edc8..d02a5711c 100644 --- a/unit/test/Add-VSTeamPolicy.Tests.ps1 +++ b/unit/test/Add-VSTeamPolicy.Tests.ps1 @@ -9,6 +9,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Public/Get-VSTeamProject.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Public/$sut" #endregion diff --git a/unit/test/Add-VSTeamProject.Tests.ps1 b/unit/test/Add-VSTeamProject.Tests.ps1 index bb68586ac..14e1331c6 100644 --- a/unit/test/Add-VSTeamProject.Tests.ps1 +++ b/unit/test/Add-VSTeamProject.Tests.ps1 @@ -32,6 +32,12 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamPool.ps1" . "$here/../../Source/Classes/VSTeamQueue.ps1" . "$here/../../Source/Classes/VSTeamBuildDefinition.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProcessTemplateCompleter.ps1" +. "$here/../../Source/Classes/UncachedProjectCompleter.ps1" +. "$here/../../Source/Classes/ProcessValidateAttribute.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" +. "$here/../../Source/Classes/UncachedProjectValidateAttribute.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Public/Get-VSTeamQueue.ps1" @@ -43,9 +49,6 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") #endregion Describe 'VSTeamProject' { - . "$PSScriptRoot\mocks\mockProjectNameDynamicParam.ps1" - . "$PSScriptRoot\mocks\mockProcessNameDynamicParam.ps1" - $singleResult = [PSCustomObject]@{ name = 'Test' description = '' diff --git a/unit/test/Add-VSTeamProjectPermission.Tests.ps1 b/unit/test/Add-VSTeamProjectPermission.Tests.ps1 index 8e563c311..592dcb51f 100644 --- a/unit/test/Add-VSTeamProjectPermission.Tests.ps1 +++ b/unit/test/Add-VSTeamProjectPermission.Tests.ps1 @@ -10,6 +10,7 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamDirectory.ps1" . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Classes/VSTeamGroup.ps1" . "$here/../../Source/Classes/VSTeamUser.ps1" . "$here/../../Source/Classes/VSTeamTeams.ps1" diff --git a/unit/test/Add-VSTeamPullRequest.Tests.ps1 b/unit/test/Add-VSTeamPullRequest.Tests.ps1 index 1e31e6de9..baa43418d 100644 --- a/unit/test/Add-VSTeamPullRequest.Tests.ps1 +++ b/unit/test/Add-VSTeamPullRequest.Tests.ps1 @@ -1,79 +1,80 @@ -Set-StrictMode -Version Latest - -#region include -$here = Split-Path -Parent $MyInvocation.MyCommand.Path -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") - -. "$here/../../Source/Classes/VSTeamVersions.ps1" -. "$here/../../Source/Private/common.ps1" -. "$here/../../Source/Private/applyTypes.ps1" -. "$here/../../Source/Public/$sut" -#endregion - -Describe 'VSTeamPullRequest' { - ## Arrange - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" - - Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable - - # You have to set the version or the api-version will not be added when versions = '' - Mock _getApiVersion { return '1.0-gitUnitTests' } -ParameterFilter { $Service -eq 'Git' } - - $result = Get-Content "$PSScriptRoot\sampleFiles\updatePullRequestResponse.json" -Raw | ConvertFrom-Json - - Context 'Add-VSTeamPullRequest' { - Mock Invoke-RestMethod { return $result } - - It 'Add-VSTeamPullRequest as Draft' { - ## Act - Add-VSTeamPullRequest -RepositoryId "45df2d67-e709-4557-a7f9-c6812b449277" -ProjectName "Sandbox" ` - -Title "PR Title" -Description "PR Description" ` - -SourceRefName "refs/heads/test" -TargetRefName "refs/heads/master" ` - -Draft -Force - - ## Assert - Assert-MockCalled Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Method -eq 'Post' -and - $Uri -like "*repositories/45df2d67-e709-4557-a7f9-c6812b449277/*" -and - $Uri -like "*pullrequests*" -and - $Body -eq '{"sourceRefName": "refs/heads/test", "targetRefName": "refs/heads/master", "title": "PR Title", "description": "PR Description", "isDraft": true}' - } - } - - It 'Add-VSTeamPullRequest as Published' { - ## Act - Add-VSTeamPullRequest -RepositoryId "45df2d67-e709-4557-a7f9-c6812b449277" -ProjectName "Sandbox" ` - -Title "PR Title" -Description "PR Description" ` - -SourceRefName "refs/heads/test" -TargetRefName "refs/heads/master" ` - -Force - - ## Assert - Assert-MockCalled Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Method -eq 'Post' -and - $Uri -like "*repositories/45df2d67-e709-4557-a7f9-c6812b449277/*" -and - $Uri -like "*pullrequests*" -and - $Body -eq '{"sourceRefName": "refs/heads/test", "targetRefName": "refs/heads/master", "title": "PR Title", "description": "PR Description", "isDraft": false}' - } - } - - It 'Add-VSTeamPullRequest with wrong -SourceRefName throws' { - ## Act / Assert - { - Add-VSTeamPullRequest -RepositoryId "45df2d67-e709-4557-a7f9-c6812b449277" -ProjectName "Sandbox" ` - -Title "PR Title" -Description "PR Description" ` - -SourceRefName "garbage" -TargetRefName "refs/heads/master" ` - -Draft -Force - } | Should Throw - } - - It 'Add-VSTeamPullRequest with wrong -TargetRefName throws' { - ## Act / Assert - { - Add-VSTeamPullRequest -RepositoryId "45df2d67-e709-4557-a7f9-c6812b449277" -ProjectName "Sandbox" ` - -Title "PR Title" -Description "PR Description" ` - -SourceRefName "refs/heads/test" -TargetRefName "garbage" ` - -Draft -Force - } | Should Throw - } - } +Set-StrictMode -Version Latest + +#region include +$here = Split-Path -Parent $MyInvocation.MyCommand.Path +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") + +. "$here/../../Source/Classes/VSTeamVersions.ps1" +. "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" +. "$here/../../Source/Private/common.ps1" +. "$here/../../Source/Private/applyTypes.ps1" +. "$here/../../Source/Public/$sut" +#endregion + +Describe 'VSTeamPullRequest' { + ## Arrange + Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable + + # You have to set the version or the api-version will not be added when versions = '' + Mock _getApiVersion { return '1.0-gitUnitTests' } -ParameterFilter { $Service -eq 'Git' } + + $result = Get-Content "$PSScriptRoot\sampleFiles\updatePullRequestResponse.json" -Raw | ConvertFrom-Json + + Context 'Add-VSTeamPullRequest' { + Mock Invoke-RestMethod { return $result } + + It 'Add-VSTeamPullRequest as Draft' { + ## Act + Add-VSTeamPullRequest -RepositoryId "45df2d67-e709-4557-a7f9-c6812b449277" -ProjectName "Sandbox" ` + -Title "PR Title" -Description "PR Description" ` + -SourceRefName "refs/heads/test" -TargetRefName "refs/heads/master" ` + -Draft -Force + + ## Assert + Assert-MockCalled Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Method -eq 'Post' -and + $Uri -like "*repositories/45df2d67-e709-4557-a7f9-c6812b449277/*" -and + $Uri -like "*pullrequests*" -and + $Body -eq '{"sourceRefName": "refs/heads/test", "targetRefName": "refs/heads/master", "title": "PR Title", "description": "PR Description", "isDraft": true}' + } + } + + It 'Add-VSTeamPullRequest as Published' { + ## Act + Add-VSTeamPullRequest -RepositoryId "45df2d67-e709-4557-a7f9-c6812b449277" -ProjectName "Sandbox" ` + -Title "PR Title" -Description "PR Description" ` + -SourceRefName "refs/heads/test" -TargetRefName "refs/heads/master" ` + -Force + + ## Assert + Assert-MockCalled Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Method -eq 'Post' -and + $Uri -like "*repositories/45df2d67-e709-4557-a7f9-c6812b449277/*" -and + $Uri -like "*pullrequests*" -and + $Body -eq '{"sourceRefName": "refs/heads/test", "targetRefName": "refs/heads/master", "title": "PR Title", "description": "PR Description", "isDraft": false}' + } + } + + It 'Add-VSTeamPullRequest with wrong -SourceRefName throws' { + ## Act / Assert + { + Add-VSTeamPullRequest -RepositoryId "45df2d67-e709-4557-a7f9-c6812b449277" -ProjectName "Sandbox" ` + -Title "PR Title" -Description "PR Description" ` + -SourceRefName "garbage" -TargetRefName "refs/heads/master" ` + -Draft -Force + } | Should Throw + } + + It 'Add-VSTeamPullRequest with wrong -TargetRefName throws' { + ## Act / Assert + { + Add-VSTeamPullRequest -RepositoryId "45df2d67-e709-4557-a7f9-c6812b449277" -ProjectName "Sandbox" ` + -Title "PR Title" -Description "PR Description" ` + -SourceRefName "refs/heads/test" -TargetRefName "garbage" ` + -Draft -Force + } | Should Throw + } + } } \ No newline at end of file diff --git a/unit/test/Add-VSTeamRelease.Tests.ps1 b/unit/test/Add-VSTeamRelease.Tests.ps1 index d8858aaba..9af62ac3d 100644 --- a/unit/test/Add-VSTeamRelease.Tests.ps1 +++ b/unit/test/Add-VSTeamRelease.Tests.ps1 @@ -10,6 +10,10 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamFeed.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/BuildCompleter.ps1" +. "$here/../../Source/Classes/ReleaseDefinitionCompleter.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Public/Get-VSTeamBuild.ps1" @@ -20,8 +24,6 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") Describe 'VSTeamRelease' { ## Arrange Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Release' } - - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" Mock _getInstance { return 'https://dev.azure.com/test' } @@ -43,11 +45,11 @@ Describe 'VSTeamRelease' { Context 'Add-VSTeamRelease' { ## Arrange BeforeAll { - $Global:PSDefaultParameterValues["*:projectName"] = 'project' + $Global:PSDefaultParameterValues["*-vsteam*:projectName"] = 'project' } AfterAll { - $Global:PSDefaultParameterValues.Remove("*:projectName") + $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") } Mock Get-VSTeamReleaseDefinition { @@ -61,11 +63,9 @@ Describe 'VSTeamRelease' { Mock Get-VSTeamBuild { $bld1 = New-Object -TypeName PSObject -Prop @{name = "Bld1"; id = 1 } - $bld2 = New-Object -TypeName PSObject -Prop @{name = "Bld2"; id = 2 } return @( - $bld1, - $bld2 + $bld1 ) } diff --git a/unit/test/Add-VSTeamReleaseDefinition.Tests.ps1 b/unit/test/Add-VSTeamReleaseDefinition.Tests.ps1 index 9206b620e..f59444f89 100644 --- a/unit/test/Add-VSTeamReleaseDefinition.Tests.ps1 +++ b/unit/test/Add-VSTeamReleaseDefinition.Tests.ps1 @@ -6,6 +6,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/Get-VSTeamProject.ps1" . "$here/../../Source/Public/$sut" diff --git a/unit/test/Add-VSTeamServiceFabricEndpoint.Tests.ps1 b/unit/test/Add-VSTeamServiceFabricEndpoint.Tests.ps1 index 5014f62c8..6cd2500e4 100644 --- a/unit/test/Add-VSTeamServiceFabricEndpoint.Tests.ps1 +++ b/unit/test/Add-VSTeamServiceFabricEndpoint.Tests.ps1 @@ -6,6 +6,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/Add-VSTeamServiceEndpoint.ps1" @@ -18,8 +20,6 @@ Describe 'VSTeamServiceFabricEndpoint' { Mock _hasProjectCacheExpired { return $false } Context 'Services' { - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" - Mock _getInstance { return 'https://dev.azure.com/test' } Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'ServiceFabricEndpoint' } diff --git a/unit/test/Add-VSTeamSonarQubeEndpoint.Tests.ps1 b/unit/test/Add-VSTeamSonarQubeEndpoint.Tests.ps1 index 058966a8b..5102f6abb 100644 --- a/unit/test/Add-VSTeamSonarQubeEndpoint.Tests.ps1 +++ b/unit/test/Add-VSTeamSonarQubeEndpoint.Tests.ps1 @@ -6,6 +6,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/Add-VSTeamServiceEndpoint.ps1" @@ -17,8 +19,6 @@ Describe 'VSTeamSonarQubeEndpoint' { Context 'Add-VSTeamSonarQubeEndpoint' { Mock _hasProjectCacheExpired { return $false } - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" - Mock _getInstance { return 'https://dev.azure.com/test' } Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'ServiceFabricEndpoint' } diff --git a/unit/test/Add-VSTeamTaskGroup.Tests.ps1 b/unit/test/Add-VSTeamTaskGroup.Tests.ps1 index 2e6773f94..86e601c23 100644 --- a/unit/test/Add-VSTeamTaskGroup.Tests.ps1 +++ b/unit/test/Add-VSTeamTaskGroup.Tests.ps1 @@ -6,17 +6,18 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/Set-VSTeamAPIVersion.ps1" . "$here/../../Source/Public/$sut" #endregion -$taskGroupsJson = "$PSScriptRoot\sampleFiles\taskGroups.json" -$taskGroupJson = "$PSScriptRoot\sampleFiles\taskGroup.json" - -Describe 'VSTeamTaskGroup' { - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" + +Describe 'VSTeamTaskGroup' { + $taskGroupJson = "$PSScriptRoot\sampleFiles\taskGroup.json" + $taskGroupJsonAsString = Get-Content $taskGroupJson -Raw # Set the account to use for testing. A normal user would do this # using the Set-VSTeamAccount function. @@ -26,31 +27,26 @@ Describe 'VSTeamTaskGroup' { # Mock the call to Get-Projects by the dynamic parameter for ProjectName Mock Invoke-RestMethod { return @() } -ParameterFilter { $Uri -like "*_apis/project*" } - BeforeAll { - $projectName = "project" - $taskGroupJsonAsString = Get-Content $taskGroupJson -Raw - } - Context 'Add-VSTeamTaskGroup' { Mock Invoke-RestMethod { return Get-Content $taskGroupJson | ConvertFrom-Json } It 'should create a task group using body param' { - Add-VSTeamTaskGroup -ProjectName $projectName -Body $taskGroupJsonAsString + Add-VSTeamTaskGroup -ProjectName Project -Body $taskGroupJsonAsString Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/$projectName/_apis/distributedtask/taskgroups?api-version=$(_getApiVersion TaskGroups)" -and + $Uri -eq "https://dev.azure.com/test/Project/_apis/distributedtask/taskgroups?api-version=$(_getApiVersion TaskGroups)" -and $Body -eq $taskGroupJsonAsString -and $Method -eq "Post" } } It 'should create a task group using infile param' { - Add-VSTeamTaskGroup -ProjectName $projectName -InFile $taskGroupJson + Add-VSTeamTaskGroup -ProjectName Project -InFile $taskGroupJson Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/$projectName/_apis/distributedtask/taskgroups?api-version=$(_getApiVersion TaskGroups)" -and + $Uri -eq "https://dev.azure.com/test/Project/_apis/distributedtask/taskgroups?api-version=$(_getApiVersion TaskGroups)" -and $InFile -eq $taskGroupJson -and $Method -eq "Post" } diff --git a/unit/test/Add-VSTeamUserEntitlement.Tests.ps1 b/unit/test/Add-VSTeamUserEntitlement.Tests.ps1 index a03915981..b90b05e85 100644 --- a/unit/test/Add-VSTeamUserEntitlement.Tests.ps1 +++ b/unit/test/Add-VSTeamUserEntitlement.Tests.ps1 @@ -6,6 +6,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/Get-VSTeamUserEntitlement.ps1" @@ -14,9 +16,9 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") Describe "VSTeamUserEntitlement" { Context 'Add-VSTeamUserEntitlement' { + [VSTeamVersions]::ModuleVersion = '0.0.0' Mock _getApiVersion { return 'VSTS' } - # This will cause the call the _getProject to be skipped - Mock _hasProjectCacheExpired { return $false } + Mock _getProjects { return @() } Mock _getInstance { return 'https://dev.azure.com/test' } Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'MemberEntitlementManagement' } diff --git a/unit/test/Add-VSTeamVariableGroup.Tests.ps1 b/unit/test/Add-VSTeamVariableGroup.Tests.ps1 index 4ac55e56c..08441678e 100644 --- a/unit/test/Add-VSTeamVariableGroup.Tests.ps1 +++ b/unit/test/Add-VSTeamVariableGroup.Tests.ps1 @@ -6,6 +6,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/Set-VSTeamAPIVersion.ps1" @@ -14,15 +16,11 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") #endregion Describe 'VSTeamVariableGroup' { - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock _hasProjectCacheExpired { return $false } + Mock _getProjects { return @() } Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'VariableGroups' } Context 'Add-VSTeamVariableGroup' { Context 'Services' { - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" - - $sampleFileVSTS = $(Get-Content "$PSScriptRoot\sampleFiles\variableGroupSamples.json" | ConvertFrom-Json) Mock _getInstance { return 'https://dev.azure.com/test' } @@ -71,8 +69,6 @@ Describe 'VSTeamVariableGroup' { } Context 'Server' { - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" - $sampleFile2017 = $(Get-Content "$PSScriptRoot\sampleFiles\variableGroupSamples2017.json" | ConvertFrom-Json) Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } -Verifiable diff --git a/unit/test/Add-VSTeamWorkItem.Tests.ps1 b/unit/test/Add-VSTeamWorkItem.Tests.ps1 index 18aa16900..97e2573dd 100644 --- a/unit/test/Add-VSTeamWorkItem.Tests.ps1 +++ b/unit/test/Add-VSTeamWorkItem.Tests.ps1 @@ -6,14 +6,16 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/WorkItemTypeCompleter.ps1" +. "$here/../../Source/Classes/WorkItemTypeValidateAttribute.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/$sut" #endregion Describe 'VSTeamWorkItem' { - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" - Mock _getInstance { return 'https://dev.azure.com/test' } Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } @@ -35,7 +37,7 @@ Describe 'VSTeamWorkItem' { Context 'Add-VSTeamWorkItem' { It 'Without Default Project should add work item' { - $Global:PSDefaultParameterValues.Remove("*:projectName") + $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") Add-VSTeamWorkItem -ProjectName test -WorkItemType Task -Title Test Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { @@ -48,7 +50,7 @@ Describe 'VSTeamWorkItem' { } It 'With Default Project should add work item' { - $Global:PSDefaultParameterValues["*:projectName"] = 'test' + $Global:PSDefaultParameterValues["*-vsteam*:projectName"] = 'test' Add-VSTeamWorkItem -ProjectName test -WorkItemType Task -Title Test1 -Description Testing Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { @@ -65,7 +67,7 @@ Describe 'VSTeamWorkItem' { } It 'With Default Project should add work item with parent' { - $Global:PSDefaultParameterValues["*:projectName"] = 'test' + $Global:PSDefaultParameterValues["*-vsteam*:projectName"] = 'test' Add-VSTeamWorkItem -ProjectName test -WorkItemType Task -Title Test1 -Description Testing -ParentId 25 Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { @@ -85,7 +87,7 @@ Describe 'VSTeamWorkItem' { } It 'With Default Project should add work item only with additional properties and parent id' { - $Global:PSDefaultParameterValues["*:projectName"] = 'test' + $Global:PSDefaultParameterValues["*-vsteam*:projectName"] = 'test' $additionalFields = @{"System.Tags" = "TestTag"; "System.AreaPath" = "Project\\MyPath" } Add-VSTeamWorkItem -ProjectName test -WorkItemType Task -Title Test1 -Description Testing -ParentId 25 -AdditionalFields $additionalFields @@ -108,7 +110,7 @@ Describe 'VSTeamWorkItem' { } It 'With Default Project should add work item only with additional properties' { - $Global:PSDefaultParameterValues["*:projectName"] = 'test' + $Global:PSDefaultParameterValues["*-vsteam*:projectName"] = 'test' $additionalFields = @{"System.Tags" = "TestTag"; "System.AreaPath" = "Project\\MyPath" } Add-VSTeamWorkItem -ProjectName test -WorkItemType Task -Title Test1 -AdditionalFields $additionalFields @@ -127,7 +129,7 @@ Describe 'VSTeamWorkItem' { } It 'With Default Project should throw exception when adding existing parameters to additional properties and parent id' { - $Global:PSDefaultParameterValues["*:projectName"] = 'test' + $Global:PSDefaultParameterValues["*-vsteam*:projectName"] = 'test' $additionalFields = @{"System.Title" = "Test1"; "System.AreaPath" = "Project\\TestPath" } { Add-VSTeamWorkItem -ProjectName test -WorkItemType Task -Title Test1 -Description Testing -ParentId 25 -AdditionalFields $additionalFields } | Should Throw diff --git a/unit/test/Add-VSTeamWorkItemAreaPermission.Tests.ps1 b/unit/test/Add-VSTeamWorkItemAreaPermission.Tests.ps1 index ab28e9e03..8a2ed7de3 100644 --- a/unit/test/Add-VSTeamWorkItemAreaPermission.Tests.ps1 +++ b/unit/test/Add-VSTeamWorkItemAreaPermission.Tests.ps1 @@ -10,6 +10,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamDirectory.ps1" . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Classes/VSTeamUserEntitlement.ps1" . "$here/../../Source/Classes/VSTeamTeams.ps1" . "$here/../../Source/Classes/VSTeamRepositories.ps1" @@ -29,7 +31,6 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamGroup.ps1" . "$here/../../Source/Classes/VSTeamUser.ps1" . "$here/../../Source/Classes/VSTeamVersions.ps1" -. "$here/../../Source/Classes/VSTeamProjectCache.ps1" . "$here/../../Source/Classes/VSTeamAccessControlEntry.ps1" . "$here/../../Source/Classes/VSTeamSecurityNamespace.ps1" . "$here/../../Source/Private/common.ps1" @@ -40,28 +41,29 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Public/$sut" #endregion -$userSingleResult = Get-Content "$PSScriptRoot\sampleFiles\users.single.json" -Raw | ConvertFrom-Json -$userSingleResultObject = [VSTeamUser]::new($userSingleResult) - -$groupSingleResult = Get-Content "$PSScriptRoot\sampleFiles\groupsSingle.json" -Raw | ConvertFrom-Json -$groupSingleResultObject = [VSTeamGroup]::new($groupSingleResult) - -$projectResult = [PSCustomObject]@{ - name = 'Test Project Public' - description = '' - url = '' - id = '010d06f0-00d5-472a-bb47-58947c230876' - state = '' - visibility = '' - revision = 0 - defaultTeam = [PSCustomObject]@{ } - _links = [PSCustomObject]@{ } -} +Describe 'VSTeamWorkItemAreaPermission' { + $userSingleResult = Get-Content "$PSScriptRoot\sampleFiles\users.single.json" -Raw | ConvertFrom-Json + $userSingleResultObject = [VSTeamUser]::new($userSingleResult) + + $groupSingleResult = Get-Content "$PSScriptRoot\sampleFiles\groupsSingle.json" -Raw | ConvertFrom-Json + $groupSingleResultObject = [VSTeamGroup]::new($groupSingleResult) + + $projectResult = [PSCustomObject]@{ + name = 'Test Project Public' + description = '' + url = '' + id = '010d06f0-00d5-472a-bb47-58947c230876' + state = '' + visibility = '' + revision = 0 + defaultTeam = [PSCustomObject]@{ } + _links = [PSCustomObject]@{ } + } -$projectResultObject = [VSTeamProject]::new($projectResult) + $projectResultObject = [VSTeamProject]::new($projectResult) -$accessControlEntryResult = -@" + $accessControlEntryResult = + @" { "count": 1, "value": [ @@ -75,8 +77,8 @@ $accessControlEntryResult = } "@ | ConvertFrom-Json -$classificationNodeById = -@" + $classificationNodeById = + @" { "count": 1, "value": [ @@ -101,10 +103,10 @@ $classificationNodeById = } "@ | ConvertFrom-Json | Select-Object -ExpandProperty value -$classificationNodeByIdObject = [VSTeamClassificationNode]::new($classificationNodeById, "test") + $classificationNodeByIdObject = [VSTeamClassificationNode]::new($classificationNodeById, "test") -$parentClassificationNode = -@" + $parentClassificationNode = + @" { "count": 1, "value": [ @@ -129,10 +131,10 @@ $parentClassificationNode = } "@ | ConvertFrom-Json | Select-Object -ExpandProperty value -$parentClassificationNodeObject = [VSTeamClassificationNode]::new($parentClassificationNode, "test") + $parentClassificationNodeObject = [VSTeamClassificationNode]::new($parentClassificationNode, "test") -$areaRootNode = -@" + $areaRootNode = + @" { "id": 24, "identifier": "b33b12d7-6abb-4b7a-b9d6-2092d0933c99", @@ -149,9 +151,8 @@ $areaRootNode = } "@ | ConvertFrom-Json -$areaRootNodeObject = [VSTeamClassificationNode]::new($areaRootNode, "test") + $areaRootNodeObject = [VSTeamClassificationNode]::new($areaRootNode, "test") -Describe 'VSTeamWorkItemAreaPermission' { # Set the account to use for testing. A normal user would do this # using the Set-VSTeamAccount function. Mock _getInstance { return 'https://dev.azure.com/test' } diff --git a/unit/test/Add-VSTeamWorkItemIterationPermission.Tests.ps1 b/unit/test/Add-VSTeamWorkItemIterationPermission.Tests.ps1 index 1bef0cbf5..85364ee1d 100644 --- a/unit/test/Add-VSTeamWorkItemIterationPermission.Tests.ps1 +++ b/unit/test/Add-VSTeamWorkItemIterationPermission.Tests.ps1 @@ -10,6 +10,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamDirectory.ps1" . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Classes/VSTeamUserEntitlement.ps1" . "$here/../../Source/Classes/VSTeamTeams.ps1" . "$here/../../Source/Classes/VSTeamRepositories.ps1" @@ -40,28 +42,29 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Public/$sut" #endregion -$userSingleResult = Get-Content "$PSScriptRoot\sampleFiles\users.single.json" -Raw | ConvertFrom-Json -$userSingleResultObject = [VSTeamUser]::new($userSingleResult) - -$groupSingleResult = Get-Content "$PSScriptRoot\sampleFiles\groupsSingle.json" -Raw | ConvertFrom-Json -$groupSingleResultObject = [VSTeamGroup]::new($groupSingleResult) - -$projectResult = [PSCustomObject]@{ - name = 'Test Project Public' - description = '' - url = '' - id = '010d06f0-00d5-472a-bb47-58947c230876' - state = '' - visibility = '' - revision = 0 - defaultTeam = [PSCustomObject]@{ } - _links = [PSCustomObject]@{ } -} +Describe 'VSTeamWorkItemIterationPermission' { + $userSingleResult = Get-Content "$PSScriptRoot\sampleFiles\users.single.json" -Raw | ConvertFrom-Json + $userSingleResultObject = [VSTeamUser]::new($userSingleResult) + + $groupSingleResult = Get-Content "$PSScriptRoot\sampleFiles\groupsSingle.json" -Raw | ConvertFrom-Json + $groupSingleResultObject = [VSTeamGroup]::new($groupSingleResult) + + $projectResult = [PSCustomObject]@{ + name = 'Test Project Public' + description = '' + url = '' + id = '010d06f0-00d5-472a-bb47-58947c230876' + state = '' + visibility = '' + revision = 0 + defaultTeam = [PSCustomObject]@{ } + _links = [PSCustomObject]@{ } + } -$projectResultObject = [VSTeamProject]::new($projectResult) + $projectResultObject = [VSTeamProject]::new($projectResult) -$accessControlEntryResult = -@" + $accessControlEntryResult = + @" { "count": 1, "value": [ @@ -75,8 +78,8 @@ $accessControlEntryResult = } "@ | ConvertFrom-Json -$classificationNodeIterationId = -@" + $classificationNodeIterationId = + @" { "count": 1, "value": [ @@ -101,10 +104,10 @@ $classificationNodeIterationId = } "@ | ConvertFrom-Json | Select-Object -ExpandProperty value -$classificationNodeIterationIdObject = [VSTeamClassificationNode]::new($classificationNodeIterationId, "test") + $classificationNodeIterationIdObject = [VSTeamClassificationNode]::new($classificationNodeIterationId, "test") -$iterationRootNode = -@" + $iterationRootNode = + @" { "id": 16, "identifier": "dfa90792-403a-4119-a52b-bd142c08291b", @@ -121,9 +124,8 @@ $iterationRootNode = } "@ | ConvertFrom-Json -$iterationRootNodeObject = [VSTeamClassificationNode]::new($iterationRootNode, "test") + $iterationRootNodeObject = [VSTeamClassificationNode]::new($iterationRootNode, "test") -Describe 'VSTeamWorkItemIterationPermission' { # Set the account to use for testing. A normal user would do this # using the Set-VSTeamAccount function. Mock _getInstance { return 'https://dev.azure.com/test' } diff --git a/unit/test/BuildCompleter.Tests.ps1 b/unit/test/BuildCompleter.Tests.ps1 new file mode 100644 index 000000000..26d432a34 --- /dev/null +++ b/unit/test/BuildCompleter.Tests.ps1 @@ -0,0 +1,65 @@ +Set-StrictMode -Version Latest + +#region include +$here = Split-Path -Parent $MyInvocation.MyCommand.Path +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") + +. "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" +. "$here/../../Source/Private/applyTypes.ps1" +. "$here/../../Source/Private/common.ps1" +. "$here/../../Source/Public/Get-VSTeamBuild.ps1" +. "$here/../../Source/Classes/$sut" +#endregion + +Describe "BuildCompleter" { + Context "No default project" { + Mock _getDefaultProject { return $null } + + It "it should return empty list" { + $target = [BuildCompleter]::new() + + $actual = $target.CompleteArgument("Add-VSTeamRelease", "BuildNumber", "", $null, @{ }) + + $actual.count | Should Be 0 + } + } + + Context "no builds" { + Mock _getDefaultProject { return "Test" } + Mock Get-VSTeamBuild { return @() } + + It "it should return empty list" { + $target = [BuildCompleter]::new() + + $actual = $target.CompleteArgument($null, $null, "", $null, @{ }) + + $actual.count | Should Be 0 + } + } + + Context "with builds" { + Mock _getDefaultProject { return "DefaultProject" } + $builds = Get-Content "$PSScriptRoot\sampleFiles\get-vsteambuild.json" -Raw | ConvertFrom-Json + Mock Get-VSTeamBuild { $builds.value } + + $target = [BuildCompleter]::new() + + It "empty string should return all builds" { + $actual = $target.CompleteArgument($null, $null, "", $null, @{ }) + + $actual.count | Should Be 15 + Assert-MockCalled Get-VSTeamBuild -Scope It -Exactly -Times 1 -ParameterFilter { $ProjectName -eq 'DefaultProject' } + } + + It "5 string should return 5 builds" { + # This tests makes sure that even if a default project is set that the projectName parameter + # will be used if passed in. + $actual = $target.CompleteArgument($null, $null, "5", $null, @{ProjectName = "ProjectParameter" }) + + $actual.count | Should Be 5 + Assert-MockCalled Get-VSTeamBuild -Scope It -Exactly -Times 1 -ParameterFilter { $ProjectName -eq 'ProjectParameter' } + } + } +} \ No newline at end of file diff --git a/unit/test/Clear-VSTeamDefaultProject.Tests.ps1 b/unit/test/Clear-VSTeamDefaultProject.Tests.ps1 index 9a0d7013e..0bf9732c5 100644 --- a/unit/test/Clear-VSTeamDefaultProject.Tests.ps1 +++ b/unit/test/Clear-VSTeamDefaultProject.Tests.ps1 @@ -43,58 +43,55 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") #endregion Describe 'VSTeamProject' { - . "$PSScriptRoot\mocks\mockProjectNameDynamicParam.ps1" - . "$PSScriptRoot\mocks\mockProcessNameDynamicParam.ps1" - Mock _getInstance { return 'https://dev.azure.com/test' } Context 'Clear-VSTeamDefaultProject on Non Windows' { AfterAll { - $Global:PSDefaultParameterValues.Remove("*:projectName") + $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") } Mock _isOnWindows { return $false } It 'should clear default project' { - $Global:PSDefaultParameterValues['*:projectName'] = 'MyProject' + $Global:PSDefaultParameterValues['*-vsteam*:projectName'] = 'MyProject' Clear-VSTeamDefaultProject - $Global:PSDefaultParameterValues['*:projectName'] | Should BeNullOrEmpty + $Global:PSDefaultParameterValues['*-vsteam*:projectName'] | Should BeNullOrEmpty } } Context 'Clear-VSTeamDefaultProject as Non-Admin on Windows' { AfterAll { - $Global:PSDefaultParameterValues.Remove("*:projectName") + $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") } Mock _isOnWindows { return $true } Mock _testAdministrator { return $false } It 'should clear default project' { - $Global:PSDefaultParameterValues['*:projectName'] = 'MyProject' + $Global:PSDefaultParameterValues['*-vsteam*:projectName'] = 'MyProject' Clear-VSTeamDefaultProject - $Global:PSDefaultParameterValues['*:projectName'] | Should BeNullOrEmpty + $Global:PSDefaultParameterValues['*-vsteam*:projectName'] | Should BeNullOrEmpty } } Context 'Clear-VSTeamDefaultProject as Admin on Windows' { AfterAll { - $Global:PSDefaultParameterValues.Remove("*:projectName") + $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") } Mock _isOnWindows { return $true } Mock _testAdministrator { return $true } It 'should clear default project' { - $Global:PSDefaultParameterValues['*:projectName'] = 'MyProject' + $Global:PSDefaultParameterValues['*-vsteam*:projectName'] = 'MyProject' Clear-VSTeamDefaultProject - $Global:PSDefaultParameterValues['*:projectName'] | Should BeNullOrEmpty + $Global:PSDefaultParameterValues['*-vsteam*:projectName'] | Should BeNullOrEmpty } } } \ No newline at end of file diff --git a/unit/test/Disable-VSTeamAgent.Tests.ps1 b/unit/test/Disable-VSTeamAgent.Tests.ps1 index 6b3f4b29c..a9fde9400 100644 --- a/unit/test/Disable-VSTeamAgent.Tests.ps1 +++ b/unit/test/Disable-VSTeamAgent.Tests.ps1 @@ -6,6 +6,7 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/$sut" #endregion diff --git a/unit/test/Enable-VSTeamAgent.Tests.ps1 b/unit/test/Enable-VSTeamAgent.Tests.ps1 index b356c8bb2..7454a1117 100644 --- a/unit/test/Enable-VSTeamAgent.Tests.ps1 +++ b/unit/test/Enable-VSTeamAgent.Tests.ps1 @@ -6,6 +6,7 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/$sut" #endregion diff --git a/unit/test/Get-VSTeam.Tests.ps1 b/unit/test/Get-VSTeam.Tests.ps1 index 18cf9e567..2b83c423e 100644 --- a/unit/test/Get-VSTeam.Tests.ps1 +++ b/unit/test/Get-VSTeam.Tests.ps1 @@ -10,34 +10,35 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamTeam.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/$sut" #endregion +Describe "VSTeam" { + $results = [PSCustomObject]@{ + value = [PSCustomObject]@{ + id = '6f365a7143e492e911c341451a734401bcacadfd' + name = 'refs/heads/master' + description = 'team description' + } + } -$results = [PSCustomObject]@{ - value = [PSCustomObject]@{ + $singleResult = [PSCustomObject]@{ id = '6f365a7143e492e911c341451a734401bcacadfd' name = 'refs/heads/master' description = 'team description' } -} - -$singleResult = [PSCustomObject]@{ - id = '6f365a7143e492e911c341451a734401bcacadfd' - name = 'refs/heads/master' - description = 'team description' -} -Describe "VSTeam" { Context "Get-VSTeam" { + Mock _hasProjectCacheExpired { return $false } + Context "services" { Mock _getInstance { return 'https://dev.azure.com/test' } Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } - . "$PSScriptRoot\mocks\mockProjectNameDynamicParam.ps1" - Context 'Get-VSTeam with project name' { Mock Invoke-RestMethod { return $results } @@ -131,8 +132,6 @@ Describe "VSTeam" { Context "Server" { - . "$PSScriptRoot\mocks\mockProjectNameDynamicParam.ps1" - Mock _useWindowsAuthenticationOnPremise { return $true } Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } diff --git a/unit/test/Get-VSTeamAccessControlList.Tests.ps1 b/unit/test/Get-VSTeamAccessControlList.Tests.ps1 index 8ef9e6e3c..1b6bd5639 100644 --- a/unit/test/Get-VSTeamAccessControlList.Tests.ps1 +++ b/unit/test/Get-VSTeamAccessControlList.Tests.ps1 @@ -1,99 +1,101 @@ -Set-StrictMode -Version Latest - -#region include -Import-Module SHiPS - -$here = Split-Path -Parent $MyInvocation.MyCommand.Path -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") - -. "$here/../../Source/Classes/VSTeamLeaf.ps1" -. "$here/../../Source/Classes/VSTeamVersions.ps1" -. "$here/../../Source/Classes/VSTeamProjectCache.ps1" -. "$here/../../Source/Classes/VSTeamSecurityNamespace.ps1" -. "$here/../../Source/Classes/VSTeamAccessControlEntry.ps1" -. "$here/../../Source/Classes/VSTeamAccessControlList.ps1" -. "$here/../../Source/Private/common.ps1" -. "$here/../../Source/Public/Set-VSTeamDefaultProject.ps1" -. "$here/../../Source/Public/Get-VSTeamSecurityNamespace.ps1" -. "$here/../../Source/Public/$sut" -#endregion - -Describe 'VSTeamAccessControlList' { - ## Arrange - # You have to set the version or the api-version will not be added when versions = '' - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } - - $accessControlListResult = Get-Content "$PSScriptRoot\sampleFiles\accessControlListResult.json" -Raw | ConvertFrom-Json - - $securityNamespace = Get-Content "$PSScriptRoot\sampleFiles\securityNamespace.json" -Raw | ConvertFrom-Json - $securityNamespaceObject = [VSTeamSecurityNamespace]::new($securityNamespace.value[0]) - - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } - - Context 'Get-VSTeamAccessControlList' { - Mock Invoke-RestMethod { return $accessControlListResult } - Mock Invoke-RestMethod { throw 'Error' } -ParameterFilter { $Uri -like "*token=boom*" } - - It 'by SecurityNamespaceId should return ACLs' { - ## Arrange - # Even with a default set this URI should not have the project added. - Set-VSTeamDefaultProject -Project Testing - - ## Act - Get-VSTeamAccessControlList -SecurityNamespaceId 5a27515b-ccd7-42c9-84f1-54c998f03866 -Token "SomeToken" -Descriptors "SomeDescriptor" -IncludeExtendedInfo -Recurse - - ## Assert - Assert-MockCalled Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/_apis/accesscontrollists/5a27515b-ccd7-42c9-84f1-54c998f03866*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Uri -like "*descriptors=SomeDescriptor*" -and - $Uri -like "*includeExtendedInfo=True*" -and - $Uri -like "*token=SomeToken*" -and - $Uri -like "*recurse=True*" -and - $Method -eq "Get" - } - } - - It 'by SecurityNamespace should return ACLs' { - ## Act - # I use $securityNamespace.value[0] here because using securityNamespaceObject was leading to issues - Get-VSTeamAccessControlList -SecurityNamespace $($securityNamespace.value[0]) -Token "SomeToken" -Descriptors "SomeDescriptor" - - ## Assert - Assert-MockCalled Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/_apis/accesscontrollists/58450c49-b02d-465a-ab12-59ae512d6531*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Uri -like "*descriptors=SomeDescriptor*" -and - $Uri -like "*token=SomeToken*" -and - $Method -eq "Get" - } - } - - It 'by SecurityNamespace (pipeline) should return ACEs' { - ## Act - $securityNamespaceObject | Get-VSTeamAccessControlList -Token "AcesToken" -Descriptors "AcesDescriptor" - - ## Assert - Assert-MockCalled Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/_apis/accesscontrollists/58450c49-b02d-465a-ab12-59ae512d6531*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Uri -like "*descriptors=AcesDescriptor*" -and - $Uri -like "*token=AcesToken*" -and - $Method -eq "Get" - } - } - - It 'by SecurityNamespaceId should throw' { - ## Act / Assert - { Get-VSTeamAccessControlList -SecurityNamespaceId 5a27515b-ccd7-42c9-84f1-54c998f03866 -Token "boom" -Descriptors "SomeDescriptor" -IncludeExtendedInfo -Recurse } | Should Throw - } - - It 'by SecurityNamespace should throw' { - ## Act / Assert - { Get-VSTeamAccessControlList -SecurityNamespace $securityNamespaceObject -Token "boom" -Descriptors "SomeDescriptor" -IncludeExtendedInfo -Recurse } | Should Throw - } - } +Set-StrictMode -Version Latest + +#region include +Import-Module SHiPS + +$here = Split-Path -Parent $MyInvocation.MyCommand.Path +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") + +. "$here/../../Source/Classes/VSTeamLeaf.ps1" +. "$here/../../Source/Classes/VSTeamVersions.ps1" +. "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" +. "$here/../../Source/Classes/VSTeamSecurityNamespace.ps1" +. "$here/../../Source/Classes/VSTeamAccessControlEntry.ps1" +. "$here/../../Source/Classes/VSTeamAccessControlList.ps1" +. "$here/../../Source/Private/common.ps1" +. "$here/../../Source/Public/Set-VSTeamDefaultProject.ps1" +. "$here/../../Source/Public/Get-VSTeamSecurityNamespace.ps1" +. "$here/../../Source/Public/$sut" +#endregion + +Describe 'VSTeamAccessControlList' { + ## Arrange + # You have to set the version or the api-version will not be added when versions = '' + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } + + $accessControlListResult = Get-Content "$PSScriptRoot\sampleFiles\accessControlListResult.json" -Raw | ConvertFrom-Json + + $securityNamespace = Get-Content "$PSScriptRoot\sampleFiles\securityNamespace.json" -Raw | ConvertFrom-Json + $securityNamespaceObject = [VSTeamSecurityNamespace]::new($securityNamespace.value[0]) + + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } + + Context 'Get-VSTeamAccessControlList' { + Mock Invoke-RestMethod { return $accessControlListResult } + Mock Invoke-RestMethod { throw 'Error' } -ParameterFilter { $Uri -like "*token=boom*" } + + It 'by SecurityNamespaceId should return ACLs' { + ## Arrange + # Even with a default set this URI should not have the project added. + Set-VSTeamDefaultProject -Project Testing + + ## Act + Get-VSTeamAccessControlList -SecurityNamespaceId 5a27515b-ccd7-42c9-84f1-54c998f03866 -Token "SomeToken" -Descriptors "SomeDescriptor" -IncludeExtendedInfo -Recurse + + ## Assert + Assert-MockCalled Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/_apis/accesscontrollists/5a27515b-ccd7-42c9-84f1-54c998f03866*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Uri -like "*descriptors=SomeDescriptor*" -and + $Uri -like "*includeExtendedInfo=True*" -and + $Uri -like "*token=SomeToken*" -and + $Uri -like "*recurse=True*" -and + $Method -eq "Get" + } + } + + It 'by SecurityNamespace should return ACLs' { + ## Act + # I use $securityNamespace.value[0] here because using securityNamespaceObject was leading to issues + Get-VSTeamAccessControlList -SecurityNamespace $($securityNamespace.value[0]) -Token "SomeToken" -Descriptors "SomeDescriptor" + + ## Assert + Assert-MockCalled Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/_apis/accesscontrollists/58450c49-b02d-465a-ab12-59ae512d6531*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Uri -like "*descriptors=SomeDescriptor*" -and + $Uri -like "*token=SomeToken*" -and + $Method -eq "Get" + } + } + + It 'by SecurityNamespace (pipeline) should return ACEs' { + ## Act + $securityNamespaceObject | Get-VSTeamAccessControlList -Token "AcesToken" -Descriptors "AcesDescriptor" + + ## Assert + Assert-MockCalled Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/_apis/accesscontrollists/58450c49-b02d-465a-ab12-59ae512d6531*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Uri -like "*descriptors=AcesDescriptor*" -and + $Uri -like "*token=AcesToken*" -and + $Method -eq "Get" + } + } + + It 'by SecurityNamespaceId should throw' { + ## Act / Assert + { Get-VSTeamAccessControlList -SecurityNamespaceId 5a27515b-ccd7-42c9-84f1-54c998f03866 -Token "boom" -Descriptors "SomeDescriptor" -IncludeExtendedInfo -Recurse } | Should Throw + } + + It 'by SecurityNamespace should throw' { + ## Act / Assert + { Get-VSTeamAccessControlList -SecurityNamespace $securityNamespaceObject -Token "boom" -Descriptors "SomeDescriptor" -IncludeExtendedInfo -Recurse } | Should Throw + } + } } \ No newline at end of file diff --git a/unit/test/Get-VSTeamAgent.Tests.ps1 b/unit/test/Get-VSTeamAgent.Tests.ps1 index 818232090..a7486db40 100644 --- a/unit/test/Get-VSTeamAgent.Tests.ps1 +++ b/unit/test/Get-VSTeamAgent.Tests.ps1 @@ -9,6 +9,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamDirectory.ps1" . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Classes/VSTeamAgent.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/Set-VSTeamDefaultProject.ps1" diff --git a/unit/test/Get-VSTeamApproval.Tests.ps1 b/unit/test/Get-VSTeamApproval.Tests.ps1 index d2c0fa924..32ac19a3e 100644 --- a/unit/test/Get-VSTeamApproval.Tests.ps1 +++ b/unit/test/Get-VSTeamApproval.Tests.ps1 @@ -6,6 +6,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Public/$sut" @@ -37,9 +39,6 @@ Describe 'VSTeamApproval' -Tag 'unit', 'approvals' { } } - # Load the mocks to create the project name dynamic parameter - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" - Context 'Get-VSTeamApproval' { Context 'Services' { # Arrange diff --git a/unit/test/Get-VSTeamBuild.Tests.ps1 b/unit/test/Get-VSTeamBuild.Tests.ps1 index ec2f1d80e..9ec9ecb5b 100644 --- a/unit/test/Get-VSTeamBuild.Tests.ps1 +++ b/unit/test/Get-VSTeamBuild.Tests.ps1 @@ -6,6 +6,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Public/$sut" @@ -20,10 +22,6 @@ Describe 'VSTeamBuild' { # Sample result for list of builds $results = Get-Content "$PSScriptRoot\sampleFiles\buildResults.json" -Raw | ConvertFrom-Json - # Load the mocks to create the project name dynamic parameter - . "$PSScriptRoot\mocks\mockProjectNameDynamicParam.ps1" - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" - Mock Invoke-RestMethod { return $results } Mock Invoke-RestMethod { return $singleResult } -ParameterFilter { $Uri -like "*101*" } Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Build' } diff --git a/unit/test/Get-VSTeamBuildArtifact.Tests.ps1 b/unit/test/Get-VSTeamBuildArtifact.Tests.ps1 index 09b7198b3..1b62eef37 100644 --- a/unit/test/Get-VSTeamBuildArtifact.Tests.ps1 +++ b/unit/test/Get-VSTeamBuildArtifact.Tests.ps1 @@ -5,6 +5,9 @@ $here = Split-Path -Parent $MyInvocation.MyCommand.Path $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" +. "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Public/$sut" @@ -13,10 +16,6 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") Describe 'VSTeamBuildArtifact' { Context "Get-VSTeamBuildArtifact" { ## Arrange - # Load the mocks to create the project name dynamic parameter - . "$PSScriptRoot\mocks\mockProjectNameDynamicParam.ps1" - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" - # Set the account to use for testing. A normal user would do this # using the Set-VSTeamAccount function. Mock _getInstance { return 'https://dev.azure.com/test' } diff --git a/unit/test/Get-VSTeamBuildDefinition.Tests.ps1 b/unit/test/Get-VSTeamBuildDefinition.Tests.ps1 index 577f3ae28..e74e4fdbd 100644 --- a/unit/test/Get-VSTeamBuildDefinition.Tests.ps1 +++ b/unit/test/Get-VSTeamBuildDefinition.Tests.ps1 @@ -10,6 +10,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamDirectory.ps1" . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Classes/VSTeamUserEntitlement.ps1" . "$here/../../Source/Classes/VSTeamTeams.ps1" . "$here/../../Source/Classes/VSTeamRepositories.ps1" @@ -42,8 +44,6 @@ Describe 'VSTeamBuildDefinition' { $results2017 = Get-Content "$PSScriptRoot\sampleFiles\buildDef2017.json" -Raw | ConvertFrom-Json $results2018 = Get-Content "$PSScriptRoot\sampleFiles\buildDef2018.json" -Raw | ConvertFrom-Json - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Build' } Mock Invoke-RestMethod { return $results2017 } -ParameterFilter { $Uri -like "*2017Project*" } diff --git a/unit/test/Get-VSTeamBuildLog.Tests.ps1 b/unit/test/Get-VSTeamBuildLog.Tests.ps1 index dfa32eefa..41d218b23 100644 --- a/unit/test/Get-VSTeamBuildLog.Tests.ps1 +++ b/unit/test/Get-VSTeamBuildLog.Tests.ps1 @@ -6,6 +6,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/$sut" #endregion @@ -13,10 +15,6 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") Describe 'VSTeamBuildLog' { Context 'Get-VSTeamBuildLog' { ## Arrange - # Load the mocks to create the project name dynamic parameter - . "$PSScriptRoot\mocks\mockProjectNameDynamicParam.ps1" - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" - Mock Invoke-RestMethod { return @{ count = 4 value = @{ } diff --git a/unit/test/Get-VSTeamBuildTag.Tests.ps1 b/unit/test/Get-VSTeamBuildTag.Tests.ps1 index 0c07bdbda..61c784553 100644 --- a/unit/test/Get-VSTeamBuildTag.Tests.ps1 +++ b/unit/test/Get-VSTeamBuildTag.Tests.ps1 @@ -5,15 +5,14 @@ $here = Split-Path -Parent $MyInvocation.MyCommand.Path $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" +. "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/$sut" #endregion Describe 'VSTeamBuildTag' { - # Load the mocks to create the project name dynamic parameter - . "$PSScriptRoot\mocks\mockProjectNameDynamicParam.ps1" - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" - # Set the account to use for testing. A normal user would do this # using the Set-VSTeamAccount function. Mock _getInstance { return 'https://dev.azure.com/test' } diff --git a/unit/test/Get-VSTeamClassificationNode.Tests.ps1 b/unit/test/Get-VSTeamClassificationNode.Tests.ps1 index 64e26e734..a9742ff82 100644 --- a/unit/test/Get-VSTeamClassificationNode.Tests.ps1 +++ b/unit/test/Get-VSTeamClassificationNode.Tests.ps1 @@ -9,6 +9,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamLeaf.ps1" . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Classes/VSTeamClassificationNode.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/$sut" diff --git a/unit/test/Get-VSTeamCloudSubscription.Tests.ps1 b/unit/test/Get-VSTeamCloudSubscription.Tests.ps1 index c5f39c733..1dda53067 100644 --- a/unit/test/Get-VSTeamCloudSubscription.Tests.ps1 +++ b/unit/test/Get-VSTeamCloudSubscription.Tests.ps1 @@ -6,6 +6,7 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Public/$sut" diff --git a/unit/test/Get-VSTeamDescriptor.Tests.ps1 b/unit/test/Get-VSTeamDescriptor.Tests.ps1 index 7e9b2c208..feb6fcb71 100644 --- a/unit/test/Get-VSTeamDescriptor.Tests.ps1 +++ b/unit/test/Get-VSTeamDescriptor.Tests.ps1 @@ -9,6 +9,7 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamLeaf.ps1" . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Classes/VSTeamDescriptor.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Private/applyTypes.ps1" diff --git a/unit/test/Get-VSTeamFeed.Tests.ps1 b/unit/test/Get-VSTeamFeed.Tests.ps1 index a42f84f51..f164aac0b 100644 --- a/unit/test/Get-VSTeamFeed.Tests.ps1 +++ b/unit/test/Get-VSTeamFeed.Tests.ps1 @@ -10,6 +10,7 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamFeed.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/$sut" #endregion diff --git a/unit/test/Get-VSTeamGitCommit.Tests.ps1 b/unit/test/Get-VSTeamGitCommit.Tests.ps1 index 55d1d7384..edb97366f 100644 --- a/unit/test/Get-VSTeamGitCommit.Tests.ps1 +++ b/unit/test/Get-VSTeamGitCommit.Tests.ps1 @@ -1,85 +1,85 @@ -Set-StrictMode -Version Latest - -#region include -Import-Module SHiPS - -$here = Split-Path -Parent $MyInvocation.MyCommand.Path -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") - -. "$here/../../Source/Classes/VSTeamLeaf.ps1" -. "$here/../../Source/Classes/VSTeamVersions.ps1" -. "$here/../../Source/Classes/VSTeamGitUserDate.ps1" -. "$here/../../Source/Classes/VSTeamGitCommitRef.ps1" -. "$here/../../Source/Classes/VSTeamProjectCache.ps1" -. "$here/../../Source/Private/common.ps1" -. "$here/../../Source/Public/$sut" -#endregion - -Describe "VSTeamGitCommit" { - . "$PSScriptRoot\mocks\mockProjectNameDynamicParam.ps1" - - $results = Get-Content "$PSScriptRoot\sampleFiles\gitCommitResults.json" -Raw | ConvertFrom-Json - - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Git' } - - Context 'Get-VSTeamGitCommit' { - Mock Invoke-RestMethod { return $results } - - It 'should return all commits for the repo' { - Get-VSTeamGitCommit -ProjectName Test -RepositoryId 06E176BE-D3D2-41C2-AB34-5F4D79AEC86B - Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -like "*repositories/06E176BE-D3D2-41C2-AB34-5F4D79AEC86B/commits*" - } - } - - It 'with many Parameters should return all commits for the repo' { - Get-VSTeamGitCommit -ProjectName Test -RepositoryId '06E176BE-D3D2-41C2-AB34-5F4D79AEC86B' ` - -FromDate '2020-01-01' -ToDate '2020-03-01' ` - -ItemVersionVersionType 'commit' -ItemVersionVersion 'abcdef1234567890abcdef1234567890' -ItemVersionVersionOptions 'previousChange' ` - -CompareVersionVersionType 'commit' -CompareVersionVersion 'abcdef1234567890abcdef1234567890' -CompareVersionVersionOptions 'previousChange' ` - -FromCommitId 'abcdef' -ToCommitId 'fedcba' ` - -Author "Test" ` - -Top 100 -Skip 50 ` - -User "Test" - - Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -like "*repositories/06E176BE-D3D2-41C2-AB34-5F4D79AEC86B/commits*" -and - $Uri -like "*searchCriteria.fromDate=2020-01-01T00:00:00Z*" -and - $Uri -like "*searchCriteria.toDate=2020-03-01T00:00:00Z*" -and - $Uri -like "*searchCriteria.itemVersion.versionType=commit*" -and - $Uri -like "*searchCriteria.itemVersion.version=abcdef1234567890abcdef1234567890*" -and - $Uri -like "*searchCriteria.itemVersion.versionOptions=previousChange*" -and - $Uri -like "*searchCriteria.compareVersion.versionType=commit*" -and - $Uri -like "*searchCriteria.compareVersion.version=abcdef1234567890abcdef1234567890*" -and - $Uri -like "*searchCriteria.compareVersion.versionOptions=previousChange*" -and - $Uri -like "*searchCriteria.fromCommitId=abcdef*" -and - $Uri -like "*searchCriteria.toCommitId=fedcba*" -and - $Uri -like "*searchCriteria.author=Test*" -and - $Uri -like "*searchCriteria.user=Test*" -and - $Uri -like "*searchCriteria.`$top=100*" -and - $Uri -like "*searchCriteria.`$skip=50*" - } - } - - It 'with ItemPath parameters should return all commits for the repo' { - Get-VSTeamGitCommit -ProjectName Test -RepositoryId '06E176BE-D3D2-41C2-AB34-5F4D79AEC86B' ` - -ItemPath 'test' ` - -ExcludeDeletes ` - -HistoryMode 'fullHistory' ` - -Top 100 -Skip 50 ` - -User "Test" - - Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -like "*repositories/06E176BE-D3D2-41C2-AB34-5F4D79AEC86B/commits*" -and - $Uri -like "*searchCriteria.itemPath=test*" -and - $Uri -like "*searchCriteria.excludeDeletes=true*" -and - $Uri -like "*searchCriteria.historyMode=fullHistory*" -and - $Uri -like "*searchCriteria.`$top=100*" -and - $Uri -like "*searchCriteria.`$skip=50*" - } - } - } +Set-StrictMode -Version Latest + +#region include +Import-Module SHiPS + +$here = Split-Path -Parent $MyInvocation.MyCommand.Path +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") + +. "$here/../../Source/Classes/VSTeamLeaf.ps1" +. "$here/../../Source/Classes/VSTeamVersions.ps1" +. "$here/../../Source/Classes/VSTeamGitUserDate.ps1" +. "$here/../../Source/Classes/VSTeamGitCommitRef.ps1" +. "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" +. "$here/../../Source/Private/common.ps1" +. "$here/../../Source/Public/$sut" +#endregion + +Describe "VSTeamGitCommit" { + $results = Get-Content "$PSScriptRoot\sampleFiles\gitCommitResults.json" -Raw | ConvertFrom-Json + + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Git' } + + Context 'Get-VSTeamGitCommit' { + Mock Invoke-RestMethod { return $results } + + It 'should return all commits for the repo' { + Get-VSTeamGitCommit -ProjectName Test -RepositoryId 06E176BE-D3D2-41C2-AB34-5F4D79AEC86B + Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -like "*repositories/06E176BE-D3D2-41C2-AB34-5F4D79AEC86B/commits*" + } + } + + It 'with many Parameters should return all commits for the repo' { + Get-VSTeamGitCommit -ProjectName Test -RepositoryId '06E176BE-D3D2-41C2-AB34-5F4D79AEC86B' ` + -FromDate '2020-01-01' -ToDate '2020-03-01' ` + -ItemVersionVersionType 'commit' -ItemVersionVersion 'abcdef1234567890abcdef1234567890' -ItemVersionVersionOptions 'previousChange' ` + -CompareVersionVersionType 'commit' -CompareVersionVersion 'abcdef1234567890abcdef1234567890' -CompareVersionVersionOptions 'previousChange' ` + -FromCommitId 'abcdef' -ToCommitId 'fedcba' ` + -Author "Test" ` + -Top 100 -Skip 50 ` + -User "Test" + + Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -like "*repositories/06E176BE-D3D2-41C2-AB34-5F4D79AEC86B/commits*" -and + $Uri -like "*searchCriteria.fromDate=2020-01-01T00:00:00Z*" -and + $Uri -like "*searchCriteria.toDate=2020-03-01T00:00:00Z*" -and + $Uri -like "*searchCriteria.itemVersion.versionType=commit*" -and + $Uri -like "*searchCriteria.itemVersion.version=abcdef1234567890abcdef1234567890*" -and + $Uri -like "*searchCriteria.itemVersion.versionOptions=previousChange*" -and + $Uri -like "*searchCriteria.compareVersion.versionType=commit*" -and + $Uri -like "*searchCriteria.compareVersion.version=abcdef1234567890abcdef1234567890*" -and + $Uri -like "*searchCriteria.compareVersion.versionOptions=previousChange*" -and + $Uri -like "*searchCriteria.fromCommitId=abcdef*" -and + $Uri -like "*searchCriteria.toCommitId=fedcba*" -and + $Uri -like "*searchCriteria.author=Test*" -and + $Uri -like "*searchCriteria.user=Test*" -and + $Uri -like "*searchCriteria.`$top=100*" -and + $Uri -like "*searchCriteria.`$skip=50*" + } + } + + It 'with ItemPath parameters should return all commits for the repo' { + Get-VSTeamGitCommit -ProjectName Test -RepositoryId '06E176BE-D3D2-41C2-AB34-5F4D79AEC86B' ` + -ItemPath 'test' ` + -ExcludeDeletes ` + -HistoryMode 'fullHistory' ` + -Top 100 -Skip 50 ` + -User "Test" + + Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -like "*repositories/06E176BE-D3D2-41C2-AB34-5F4D79AEC86B/commits*" -and + $Uri -like "*searchCriteria.itemPath=test*" -and + $Uri -like "*searchCriteria.excludeDeletes=true*" -and + $Uri -like "*searchCriteria.historyMode=fullHistory*" -and + $Uri -like "*searchCriteria.`$top=100*" -and + $Uri -like "*searchCriteria.`$skip=50*" + } + } + } } \ No newline at end of file diff --git a/unit/test/Get-VSTeamGitRef.Tests.ps1 b/unit/test/Get-VSTeamGitRef.Tests.ps1 index 5975fa318..aae524340 100644 --- a/unit/test/Get-VSTeamGitRef.Tests.ps1 +++ b/unit/test/Get-VSTeamGitRef.Tests.ps1 @@ -11,6 +11,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamUserEntitlement.ps1" . "$here/../../Source/Classes/VSTeamRef.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Public/$sut" @@ -18,8 +20,6 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") Describe "VSTeamGitRef" { ## Arrange - . "$PSScriptRoot\mocks\mockProjectNameDynamicParam.ps1" - # Set the account to use for testing. A normal user would do this # using the Set-VSTeamAccount function. Mock _getInstance { return 'https://dev.azure.com/test' } diff --git a/unit/test/Get-VSTeamGitRepository.Tests.ps1 b/unit/test/Get-VSTeamGitRepository.Tests.ps1 index 715387cca..3b9fb383e 100644 --- a/unit/test/Get-VSTeamGitRepository.Tests.ps1 +++ b/unit/test/Get-VSTeamGitRepository.Tests.ps1 @@ -10,6 +10,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamDirectory.ps1" . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Classes/VSTeamUserEntitlement.ps1" . "$here/../../Source/Classes/VSTeamTeams.ps1" . "$here/../../Source/Classes/VSTeamRepositories.ps1" @@ -95,8 +97,6 @@ Describe "VSTeamGitRepository" { ## a project and these tests are written to test without one. Clear-VSTeamDefaultProject - . "$PSScriptRoot\mocks\mockProjectNameDynamicParam.ps1" - Mock Invoke-RestMethod { # Write-Host "results $Uri" return $results } diff --git a/unit/test/Get-VSTeamGitStat.Tests.ps1 b/unit/test/Get-VSTeamGitStat.Tests.ps1 index e77e8b5a6..2233bdd62 100644 --- a/unit/test/Get-VSTeamGitStat.Tests.ps1 +++ b/unit/test/Get-VSTeamGitStat.Tests.ps1 @@ -1,86 +1,86 @@ -Set-StrictMode -Version Latest - -#region include -Import-Module SHiPS - -$here = Split-Path -Parent $MyInvocation.MyCommand.Path -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") - -. "$here/../../Source/Classes/VSTeamLeaf.ps1" -. "$here/../../Source/Classes/VSTeamVersions.ps1" -. "$here/../../Source/Classes/VSTeamFeed.ps1" -. "$here/../../Source/Classes/VSTeamProjectCache.ps1" -. "$here/../../Source/Private/common.ps1" -. "$here/../../Source/Private/applyTypes.ps1" -. "$here/../../Source/Public/$sut" -#endregion - -Describe "TeamGitStat" { - ## Arrange - . "$PSScriptRoot\mocks\mockProjectNameDynamicParam.ps1" - - $singleResult = Get-Content "$PSScriptRoot\sampleFiles\gitStatSingleResult.json" -Raw | ConvertFrom-Json - - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } - - Mock Invoke-RestMethod { return $singleResult } - - Context 'Get-VSTeamGitStat' { - It 'should return multiple results' { - ## Act - Get-VSTeamGitStat -ProjectName Test -RepositoryId 00000000-0000-0000-0000-000000000000 - - ## Assert - Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -like "*/Test/*" -and - $Uri -like "*repositories/00000000-0000-0000-0000-000000000000/stats/branches*" - } - } - - It 'by branch name should return multiple results' { - ## Act - Get-VSTeamGitStat -ProjectName Test -RepositoryId 00000000-0000-0000-0000-000000000000 -BranchName develop - - ## Assert - Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -like "*/Test/*" -and - $Uri -like "*repositories/00000000-0000-0000-0000-000000000000/stats/branches*" -and - $Uri -like "*name=develop*" - } - } - - It 'by tag should return multiple results' { - ## Act - Get-VSTeamGitStat -ProjectName Test -RepositoryId 00000000-0000-0000-0000-000000000000 -BranchName "develop" -VersionType "tag" -Version "test" - - ## Assert - Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -like "*/Test/*" -and - $Uri -like "*repositories/00000000-0000-0000-0000-000000000000/stats/branches*" -and - $Uri -like "*baseVersionDescriptor.versionType=tag*" -and - $Uri -like "*baseVersionDescriptor.version=test*" - } - } - - It 'by tag with options should return multiple results' { - ## Act - Get-VSTeamGitStat -ProjectName Test -RepositoryId 00000000-0000-0000-0000-000000000000 -BranchName "develop" -VersionType "tag" -Version "test" -VersionOptions previousChange - - ## Assert - Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -like "*/Test/*" -and - $Uri -like "*repositories/00000000-0000-0000-0000-000000000000/stats/branches*" -and - $Uri -like "*baseVersionDescriptor.versionType=tag*" -and - $Uri -like "*baseVersionDescriptor.version=test*" -and - $Uri -like "*baseVersionDescriptor.versionOptions=previousChange*" - } - } - - It 'by commit should throw because of invalid parameters' { - ## Act / Assert - { Get-VSTeamGitStat -ProjectName Test -RepositoryId 00000000-0000-0000-0000-000000000000 -VersionType commit -Version '' } | Should Throw - } - } +Set-StrictMode -Version Latest + +#region include +Import-Module SHiPS + +$here = Split-Path -Parent $MyInvocation.MyCommand.Path +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") + +. "$here/../../Source/Classes/VSTeamLeaf.ps1" +. "$here/../../Source/Classes/VSTeamVersions.ps1" +. "$here/../../Source/Classes/VSTeamFeed.ps1" +. "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" +. "$here/../../Source/Private/common.ps1" +. "$here/../../Source/Private/applyTypes.ps1" +. "$here/../../Source/Public/$sut" +#endregion + +Describe "TeamGitStat" { + ## Arrange + $singleResult = Get-Content "$PSScriptRoot\sampleFiles\gitStatSingleResult.json" -Raw | ConvertFrom-Json + + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } + + Mock Invoke-RestMethod { return $singleResult } + + Context 'Get-VSTeamGitStat' { + It 'should return multiple results' { + ## Act + Get-VSTeamGitStat -ProjectName Test -RepositoryId 00000000-0000-0000-0000-000000000000 + + ## Assert + Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -like "*/Test/*" -and + $Uri -like "*repositories/00000000-0000-0000-0000-000000000000/stats/branches*" + } + } + + It 'by branch name should return multiple results' { + ## Act + Get-VSTeamGitStat -ProjectName Test -RepositoryId 00000000-0000-0000-0000-000000000000 -BranchName develop + + ## Assert + Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -like "*/Test/*" -and + $Uri -like "*repositories/00000000-0000-0000-0000-000000000000/stats/branches*" -and + $Uri -like "*name=develop*" + } + } + + It 'by tag should return multiple results' { + ## Act + Get-VSTeamGitStat -ProjectName Test -RepositoryId 00000000-0000-0000-0000-000000000000 -BranchName "develop" -VersionType "tag" -Version "test" + + ## Assert + Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -like "*/Test/*" -and + $Uri -like "*repositories/00000000-0000-0000-0000-000000000000/stats/branches*" -and + $Uri -like "*baseVersionDescriptor.versionType=tag*" -and + $Uri -like "*baseVersionDescriptor.version=test*" + } + } + + It 'by tag with options should return multiple results' { + ## Act + Get-VSTeamGitStat -ProjectName Test -RepositoryId 00000000-0000-0000-0000-000000000000 -BranchName "develop" -VersionType "tag" -Version "test" -VersionOptions previousChange + + ## Assert + Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -like "*/Test/*" -and + $Uri -like "*repositories/00000000-0000-0000-0000-000000000000/stats/branches*" -and + $Uri -like "*baseVersionDescriptor.versionType=tag*" -and + $Uri -like "*baseVersionDescriptor.version=test*" -and + $Uri -like "*baseVersionDescriptor.versionOptions=previousChange*" + } + } + + It 'by commit should throw because of invalid parameters' { + ## Act / Assert + { Get-VSTeamGitStat -ProjectName Test -RepositoryId 00000000-0000-0000-0000-000000000000 -VersionType commit -Version '' } | Should Throw + } + } } \ No newline at end of file diff --git a/unit/test/Get-VSTeamGroup.Tests.ps1 b/unit/test/Get-VSTeamGroup.Tests.ps1 index 9677f4dc6..38f0876b0 100644 --- a/unit/test/Get-VSTeamGroup.Tests.ps1 +++ b/unit/test/Get-VSTeamGroup.Tests.ps1 @@ -9,6 +9,10 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamLeaf.ps1" . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" +. "$here/../../Source/Classes/UncachedProjectCompleter.ps1" +. "$here/../../Source/Classes/UncachedProjectValidateAttribute.ps1" . "$here/../../Source/Classes/VSTeamGroup.ps1" . "$here/../../Source/Classes/VSTeamDescriptor.ps1" . "$here/../../Source/Private/common.ps1" diff --git a/unit/test/Get-VSTeamInfo.Tests.ps1 b/unit/test/Get-VSTeamInfo.Tests.ps1 index c8ee60e92..dee9c2a90 100644 --- a/unit/test/Get-VSTeamInfo.Tests.ps1 +++ b/unit/test/Get-VSTeamInfo.Tests.ps1 @@ -1,34 +1,32 @@ -Set-StrictMode -Version Latest - -#region include -$here = Split-Path -Parent $MyInvocation.MyCommand.Path -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") - -. "$here/../../Source/Classes/VSTeamVersions.ps1" -. "$here/../../Source/Classes/VSTeamProjectCache.ps1" -. "$here/../../Source/Private/common.ps1" -. "$here/../../Source/Public/$sut" -#endregion - -Describe 'VSTeamInfo' { - ## Arrange - . "$PSScriptRoot\mocks\mockProjectDynamicParamMandatoryFalse.ps1" - - Context 'Get-VSTeamInfo' { - AfterAll { - $Global:PSDefaultParameterValues.Remove("*:projectName") - } - - It 'should return account and default project' { - [VSTeamVersions]::Account = "mydemos" - $Global:PSDefaultParameterValues['*:projectName'] = 'TestProject' - - ## Act - $info = Get-VSTeamInfo - - ## Assert - $info.Account | Should Be "mydemos" - $info.DefaultProject | Should Be "TestProject" - } - } +Set-StrictMode -Version Latest + +#region include +$here = Split-Path -Parent $MyInvocation.MyCommand.Path +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") + +. "$here/../../Source/Classes/VSTeamVersions.ps1" +. "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Private/common.ps1" +. "$here/../../Source/Public/$sut" +#endregion + +Describe 'VSTeamInfo' { + ## Arrange + Context 'Get-VSTeamInfo' { + AfterAll { + $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") + } + + It 'should return account and default project' { + [VSTeamVersions]::Account = "mydemos" + $Global:PSDefaultParameterValues['*-vsteam*:projectName'] = 'TestProject' + + ## Act + $info = Get-VSTeamInfo + + ## Assert + $info.Account | Should Be "mydemos" + $info.DefaultProject | Should Be "TestProject" + } + } } \ No newline at end of file diff --git a/unit/test/Get-VSTeamJobRequest.Tests.ps1 b/unit/test/Get-VSTeamJobRequest.Tests.ps1 index 255255670..d4f9546ee 100644 --- a/unit/test/Get-VSTeamJobRequest.Tests.ps1 +++ b/unit/test/Get-VSTeamJobRequest.Tests.ps1 @@ -1,85 +1,86 @@ -Import-Module SHiPS - -#region include -$here = Split-Path -Parent $MyInvocation.MyCommand.Path -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") - -. "$here/../../Source/Classes/VSTeamVersions.ps1" -. "$here/../../Source/Classes/VSTeamProjectCache.ps1" -. "$here/../../Source/Classes/VSTeamLeaf.ps1" -. "$here/../../Source/Classes/VSTeamJobRequest.ps1" -. "$here/../../Source/Private/common.ps1" -. "$here/../../Source/Public/$sut" -#endregion - -Describe "Get-VSTeamJobRequest" { - ## Arrange - $resultsAzD = Get-Content "$PSScriptRoot/sampleFiles/jobrequestsAzD.json" -Raw | ConvertFrom-Json - $results2017 = Get-Content "$PSScriptRoot/sampleFiles/jobrequests2017.json" -Raw | ConvertFrom-Json - - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'DistributedTask' } - - Context "Server" { - ## Arrnage - Mock Invoke-RestMethod { return $results2017 } - Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } - - It "return all jobs" { - ## Act - Get-VSTeamJobRequest -PoolId 5 -AgentID 4 - - ## Assert - Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -like "*http://localhost:8080/tfs/defaultcollection/_apis/distributedtask/pools/5/jobrequests*" -and - $Uri -like "*api-version=$(_getApiVersion DistributedTask)*" -and - $Uri -like "*agentid=4*" - } - } - - It "return 2 jobs" { - # This should stop the call to cache projects - [VSTeamProjectCache]::timestamp = (Get-Date).Minute - - Get-VSTeamJobRequest -PoolId 5 -AgentID 4 -completedRequestCount 2 - - Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -like "*http://localhost:8080/tfs/defaultcollection/_apis/distributedtask/pools/5/jobrequests*" -and - $Uri -like "*api-version=$(_getApiVersion DistributedTask)*" -and - $Uri -like "*agentid=4*" -and - $Uri -like "*completedRequestCount=2*" - } - } - } - - Context "Services" { - Mock Invoke-RestMethod { return $resultsAzD } - Mock _getInstance { return 'https://dev.azure.com/test' } - - It "return all jobs" { - # This should stop the call to cache projects - [VSTeamProjectCache]::timestamp = (Get-Date).Minute - - Get-VSTeamJobRequest -PoolId 5 -AgentID 4 - - Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -like "*https://dev.azure.com/test/_apis/distributedtask/pools/5/jobrequests*" -and - $Uri -like "*api-version=$(_getApiVersion DistributedTask)*" -and - $Uri -like "*agentid=4*" - } - } - - It "return 2 jobs" { - # This should stop the call to cache projects - [VSTeamProjectCache]::timestamp = (Get-Date).Minute - - Get-VSTeamJobRequest -PoolId 5 -AgentID 4 -completedRequestCount 2 - - Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -like "*https://dev.azure.com/test/_apis/distributedtask/pools/5/jobrequests*" -and - $Uri -like "*api-version=$(_getApiVersion DistributedTask)*" -and - $Uri -like "*agentid=4*" -and - $Uri -like "*completedRequestCount=2*" - } - } - } +Import-Module SHiPS + +#region include +$here = Split-Path -Parent $MyInvocation.MyCommand.Path +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") + +. "$here/../../Source/Classes/VSTeamVersions.ps1" +. "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" +. "$here/../../Source/Classes/VSTeamLeaf.ps1" +. "$here/../../Source/Classes/VSTeamJobRequest.ps1" +. "$here/../../Source/Private/common.ps1" +. "$here/../../Source/Public/$sut" +#endregion + +Describe "Get-VSTeamJobRequest" { + ## Arrange + $resultsAzD = Get-Content "$PSScriptRoot/sampleFiles/jobrequestsAzD.json" -Raw | ConvertFrom-Json + $results2017 = Get-Content "$PSScriptRoot/sampleFiles/jobrequests2017.json" -Raw | ConvertFrom-Json + + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'DistributedTask' } + + Context "Server" { + ## Arrnage + Mock Invoke-RestMethod { return $results2017 } + Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } + + It "return all jobs" { + ## Act + Get-VSTeamJobRequest -PoolId 5 -AgentID 4 + + ## Assert + Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -like "*http://localhost:8080/tfs/defaultcollection/_apis/distributedtask/pools/5/jobrequests*" -and + $Uri -like "*api-version=$(_getApiVersion DistributedTask)*" -and + $Uri -like "*agentid=4*" + } + } + + It "return 2 jobs" { + # This should stop the call to cache projects + [VSTeamProjectCache]::timestamp = (Get-Date).Minute + + Get-VSTeamJobRequest -PoolId 5 -AgentID 4 -completedRequestCount 2 + + Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -like "*http://localhost:8080/tfs/defaultcollection/_apis/distributedtask/pools/5/jobrequests*" -and + $Uri -like "*api-version=$(_getApiVersion DistributedTask)*" -and + $Uri -like "*agentid=4*" -and + $Uri -like "*completedRequestCount=2*" + } + } + } + + Context "Services" { + Mock Invoke-RestMethod { return $resultsAzD } + Mock _getInstance { return 'https://dev.azure.com/test' } + + It "return all jobs" { + # This should stop the call to cache projects + [VSTeamProjectCache]::timestamp = (Get-Date).Minute + + Get-VSTeamJobRequest -PoolId 5 -AgentID 4 + + Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -like "*https://dev.azure.com/test/_apis/distributedtask/pools/5/jobrequests*" -and + $Uri -like "*api-version=$(_getApiVersion DistributedTask)*" -and + $Uri -like "*agentid=4*" + } + } + + It "return 2 jobs" { + # This should stop the call to cache projects + [VSTeamProjectCache]::timestamp = (Get-Date).Minute + + Get-VSTeamJobRequest -PoolId 5 -AgentID 4 -completedRequestCount 2 + + Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -like "*https://dev.azure.com/test/_apis/distributedtask/pools/5/jobrequests*" -and + $Uri -like "*api-version=$(_getApiVersion DistributedTask)*" -and + $Uri -like "*agentid=4*" -and + $Uri -like "*completedRequestCount=2*" + } + } + } } \ No newline at end of file diff --git a/unit/test/Get-VSTeamMember.Tests.ps1 b/unit/test/Get-VSTeamMember.Tests.ps1 index a6eec9d01..af5b15167 100644 --- a/unit/test/Get-VSTeamMember.Tests.ps1 +++ b/unit/test/Get-VSTeamMember.Tests.ps1 @@ -6,6 +6,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/Set-VSTeamAPIVersion.ps1" @@ -16,8 +18,6 @@ Describe "VSTeamMember" { Mock _getInstance { return 'https://dev.azure.com/test' } Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } - . "$PSScriptRoot\mocks\mockProjectNameDynamicParam.ps1" - Context 'Get-VSTeamMember for specific project and team' { Mock Invoke-RestMethod { return @{value = 'teams' } } diff --git a/unit/test/Get-VSTeamMembership.Tests.ps1 b/unit/test/Get-VSTeamMembership.Tests.ps1 index 66849226a..41f388794 100644 --- a/unit/test/Get-VSTeamMembership.Tests.ps1 +++ b/unit/test/Get-VSTeamMembership.Tests.ps1 @@ -6,6 +6,7 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Private/callMembershipAPI.ps1" . "$here/../../Source/Public/Get-VSTeamProject.ps1" diff --git a/unit/test/Get-VSTeamOption.Tests.ps1 b/unit/test/Get-VSTeamOption.Tests.ps1 index fbf5133dd..10ede1efd 100644 --- a/unit/test/Get-VSTeamOption.Tests.ps1 +++ b/unit/test/Get-VSTeamOption.Tests.ps1 @@ -1,53 +1,54 @@ -Set-StrictMode -Version Latest - -#region include -$here = Split-Path -Parent $MyInvocation.MyCommand.Path -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") - -. "$here/../../Source/Classes/VSTeamVersions.ps1" -. "$here/../../Source/Classes/VSTeamProjectCache.ps1" -. "$here/../../Source/Private/common.ps1" -. "$here/../../Source/Private/applyTypes.ps1" -. "$here/../../Source/Public/$sut" -#endregion - -Describe 'Get-VSTeamOption' { - Context 'Get-VSTeamOption' { - ## Arrange - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable - - Mock Invoke-RestMethod { return @{ - count = 1 - value = @( - @{ - id = '5e8a8081-3851-4626-b677-9891cc04102e' - area = 'git' - resourceName = 'annotatedTags' - } - ) - } - } - - It 'Should return all options' { - ## Act - Get-VSTeamOption | Should Not Be $null - - ## Assert - Assert-MockCalled Invoke-RestMethod -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis" - } - } - - It 'Should return release options' { - ## Act - Get-VSTeamOption -subDomain vsrm | Should Not Be $null - - ## Assert - Assert-MockCalled Invoke-RestMethod -ParameterFilter { - $Uri -eq "https://vsrm.dev.azure.com/test/_apis" - } - } - } +Set-StrictMode -Version Latest + +#region include +$here = Split-Path -Parent $MyInvocation.MyCommand.Path +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") + +. "$here/../../Source/Classes/VSTeamVersions.ps1" +. "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" +. "$here/../../Source/Private/common.ps1" +. "$here/../../Source/Private/applyTypes.ps1" +. "$here/../../Source/Public/$sut" +#endregion + +Describe 'Get-VSTeamOption' { + Context 'Get-VSTeamOption' { + ## Arrange + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable + + Mock Invoke-RestMethod { return @{ + count = 1 + value = @( + @{ + id = '5e8a8081-3851-4626-b677-9891cc04102e' + area = 'git' + resourceName = 'annotatedTags' + } + ) + } + } + + It 'Should return all options' { + ## Act + Get-VSTeamOption | Should Not Be $null + + ## Assert + Assert-MockCalled Invoke-RestMethod -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/_apis" + } + } + + It 'Should return release options' { + ## Act + Get-VSTeamOption -subDomain vsrm | Should Not Be $null + + ## Assert + Assert-MockCalled Invoke-RestMethod -ParameterFilter { + $Uri -eq "https://vsrm.dev.azure.com/test/_apis" + } + } + } } \ No newline at end of file diff --git a/unit/test/Get-VSTeamPermissionInheritance.Tests.ps1 b/unit/test/Get-VSTeamPermissionInheritance.Tests.ps1 index 54de5ff97..88ea1e8c9 100644 --- a/unit/test/Get-VSTeamPermissionInheritance.Tests.ps1 +++ b/unit/test/Get-VSTeamPermissionInheritance.Tests.ps1 @@ -8,6 +8,10 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" +. "$here/../../Source/Classes/UncachedProjectCompleter.ps1" +. "$here/../../Source/Classes/UncachedProjectValidateAttribute.ps1" . "$here/../../Source/Classes/VSTeamLeaf.ps1" . "$here/../../Source/Classes/VSTeamSecurityNamespace.ps1" . "$here/../../Source/Classes/VSTeamPermissionInheritance.ps1" diff --git a/unit/test/Get-VSTeamPolicy.Tests.ps1 b/unit/test/Get-VSTeamPolicy.Tests.ps1 index 94c53a172..bc8559358 100644 --- a/unit/test/Get-VSTeamPolicy.Tests.ps1 +++ b/unit/test/Get-VSTeamPolicy.Tests.ps1 @@ -6,6 +6,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Public/Get-VSTeamProject.ps1" diff --git a/unit/test/Get-VSTeamPolicyType.Tests.ps1 b/unit/test/Get-VSTeamPolicyType.Tests.ps1 index 4ec750786..d00d33f71 100644 --- a/unit/test/Get-VSTeamPolicyType.Tests.ps1 +++ b/unit/test/Get-VSTeamPolicyType.Tests.ps1 @@ -6,6 +6,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Public/Get-VSTeamProject.ps1" diff --git a/unit/test/Get-VSTeamPool.Tests.ps1 b/unit/test/Get-VSTeamPool.Tests.ps1 index 1202bd102..88d8b734b 100644 --- a/unit/test/Get-VSTeamPool.Tests.ps1 +++ b/unit/test/Get-VSTeamPool.Tests.ps1 @@ -10,6 +10,7 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamDirectory.ps1" . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Classes/VSTeamUserEntitlement.ps1" . "$here/../../Source/Classes/VSTeamPool.ps1" . "$here/../../Source/Private/common.ps1" diff --git a/unit/test/Get-VSTeamProcess.Tests.ps1 b/unit/test/Get-VSTeamProcess.Tests.ps1 index 674c9a539..65f9f8ac9 100644 --- a/unit/test/Get-VSTeamProcess.Tests.ps1 +++ b/unit/test/Get-VSTeamProcess.Tests.ps1 @@ -1,107 +1,109 @@ -Set-StrictMode -Version Latest - -#region include -$here = Split-Path -Parent $MyInvocation.MyCommand.Path -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") - -. "$here/../../Source/Classes/VSTeamVersions.ps1" -. "$here/../../Source/Classes/VSTeamProcess.ps1" -. "$here/../../Source/Classes/VSTeamProjectCache.ps1" -. "$here/../../Source/Classes/VSTeamProcessCache.ps1" -. "$here/../../Source/Private/common.ps1" -. "$here/../../Source/Public/$sut" -#endregion - -Describe 'VSTeamProcess' { - . "$PSScriptRoot\mocks\mockProcessNameDynamicParam.ps1" - - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } - - - $results = [PSCustomObject]@{ - value = [PSCustomObject]@{ - name = 'Test' - description = '' - url = '' - id = '123-5464-dee43' - isDefault = 'false' - type = 'Agile' - } - } - - $singleResult = [PSCustomObject]@{ - name = 'Test' - description = '' - url = '' - id = '123-5464-dee43' - isDefault = 'false' - type = 'Agile' - } - - Mock Invoke-RestMethod { return $results } - Mock Invoke-RestMethod { return $singleResult } -ParameterFilter { - $Uri -like "*123-5464-dee43*" - } - - Context 'Get-VSTeamProcess' { - It 'with no parameters using BearerToken should return process' { - ## Act - Get-VSTeamProcess - - ## Assert - # Make sure it was called with the correct URI - Assert-MockCalled Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "*https://dev.azure.com/test/_apis/process/processes*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Uri -like "*`$top=100*" - } - } - - It 'with top 10 should return top 10 process' { - ## Act - Get-VSTeamProcess -top 10 - - ## Assert - # Make sure it was called with the correct URI - Assert-MockCalled Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "*https://dev.azure.com/test/_apis/process/processes*" -and - $Uri -like "*`$top=10*" - } - } - - It 'with skip 1 should skip first process' { - ## Act - Get-VSTeamProcess -skip 1 - - ## Assert - # Make sure it was called with the correct URI - Assert-MockCalled Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "*https://dev.azure.com/test/_apis/process/processes*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Uri -like "*`$skip=1*" -and - $Uri -like "*`$top=100*" - } - } - - It 'by Name should return Process by Name' { - Get-VSTeamProcess -Name Agile - - # Make sure it was called with the correct URI - Assert-MockCalled Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "*https://dev.azure.com/test/_apis/process/processes*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" - } - } - - It 'by Id should return Process by Id' { - Get-VSTeamProcess -Id '123-5464-dee43' - - # Make sure it was called with the correct URI - Assert-MockCalled Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "*https://dev.azure.com/test/_apis/process/processes/123-5464-dee43*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" - } - } - } +Set-StrictMode -Version Latest + +#region include +$here = Split-Path -Parent $MyInvocation.MyCommand.Path +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") + +. "$here/../../Source/Classes/VSTeamVersions.ps1" +. "$here/../../Source/Classes/VSTeamProcess.ps1" +. "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/VSTeamProcessCache.ps1" +. "$here/../../Source/Classes/ProcessTemplateCompleter.ps1" +. "$here/../../Source/Classes/ProcessValidateAttribute.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" +. "$here/../../Source/Private/common.ps1" +. "$here/../../Source/Public/$sut" +#endregion + +Describe 'VSTeamProcess' { + Mock _getProjects { return @() } + Mock _hasProjectCacheExpired { return $true } + Mock _hasProcessTemplateCacheExpired { return $true } + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } + + $results = [PSCustomObject]@{ + value = [PSCustomObject]@{ + name = 'Agile' + description = '' + url = '' + id = '123-5464-dee43' + isDefault = 'false' + type = 'Agile' + } + } + + $singleResult = [PSCustomObject]@{ + name = 'Agile' + description = '' + url = '' + id = '123-5464-dee43' + isDefault = 'false' + type = 'Agile' + } + + Mock Invoke-RestMethod { return $results } + Mock Invoke-RestMethod { return $singleResult } -ParameterFilter { $Uri -like "*123-5464-dee43*" } + + Context 'Get-VSTeamProcess' { + It 'with no parameters using BearerToken should return process' { + ## Act + Get-VSTeamProcess + + ## Assert + # Make sure it was called with the correct URI + Assert-MockCalled Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "*https://dev.azure.com/test/_apis/process/processes*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Uri -like "*`$top=100*" + } + } + + It 'with top 10 should return top 10 process' { + ## Act + Get-VSTeamProcess -top 10 + + ## Assert + # Make sure it was called with the correct URI + Assert-MockCalled Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "*https://dev.azure.com/test/_apis/process/processes*" -and + $Uri -like "*`$top=10*" + } + } + + It 'with skip 1 should skip first process' { + ## Act + Get-VSTeamProcess -skip 1 + + ## Assert + # Make sure it was called with the correct URI + Assert-MockCalled Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "*https://dev.azure.com/test/_apis/process/processes*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Uri -like "*`$skip=1*" -and + $Uri -like "*`$top=100*" + } + } + + It 'by Name should return Process by Name' { + Get-VSTeamProcess -Name Agile + + # Make sure it was called with the correct URI + # It is called twice once for the call and once for the validator + Assert-MockCalled Invoke-RestMethod -Exactly -Times 2 -Scope It -ParameterFilter { + $Uri -like "*https://dev.azure.com/test/_apis/process/processes*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" + } + } + + It 'by Id should return Process by Id' { + Get-VSTeamProcess -Id '123-5464-dee43' + + # Make sure it was called with the correct URI + Assert-MockCalled Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "*https://dev.azure.com/test/_apis/process/processes/123-5464-dee43*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" + } + } + } } \ No newline at end of file diff --git a/unit/test/Get-VSTeamProject.Tests.ps1 b/unit/test/Get-VSTeamProject.Tests.ps1 index 9e8dca3a5..cb9c5a38d 100644 --- a/unit/test/Get-VSTeamProject.Tests.ps1 +++ b/unit/test/Get-VSTeamProject.Tests.ps1 @@ -10,6 +10,10 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamDirectory.ps1" . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" +. "$here/../../Source/Classes/UncachedProjectCompleter.ps1" +. "$here/../../Source/Classes/UncachedProjectValidateAttribute.ps1" . "$here/../../Source/Classes/VSTeamUserEntitlement.ps1" . "$here/../../Source/Classes/VSTeamTeams.ps1" . "$here/../../Source/Classes/VSTeamRepositories.ps1" @@ -42,9 +46,6 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") Describe 'VSTeamProject' { Mock _getInstance { return 'https://dev.azure.com/test' } Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } - - . "$PSScriptRoot\mocks\mockProjectNameDynamicParam.ps1" - . "$PSScriptRoot\mocks\mockProcessNameDynamicParam.ps1" $results = [PSCustomObject]@{ value = [PSCustomObject]@{ diff --git a/unit/test/Get-VSTeamPullRequest.Tests.ps1 b/unit/test/Get-VSTeamPullRequest.Tests.ps1 index 390a05ce3..dad1476c1 100644 --- a/unit/test/Get-VSTeamPullRequest.Tests.ps1 +++ b/unit/test/Get-VSTeamPullRequest.Tests.ps1 @@ -7,6 +7,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProcess.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Classes/VSTeamProcessCache.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Private/common.ps1" @@ -18,14 +20,12 @@ Describe 'VSTeamPullRequest' { # can be tested. Update-TypeData -AppendPath "$here/../../Source/types/Team.PullRequest.ps1xml" -ErrorAction Ignore - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" + Mock _getProjects { return $null } + Mock _hasProjectCacheExpired { return $true } Mock _getInstance { return 'https://dev.azure.com/test' } Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Git' } - # You have to set the version or the api-version will not be added when versions = '' - [VSTeamVersions]::Git = '5.1-preview' - $singleResult = @{ pullRequestId = 1 repositoryName = "testreponame" @@ -70,7 +70,7 @@ Describe 'VSTeamPullRequest' { } It 'with no parameters' { - $Global:PSDefaultParameterValues.Remove("*:ProjectName") + $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") Get-VSTeamPullRequest Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { @@ -79,7 +79,7 @@ Describe 'VSTeamPullRequest' { } It 'with default project name' { - $Global:PSDefaultParameterValues["*:ProjectName"] = 'testproject' + $Global:PSDefaultParameterValues["*-vsteam*:projectName"] = 'testproject' Get-VSTeamPullRequest -ProjectName testproject Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { @@ -88,7 +88,7 @@ Describe 'VSTeamPullRequest' { } It 'By ProjectName' { - $Global:PSDefaultParameterValues.Remove("*:ProjectName") + $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") Get-VSTeamPullRequest -ProjectName testproject Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { diff --git a/unit/test/Get-VSTeamQueue.Tests.ps1 b/unit/test/Get-VSTeamQueue.Tests.ps1 index 9304dc49a..6ed41c4fd 100644 --- a/unit/test/Get-VSTeamQueue.Tests.ps1 +++ b/unit/test/Get-VSTeamQueue.Tests.ps1 @@ -1,12 +1,20 @@ Set-StrictMode -Version Latest #region include +Import-Module SHiPS + $here = Split-Path -Parent $MyInvocation.MyCommand.Path $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +. "$here/../../Source/Classes/VSTeamLeaf.ps1" +. "$here/../../Source/Classes/VSTeamDirectory.ps1" . "$here/../../Source/Classes/VSTeamVersions.ps1" +. "$here/../../Source/Classes/VSTeamUserEntitlement.ps1" +. "$here/../../Source/Classes/VSTeamPool.ps1" . "$here/../../Source/Classes/VSTeamQueue.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Public/Get-VSTeamProject.ps1" @@ -15,7 +23,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") Describe 'VSTeamQueue' { ## Arrange - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" + Mock _getProjects { return $null } + Mock _hasProjectCacheExpired { return $true } Mock _getInstance { return 'https://dev.azure.com/test' } Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'DistributedTask' } @@ -24,9 +33,7 @@ Describe 'VSTeamQueue' { Mock Invoke-RestMethod { return @() } -ParameterFilter { $Uri -like "*_apis/projects*" } Mock Invoke-RestMethod { return @{ value = @{ id = 3; name = 'Hosted'; pool = @{ } } } } - Mock Invoke-RestMethod { return @{ id = 101; name = 'Hosted'; pool = @{ } } } -ParameterFilter { - $Uri -like "*101*" - } + Mock Invoke-RestMethod { return @{ id = 101; name = 'Hosted'; pool = @{ } } } -ParameterFilter { $Uri -like "*101*" } Context 'Get-VSTeamQueue' { It 'should return requested queue' { diff --git a/unit/test/Get-VSTeamRelease.Tests.ps1 b/unit/test/Get-VSTeamRelease.Tests.ps1 index 399bb746d..25e42fc86 100644 --- a/unit/test/Get-VSTeamRelease.Tests.ps1 +++ b/unit/test/Get-VSTeamRelease.Tests.ps1 @@ -1,101 +1,99 @@ -Set-StrictMode -Version Latest - -#region include -Import-Module SHiPS - -$here = Split-Path -Parent $MyInvocation.MyCommand.Path -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") - -. "$here/../../Source/Classes/VSTeamLeaf.ps1" -. "$here/../../Source/Classes/VSTeamVersions.ps1" -. "$here/../../Source/Classes/VSTeamFeed.ps1" -. "$here/../../Source/Classes/VSTeamProjectCache.ps1" -. "$here/../../Source/Private/common.ps1" -. "$here/../../Source/Private/applyTypes.ps1" -. "$here/../../Source/Public/$sut" -#endregion - -Describe 'VSTeamRelease' { - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" - - [VSTeamVersions]::Release = '1.0-unittest' - $results = Get-Content "$PSScriptRoot\sampleFiles\releaseResults.json" -Raw | ConvertFrom-Json - $singleResult = Get-Content "$PSScriptRoot\sampleFiles\releaseSingleReult.json" -Raw | ConvertFrom-Json - - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Release' } - - Mock Invoke-RestMethod { return $results } - Mock Invoke-RestMethod { return $singleResult } -ParameterFilter { - $Uri -like "*15*" - } - - Context 'Get-VSTeamRelease' { - - It 'by Id -Raw should return release as Raw' { - ## Act - $raw = Get-VSTeamRelease -ProjectName project -Id 15 -Raw - - ## Assert - $raw | Get-Member | Select-Object -First 1 -ExpandProperty TypeName | Should be 'System.Management.Automation.PSCustomObject' - - Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/releases/15?api-version=$(_getApiVersion Release)" - } - } - - It 'by Id should return release as Object' { - ## Act - $r = Get-VSTeamRelease -ProjectName project -Id 15 - - ## Assert - $r | Get-Member | Select-Object -First 1 -ExpandProperty TypeName | Should be 'Team.Release' - - Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/releases/15?api-version=$(_getApiVersion Release)" - } - } - - It 'by Id -JSON should return release as JSON' { - ## Act - $r = Get-VSTeamRelease -ProjectName project -Id 15 -JSON - - ## Assert - $r | Get-Member | Select-Object -First 1 -ExpandProperty TypeName | Should be 'System.String' - - Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/releases/15?api-version=$(_getApiVersion Release)" - } - } - - It 'with no parameters should return releases' { - ## Act - Get-VSTeamRelease -projectName project - - ## Assert - Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/releases?api-version=$(_getApiVersion Release)" - } - } - - It 'with expand environments should return releases' { - ## Act - Get-VSTeamRelease -projectName project -expand environments - - ## Assert - Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/releases?api-version=$(_getApiVersion Release)&`$expand=environments" - } - } - - It 'with no parameters & no project should return releases' { - ## Act - Get-VSTeamRelease - - ## Assert - Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://vsrm.dev.azure.com/test/_apis/release/releases?api-version=$(_getApiVersion Release)" - } - } - } +Set-StrictMode -Version Latest + +#region include +Import-Module SHiPS + +$here = Split-Path -Parent $MyInvocation.MyCommand.Path +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") + +. "$here/../../Source/Classes/VSTeamLeaf.ps1" +. "$here/../../Source/Classes/VSTeamVersions.ps1" +. "$here/../../Source/Classes/VSTeamFeed.ps1" +. "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" +. "$here/../../Source/Private/common.ps1" +. "$here/../../Source/Private/applyTypes.ps1" +. "$here/../../Source/Public/$sut" +#endregion + +Describe 'VSTeamRelease' { + $results = Get-Content "$PSScriptRoot\sampleFiles\releaseResults.json" -Raw | ConvertFrom-Json + $singleResult = Get-Content "$PSScriptRoot\sampleFiles\releaseSingleReult.json" -Raw | ConvertFrom-Json + + Mock _getProjects { return $null } + Mock _hasProjectCacheExpired { return $true } + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '1.0-unittest' } -ParameterFilter { $Service -eq 'Release' } + + Mock Invoke-RestMethod { return $results } + Mock Invoke-RestMethod { return $singleResult } -ParameterFilter { $Uri -like "*15*" } + + Context 'Get-VSTeamRelease' { + It 'by Id -Raw should return release as Raw' { + ## Act + $raw = Get-VSTeamRelease -ProjectName project -Id 15 -Raw + + ## Assert + $raw | Get-Member | Select-Object -First 1 -ExpandProperty TypeName | Should be 'System.Management.Automation.PSCustomObject' + + Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/releases/15?api-version=$(_getApiVersion Release)" + } + } + + It 'by Id should return release as Object' { + ## Act + $r = Get-VSTeamRelease -ProjectName project -Id 15 + + ## Assert + $r | Get-Member | Select-Object -First 1 -ExpandProperty TypeName | Should be 'Team.Release' + + Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/releases/15?api-version=$(_getApiVersion Release)" + } + } + + It 'by Id -JSON should return release as JSON' { + ## Act + $r = Get-VSTeamRelease -ProjectName project -Id 15 -JSON + + ## Assert + $r | Get-Member | Select-Object -First 1 -ExpandProperty TypeName | Should be 'System.String' + + Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/releases/15?api-version=$(_getApiVersion Release)" + } + } + + It 'with no parameters should return releases' { + ## Act + Get-VSTeamRelease -projectName project + + ## Assert + Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/releases?api-version=$(_getApiVersion Release)" + } + } + + It 'with expand environments should return releases' { + ## Act + Get-VSTeamRelease -projectName project -expand environments + + ## Assert + Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/releases?api-version=$(_getApiVersion Release)&`$expand=environments" + } + } + + It 'with no parameters & no project should return releases' { + ## Act + Get-VSTeamRelease + + ## Assert + Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://vsrm.dev.azure.com/test/_apis/release/releases?api-version=$(_getApiVersion Release)" + } + } + } } \ No newline at end of file diff --git a/unit/test/Get-VSTeamReleaseDefinition.Tests.ps1 b/unit/test/Get-VSTeamReleaseDefinition.Tests.ps1 index 7d23a9b04..146778d1c 100644 --- a/unit/test/Get-VSTeamReleaseDefinition.Tests.ps1 +++ b/unit/test/Get-VSTeamReleaseDefinition.Tests.ps1 @@ -1,60 +1,62 @@ -Set-StrictMode -Version Latest - -#region include -$here = Split-Path -Parent $MyInvocation.MyCommand.Path -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") - -. "$here/../../Source/Classes/VSTeamVersions.ps1" -. "$here/../../Source/Classes/VSTeamProjectCache.ps1" -. "$here/../../Source/Classes/VSTeamLeaf.ps1" -. "$here/../../Source/Classes/VSTeamUserEntitlement.ps1" -. "$here/../../Source/Classes/VSTeamReleaseDefinition.ps1" -. "$here/../../Source/Private/common.ps1" -. "$here/../../Source/Private/common.ps1" -. "$here/../../Source/Public/$sut" -#endregion - -Describe 'VSTeamReleaseDefinition' { - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" - - [VSTeamVersions]::Release = '1.0-unittest' - - $results = Get-Content "$PSScriptRoot\sampleFiles\releaseDefAzD.json" -Raw | ConvertFrom-Json - - Mock Invoke-RestMethod { return $results } - Mock Invoke-RestMethod { return $results.value[0] } -ParameterFilter { $Uri -like "*15*" } - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Release' } - - Context 'Get-VSTeamReleaseDefinition' { - It 'no parameters should return Release definitions' { - ## Act - Get-VSTeamReleaseDefinition -projectName project - - ## Assert - Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/definitions?api-version=$(_getApiVersion Release)" - } - } - - It 'expand environments should return Release definitions' { - ## Act - Get-VSTeamReleaseDefinition -projectName project -expand environments - - ## Assert - Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/definitions?api-version=$(_getApiVersion Release)&`$expand=environments" - } - } - - It 'by Id should return Release definition' { - ## Act - Get-VSTeamReleaseDefinition -projectName project -id 15 - - ## Assert - Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/definitions/15?api-version=$(_getApiVersion Release)" - } - } - } +Set-StrictMode -Version Latest + +#region include +Import-Module SHiPS + +$here = Split-Path -Parent $MyInvocation.MyCommand.Path +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") + +. "$here/../../Source/Classes/VSTeamVersions.ps1" +. "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" +. "$here/../../Source/Classes/VSTeamLeaf.ps1" +. "$here/../../Source/Classes/VSTeamUserEntitlement.ps1" +. "$here/../../Source/Classes/VSTeamReleaseDefinition.ps1" +. "$here/../../Source/Private/common.ps1" +. "$here/../../Source/Private/common.ps1" +. "$here/../../Source/Public/$sut" +#endregion + +Describe 'VSTeamReleaseDefinition' { + $results = Get-Content "$PSScriptRoot\sampleFiles\releaseDefAzD.json" -Raw | ConvertFrom-Json + + Mock _getProjects { return $null } + Mock _hasProjectCacheExpired { return $true } + Mock Invoke-RestMethod { return $results } + Mock Invoke-RestMethod { return $results.value[0] } -ParameterFilter { $Uri -like "*15*" } + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Release' } + + Context 'Get-VSTeamReleaseDefinition' { + It 'no parameters should return Release definitions' { + ## Act + Get-VSTeamReleaseDefinition -projectName project + + ## Assert + Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/definitions?api-version=$(_getApiVersion Release)" + } + } + + It 'expand environments should return Release definitions' { + ## Act + Get-VSTeamReleaseDefinition -projectName project -expand environments + + ## Assert + Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/definitions?api-version=$(_getApiVersion Release)&`$expand=environments" + } + } + + It 'by Id should return Release definition' { + ## Act + Get-VSTeamReleaseDefinition -projectName project -id 15 + + ## Assert + Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/definitions/15?api-version=$(_getApiVersion Release)" + } + } + } } \ No newline at end of file diff --git a/unit/test/Get-VSTeamResourceArea.Tests.ps1 b/unit/test/Get-VSTeamResourceArea.Tests.ps1 index 6864db3e4..c5df0acc6 100644 --- a/unit/test/Get-VSTeamResourceArea.Tests.ps1 +++ b/unit/test/Get-VSTeamResourceArea.Tests.ps1 @@ -1,27 +1,27 @@ -Set-StrictMode -Version Latest - -#region include -$here = Split-Path -Parent $MyInvocation.MyCommand.Path -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") - -. "$here/../../Source/Classes/VSTeamVersions.ps1" -. "$here/../../Source/Classes/VSTeamProjectCache.ps1" -. "$here/../../Source/Private/common.ps1" -. "$here/../../Source/Private/applyTypes.ps1" -. "$here/../../Source/Public/$sut" -#endregion - -Describe 'VSTeamResourceArea' { - Context 'Get-VSTeamResourceArea' { - ## Arrange - Mock _callAPI { return @{ value = @{ } } } - - It 'Should return resources' { - ## Act - $actual = Get-VSTeamResourceArea - - ## Assert - $actual | Should Not Be $null - } - } +Set-StrictMode -Version Latest + +#region include +$here = Split-Path -Parent $MyInvocation.MyCommand.Path +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") + +. "$here/../../Source/Classes/VSTeamVersions.ps1" +. "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Private/common.ps1" +. "$here/../../Source/Private/applyTypes.ps1" +. "$here/../../Source/Public/$sut" +#endregion + +Describe 'VSTeamResourceArea' { + Context 'Get-VSTeamResourceArea' { + ## Arrange + Mock _callAPI { return @{ value = @{ } } } + + It 'Should return resources' { + ## Act + $actual = Get-VSTeamResourceArea + + ## Assert + $actual | Should Not Be $null + } + } } \ No newline at end of file diff --git a/unit/test/Get-VSTeamSecurityNamespace.Tests.ps1 b/unit/test/Get-VSTeamSecurityNamespace.Tests.ps1 index a9ab8742b..98465478b 100644 --- a/unit/test/Get-VSTeamSecurityNamespace.Tests.ps1 +++ b/unit/test/Get-VSTeamSecurityNamespace.Tests.ps1 @@ -1,11 +1,15 @@ Set-StrictMode -Version Latest #region include +Import-Module SHiPS + $here = Split-Path -Parent $MyInvocation.MyCommand.Path $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +. "$here/../../Source/Classes/VSTeamLeaf.ps1" . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Classes/VSTeamSecurityNamespace.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Private/common.ps1" diff --git a/unit/test/Get-VSTeamServiceEndpointType.Tests.ps1 b/unit/test/Get-VSTeamServiceEndpointType.Tests.ps1 index a68e15fbe..86a7e8999 100644 --- a/unit/test/Get-VSTeamServiceEndpointType.Tests.ps1 +++ b/unit/test/Get-VSTeamServiceEndpointType.Tests.ps1 @@ -6,6 +6,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/Set-VSTeamAPIVersion.ps1" @@ -13,33 +15,22 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") #endregion Describe 'VSTeamServiceEndpointType' { - $sampleFile = "$PSScriptRoot\sampleFiles\serviceEndpointTypeSample.json" + $sampleFile = $(Get-Content "$PSScriptRoot\sampleFiles\serviceEndpointTypeSample.json" -Raw | ConvertFrom-Json) - Mock _getInstance { return 'https://dev.azure.com/test' } + Mock Invoke-RestMethod { return $sampleFile } - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { $Uri -like "*_apis/projects*" } + Mock _getInstance { return 'https://dev.azure.com/test' } Context 'Get-VSTeamServiceEndpointType' { - Mock Invoke-RestMethod { - return Get-Content $sampleFile | ConvertFrom-Json - } - - It 'Should return all service endpoints types' { + It 'should return all service endpoints types' { Get-VSTeamServiceEndpointType Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { $Uri -eq "https://dev.azure.com/test/_apis/distributedtask/serviceendpointtypes?api-version=$(_getApiVersion DistributedTask)" } } - } - Context 'Get-VSTeamServiceEndpointType by Type' { - Mock Invoke-RestMethod { - return Get-Content $sampleFile | ConvertFrom-Json - } - - It 'Should return all service endpoints types' { + It 'by Type should return all service endpoints types' { Get-VSTeamServiceEndpointType -Type azurerm Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { @@ -47,14 +38,8 @@ Describe 'VSTeamServiceEndpointType' { $Body.type -eq 'azurerm' } } - } - - Context 'Get-VSTeamServiceEndpointType by Type and scheme' { - Mock Invoke-RestMethod { - return Get-Content $sampleFile | ConvertFrom-Json - } - - It 'Should return all service endpoints types' { + + It 'by Type and scheme should return all service endpoints types' { Get-VSTeamServiceEndpointType -Type azurerm -Scheme Basic Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { @@ -63,14 +48,8 @@ Describe 'VSTeamServiceEndpointType' { $Body.scheme -eq 'Basic' } } - } - - Context 'Get-VSTeamServiceEndpointType by scheme' { - Mock Invoke-RestMethod { - return Get-Content $sampleFile | ConvertFrom-Json - } - - It 'Should return all service endpoints types' { + + It 'by scheme should return all service endpoints types' { Get-VSTeamServiceEndpointType -Scheme Basic Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { diff --git a/unit/test/Get-VSTeamTaskGroup.Tests.ps1 b/unit/test/Get-VSTeamTaskGroup.Tests.ps1 index 1d8453071..ea549c238 100644 --- a/unit/test/Get-VSTeamTaskGroup.Tests.ps1 +++ b/unit/test/Get-VSTeamTaskGroup.Tests.ps1 @@ -6,18 +6,18 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/Set-VSTeamAPIVersion.ps1" . "$here/../../Source/Public/$sut" #endregion -$taskGroupsJson = "$PSScriptRoot\sampleFiles\taskGroups.json" -$taskGroupJson = "$PSScriptRoot\sampleFiles\taskGroup.json" - Describe 'VSTeamTaskGroup' { - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" - + $taskGroupsJson = "$PSScriptRoot\sampleFiles\taskGroups.json" + $taskGroupJson = "$PSScriptRoot\sampleFiles\taskGroup.json" + # Set the account to use for testing. A normal user would do this # using the Set-VSTeamAccount function. Mock _getInstance { return 'https://dev.azure.com/test' } @@ -26,21 +26,16 @@ Describe 'VSTeamTaskGroup' { # Mock the call to Get-Projects by the dynamic parameter for ProjectName Mock Invoke-RestMethod { return @() } -ParameterFilter { $Uri -like "*_apis/project*" } - BeforeAll { - $projectName = "project" - $taskGroupJsonAsString = Get-Content $taskGroupJson -Raw - } - Context 'Get-VSTeamTaskGroup list' { Mock Invoke-RestMethod { return Get-Content $taskGroupsJson | ConvertFrom-Json } It 'Should return all task groups' { - Get-VSTeamTaskGroup -projectName $projectName + Get-VSTeamTaskGroup -projectName project Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/$projectName/_apis/distributedtask/taskgroups?api-version=$(_getApiVersion TaskGroups)" + $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/taskgroups?api-version=$(_getApiVersion TaskGroups)" } } } @@ -52,10 +47,10 @@ Describe 'VSTeamTaskGroup' { It 'Should return one task group' { $projectID = "d30f8b85-6b13-41a9-bb77-2e1a9c611def" - Get-VSTeamTaskGroup -projectName $projectName -id $projectID + Get-VSTeamTaskGroup -projectName project -id $projectID Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/$projectName/_apis/distributedtask/taskgroups/$($projectID)?api-version=$(_getApiVersion TaskGroups)" + $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/taskgroups/$($projectID)?api-version=$(_getApiVersion TaskGroups)" } } } @@ -68,10 +63,10 @@ Describe 'VSTeamTaskGroup' { It 'Should return one task group' { $taskGroupName = "For Unit Tests 2" - $taskGroup = Get-VSTeamTaskGroup -projectName $projectName -Name $taskGroupName + $taskGroup = Get-VSTeamTaskGroup -projectName project -Name $taskGroupName Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/$projectName/_apis/distributedtask/taskgroups?api-version=$(_getApiVersion TaskGroups)" + $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/taskgroups?api-version=$(_getApiVersion TaskGroups)" } # Ensure that we only have one task group, in other words, that the name filter was applied. diff --git a/unit/test/Get-VSTeamTfvcBranch.Tests.ps1 b/unit/test/Get-VSTeamTfvcBranch.Tests.ps1 index 5594644c3..aeaa171a1 100644 --- a/unit/test/Get-VSTeamTfvcBranch.Tests.ps1 +++ b/unit/test/Get-VSTeamTfvcBranch.Tests.ps1 @@ -1,263 +1,264 @@ -Set-StrictMode -Version Latest - -#region include -$here = Split-Path -Parent $MyInvocation.MyCommand.Path -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") - -. "$here/../../Source/Classes/VSTeamVersions.ps1" -. "$here/../../Source/Classes/VSTeamProjectCache.ps1" -. "$here/../../Source/Private/applyTypes.ps1" -. "$here/../../Source/Private/common.ps1" -. "$here/../../Source/Public/Set-VSTeamAPIVersion.ps1" -. "$here/../../Source/Public/$sut" -#endregion - -Describe 'VSTeamTfvcBranch' -Tag 'unit', 'tfvc' { - - $singleResult = [PSCustomObject]@{ - path = "$/TfvcProject/Master"; - description = 'desc'; - children = @(); - } - - $multipleResults = [PSCustomObject]@{ - value = @( - [PSCustomObject]@{ - path = '$/TfvcProject/Master'; - description = 'desc'; - children = @(); - }, - [PSCustomObject]@{ - path = '$/AnotherProject/Master'; - description = 'desc'; - children = @(); - } - ) - } - - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Tfvc' } - - Describe 'Get-VSTeamTfvcBranch' { - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { - $Uri -like "*_apis/projects*" - } - - $testCases = @( - @{ a = 'https://dev.azure.com/test'; t = 'vsts' } - @{ a = 'http://localhost:8080/tfs/defaultcollection'; t = 'tfs' } - ) - - Mock Invoke-RestMethod { - # If this test fails uncomment the line below to see how the mock was called. - # Write-Host $args - - return $singleResult - } -Verifiable - - It 'should call the REST endpoint with correct parameters for ' -TestCases $testCases { - param ($a) - - Mock _getInstance { return $a } - - Get-VSTeamTfvcBranch -Path $/TfvcProject/Master - - Assert-MockCalled Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { - $Uri -eq "$a/_apis/tfvc/branches/$/TfvcProject/Master?api-version=$(_getApiVersion Tfvc)" - } - } - } - - Describe 'Get-VSTeamTfvcBranch VSTS' { - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { - $Uri -like "*_apis/projects*" - } - - Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable - - Context 'Get-VSTeamTfvcBranch with one path' { - Mock Invoke-RestMethod { return $singleResult } -Verifiable - - Get-VSTeamTfvcBranch -Path $/TfvcProject/Master - - It 'should call the REST endpoint with correct parameters' { - Assert-MockCalled Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/tfvc/branches/$/TfvcProject/Master?api-version=$(_getApiVersion Tfvc)" - } - } - } - - Context 'Get-VSTeamTfvcBranch with one path from pipeline' { - Mock Invoke-RestMethod { return $singleResult } -Verifiable - - '$/TfvcProject/Master' | Get-VSTeamTfvcBranch - - It 'should call the REST endpoint with correct parameters' { - Assert-MockCalled Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/tfvc/branches/$/TfvcProject/Master?api-version=$(_getApiVersion Tfvc)" - } - } - } - - Context 'Get-VSTeamTfvcBranch with two paths' { - Mock Invoke-RestMethod { return $multipleResults } -Verifiable - - Get-VSTeamTfvcBranch -Path $/TfvcProject/Master, $/TfvcProject/Feature - - It 'should call the REST endpoint with correct parameters' { - Assert-MockCalled Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/tfvc/branches/$/TfvcProject/Master?api-version=$(_getApiVersion Tfvc)" - } - Assert-MockCalled Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/tfvc/branches/$/TfvcProject/Feature?api-version=$(_getApiVersion Tfvc)" - } - } - } - - Context 'Get-VSTeamTfvcBranch with IncludeChildren' { - Mock Invoke-RestMethod { return $singleResult } -Verifiable - - Get-VSTeamTfvcBranch -Path $/TfvcProject/Master -IncludeChildren - - It 'should call the REST endpoint with correct parameters' { - Assert-MockCalled Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/tfvc/branches/$/TfvcProject/Master?api-version=$(_getApiVersion Tfvc)&includeChildren=True" - } - } - } - - Context 'Get-VSTeamTfvcBranch with IncludeParent' { - Mock Invoke-RestMethod { return $singleResult } -Verifiable - - Get-VSTeamTfvcBranch -Path $/TfvcProject/Master -IncludeParent - - It 'should call the REST endpoint with correct parameters' { - Assert-MockCalled Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/tfvc/branches/$/TfvcProject/Master?api-version=$(_getApiVersion Tfvc)&includeParent=True" - } - } - } - - Context 'Get-VSTeamTfvcBranch with IncludeDeleted' { - Mock Invoke-RestMethod { return $singleResult } -Verifiable - - Get-VSTeamTfvcBranch -Path $/TfvcProject/Master -IncludeDeleted - - It 'should call the REST endpoint with correct parameters' { - Assert-MockCalled Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/tfvc/branches/$/TfvcProject/Master?api-version=$(_getApiVersion Tfvc)&includeDeleted=True" - } - } - } - - Context 'Get-VSTeamTfvcBranch with all switches' { - Mock Invoke-RestMethod { return $singleResult } -Verifiable - - Get-VSTeamTfvcBranch -Path $/TfvcProject/Master -IncludeChildren -IncludeParent -IncludeDeleted - - It 'should call the REST endpoint with correct parameters' { - Assert-MockCalled Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/tfvc/branches/$/TfvcProject/Master?api-version=$(_getApiVersion Tfvc)&includeChildren=True&includeParent=True&includeDeleted=True" - } - } - } - } - - Describe 'Get-VSTeamTfvcBranch TFS' { - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { - $Uri -like "*_apis/projects*" - } - - Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } -Verifiable - Mock _useWindowsAuthenticationOnPremise { return $true } - - Context 'Get-VSTeamTfvcBranch with one path' { - Mock Invoke-RestMethod { return $singleResult } -Verifiable - - Get-VSTeamTfvcBranch -Path $/TfvcProject/Master - - It 'should call the REST endpoint with correct parameters' { - Assert-MockCalled Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { - $Uri -eq "http://localhost:8080/tfs/defaultcollection/_apis/tfvc/branches/$/TfvcProject/Master?api-version=$(_getApiVersion Tfvc)" - } - } - } - - Context 'Get-VSTeamTfvcBranch with one path from pipeline' { - Mock Invoke-RestMethod { return $singleResult } -Verifiable - - '$/TfvcProject/Master' | Get-VSTeamTfvcBranch - - It 'should call the REST endpoint with correct parameters' { - Assert-MockCalled Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { - $Uri -eq "http://localhost:8080/tfs/defaultcollection/_apis/tfvc/branches/$/TfvcProject/Master?api-version=$(_getApiVersion Tfvc)" - } - } - } - - Context 'Get-VSTeamTfvcBranch with two paths' { - Mock Invoke-RestMethod { return $multipleResults } -Verifiable - - Get-VSTeamTfvcBranch -Path $/TfvcProject/Master, $/TfvcProject/Feature - - It 'should call the REST endpoint with correct parameters' { - Assert-MockCalled Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { - $Uri -eq "http://localhost:8080/tfs/defaultcollection/_apis/tfvc/branches/$/TfvcProject/Master?api-version=$(_getApiVersion Tfvc)" - } - Assert-MockCalled Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { - $Uri -eq "http://localhost:8080/tfs/defaultcollection/_apis/tfvc/branches/$/TfvcProject/Feature?api-version=$(_getApiVersion Tfvc)" - } - } - } - - Context 'Get-VSTeamTfvcBranch with IncludeChildren' { - Mock Invoke-RestMethod { return $singleResult } -Verifiable - - Get-VSTeamTfvcBranch -Path $/TfvcProject/Master -IncludeChildren - - It 'should call the REST endpoint with correct parameters' { - Assert-MockCalled Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { - $Uri -eq "http://localhost:8080/tfs/defaultcollection/_apis/tfvc/branches/$/TfvcProject/Master?api-version=$(_getApiVersion Tfvc)&includeChildren=True" - } - } - } - - Context 'Get-VSTeamTfvcBranch with IncludeParent' { - Mock Invoke-RestMethod { return $singleResult } -Verifiable - - Get-VSTeamTfvcBranch -Path $/TfvcProject/Master -IncludeParent - - It 'should call the REST endpoint with correct parameters' { - Assert-MockCalled Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { - $Uri -eq "http://localhost:8080/tfs/defaultcollection/_apis/tfvc/branches/$/TfvcProject/Master?api-version=$(_getApiVersion Tfvc)&includeParent=True" - } - } - } - - Context 'Get-VSTeamTfvcBranch with IncludeDeleted' { - Mock Invoke-RestMethod { return $singleResult } -Verifiable - - Get-VSTeamTfvcBranch -Path $/TfvcProject/Master -IncludeDeleted - - It 'should call the REST endpoint with correct parameters' { - Assert-MockCalled Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { - $Uri -eq "http://localhost:8080/tfs/defaultcollection/_apis/tfvc/branches/$/TfvcProject/Master?api-version=$(_getApiVersion Tfvc)&includeDeleted=True" - } - } - } - - Context 'Get-VSTeamTfvcBranch with all switches' { - Mock Invoke-RestMethod { return $singleResult } -Verifiable - - Get-VSTeamTfvcBranch -Path $/TfvcProject/Master -IncludeChildren -IncludeParent -IncludeDeleted - - It 'should call the REST endpoint with correct parameters' { - Assert-MockCalled Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { - $Uri -eq "http://localhost:8080/tfs/defaultcollection/_apis/tfvc/branches/$/TfvcProject/Master?api-version=$(_getApiVersion Tfvc)&includeChildren=True&includeParent=True&includeDeleted=True" - } - } - } - } +Set-StrictMode -Version Latest + +#region include +$here = Split-Path -Parent $MyInvocation.MyCommand.Path +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") + +. "$here/../../Source/Classes/VSTeamVersions.ps1" +. "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" +. "$here/../../Source/Private/applyTypes.ps1" +. "$here/../../Source/Private/common.ps1" +. "$here/../../Source/Public/Set-VSTeamAPIVersion.ps1" +. "$here/../../Source/Public/$sut" +#endregion + +Describe 'VSTeamTfvcBranch' -Tag 'unit', 'tfvc' { + + $singleResult = [PSCustomObject]@{ + path = "$/TfvcProject/Master"; + description = 'desc'; + children = @(); + } + + $multipleResults = [PSCustomObject]@{ + value = @( + [PSCustomObject]@{ + path = '$/TfvcProject/Master'; + description = 'desc'; + children = @(); + }, + [PSCustomObject]@{ + path = '$/AnotherProject/Master'; + description = 'desc'; + children = @(); + } + ) + } + + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Tfvc' } + + Describe 'Get-VSTeamTfvcBranch' { + # Mock the call to Get-Projects by the dynamic parameter for ProjectName + Mock Invoke-RestMethod { return @() } -ParameterFilter { + $Uri -like "*_apis/projects*" + } + + $testCases = @( + @{ a = 'https://dev.azure.com/test'; t = 'vsts' } + @{ a = 'http://localhost:8080/tfs/defaultcollection'; t = 'tfs' } + ) + + Mock Invoke-RestMethod { + # If this test fails uncomment the line below to see how the mock was called. + # Write-Host $args + + return $singleResult + } -Verifiable + + It 'should call the REST endpoint with correct parameters for ' -TestCases $testCases { + param ($a) + + Mock _getInstance { return $a } + + Get-VSTeamTfvcBranch -Path $/TfvcProject/Master + + Assert-MockCalled Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { + $Uri -eq "$a/_apis/tfvc/branches/$/TfvcProject/Master?api-version=$(_getApiVersion Tfvc)" + } + } + } + + Describe 'Get-VSTeamTfvcBranch VSTS' { + # Mock the call to Get-Projects by the dynamic parameter for ProjectName + Mock Invoke-RestMethod { return @() } -ParameterFilter { + $Uri -like "*_apis/projects*" + } + + Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable + + Context 'Get-VSTeamTfvcBranch with one path' { + Mock Invoke-RestMethod { return $singleResult } -Verifiable + + Get-VSTeamTfvcBranch -Path $/TfvcProject/Master + + It 'should call the REST endpoint with correct parameters' { + Assert-MockCalled Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/_apis/tfvc/branches/$/TfvcProject/Master?api-version=$(_getApiVersion Tfvc)" + } + } + } + + Context 'Get-VSTeamTfvcBranch with one path from pipeline' { + Mock Invoke-RestMethod { return $singleResult } -Verifiable + + '$/TfvcProject/Master' | Get-VSTeamTfvcBranch + + It 'should call the REST endpoint with correct parameters' { + Assert-MockCalled Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/_apis/tfvc/branches/$/TfvcProject/Master?api-version=$(_getApiVersion Tfvc)" + } + } + } + + Context 'Get-VSTeamTfvcBranch with two paths' { + Mock Invoke-RestMethod { return $multipleResults } -Verifiable + + Get-VSTeamTfvcBranch -Path $/TfvcProject/Master, $/TfvcProject/Feature + + It 'should call the REST endpoint with correct parameters' { + Assert-MockCalled Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/_apis/tfvc/branches/$/TfvcProject/Master?api-version=$(_getApiVersion Tfvc)" + } + Assert-MockCalled Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/_apis/tfvc/branches/$/TfvcProject/Feature?api-version=$(_getApiVersion Tfvc)" + } + } + } + + Context 'Get-VSTeamTfvcBranch with IncludeChildren' { + Mock Invoke-RestMethod { return $singleResult } -Verifiable + + Get-VSTeamTfvcBranch -Path $/TfvcProject/Master -IncludeChildren + + It 'should call the REST endpoint with correct parameters' { + Assert-MockCalled Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/_apis/tfvc/branches/$/TfvcProject/Master?api-version=$(_getApiVersion Tfvc)&includeChildren=True" + } + } + } + + Context 'Get-VSTeamTfvcBranch with IncludeParent' { + Mock Invoke-RestMethod { return $singleResult } -Verifiable + + Get-VSTeamTfvcBranch -Path $/TfvcProject/Master -IncludeParent + + It 'should call the REST endpoint with correct parameters' { + Assert-MockCalled Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/_apis/tfvc/branches/$/TfvcProject/Master?api-version=$(_getApiVersion Tfvc)&includeParent=True" + } + } + } + + Context 'Get-VSTeamTfvcBranch with IncludeDeleted' { + Mock Invoke-RestMethod { return $singleResult } -Verifiable + + Get-VSTeamTfvcBranch -Path $/TfvcProject/Master -IncludeDeleted + + It 'should call the REST endpoint with correct parameters' { + Assert-MockCalled Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/_apis/tfvc/branches/$/TfvcProject/Master?api-version=$(_getApiVersion Tfvc)&includeDeleted=True" + } + } + } + + Context 'Get-VSTeamTfvcBranch with all switches' { + Mock Invoke-RestMethod { return $singleResult } -Verifiable + + Get-VSTeamTfvcBranch -Path $/TfvcProject/Master -IncludeChildren -IncludeParent -IncludeDeleted + + It 'should call the REST endpoint with correct parameters' { + Assert-MockCalled Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/_apis/tfvc/branches/$/TfvcProject/Master?api-version=$(_getApiVersion Tfvc)&includeChildren=True&includeParent=True&includeDeleted=True" + } + } + } + } + + Describe 'Get-VSTeamTfvcBranch TFS' { + # Mock the call to Get-Projects by the dynamic parameter for ProjectName + Mock Invoke-RestMethod { return @() } -ParameterFilter { + $Uri -like "*_apis/projects*" + } + + Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } -Verifiable + Mock _useWindowsAuthenticationOnPremise { return $true } + + Context 'Get-VSTeamTfvcBranch with one path' { + Mock Invoke-RestMethod { return $singleResult } -Verifiable + + Get-VSTeamTfvcBranch -Path $/TfvcProject/Master + + It 'should call the REST endpoint with correct parameters' { + Assert-MockCalled Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { + $Uri -eq "http://localhost:8080/tfs/defaultcollection/_apis/tfvc/branches/$/TfvcProject/Master?api-version=$(_getApiVersion Tfvc)" + } + } + } + + Context 'Get-VSTeamTfvcBranch with one path from pipeline' { + Mock Invoke-RestMethod { return $singleResult } -Verifiable + + '$/TfvcProject/Master' | Get-VSTeamTfvcBranch + + It 'should call the REST endpoint with correct parameters' { + Assert-MockCalled Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { + $Uri -eq "http://localhost:8080/tfs/defaultcollection/_apis/tfvc/branches/$/TfvcProject/Master?api-version=$(_getApiVersion Tfvc)" + } + } + } + + Context 'Get-VSTeamTfvcBranch with two paths' { + Mock Invoke-RestMethod { return $multipleResults } -Verifiable + + Get-VSTeamTfvcBranch -Path $/TfvcProject/Master, $/TfvcProject/Feature + + It 'should call the REST endpoint with correct parameters' { + Assert-MockCalled Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { + $Uri -eq "http://localhost:8080/tfs/defaultcollection/_apis/tfvc/branches/$/TfvcProject/Master?api-version=$(_getApiVersion Tfvc)" + } + Assert-MockCalled Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { + $Uri -eq "http://localhost:8080/tfs/defaultcollection/_apis/tfvc/branches/$/TfvcProject/Feature?api-version=$(_getApiVersion Tfvc)" + } + } + } + + Context 'Get-VSTeamTfvcBranch with IncludeChildren' { + Mock Invoke-RestMethod { return $singleResult } -Verifiable + + Get-VSTeamTfvcBranch -Path $/TfvcProject/Master -IncludeChildren + + It 'should call the REST endpoint with correct parameters' { + Assert-MockCalled Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { + $Uri -eq "http://localhost:8080/tfs/defaultcollection/_apis/tfvc/branches/$/TfvcProject/Master?api-version=$(_getApiVersion Tfvc)&includeChildren=True" + } + } + } + + Context 'Get-VSTeamTfvcBranch with IncludeParent' { + Mock Invoke-RestMethod { return $singleResult } -Verifiable + + Get-VSTeamTfvcBranch -Path $/TfvcProject/Master -IncludeParent + + It 'should call the REST endpoint with correct parameters' { + Assert-MockCalled Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { + $Uri -eq "http://localhost:8080/tfs/defaultcollection/_apis/tfvc/branches/$/TfvcProject/Master?api-version=$(_getApiVersion Tfvc)&includeParent=True" + } + } + } + + Context 'Get-VSTeamTfvcBranch with IncludeDeleted' { + Mock Invoke-RestMethod { return $singleResult } -Verifiable + + Get-VSTeamTfvcBranch -Path $/TfvcProject/Master -IncludeDeleted + + It 'should call the REST endpoint with correct parameters' { + Assert-MockCalled Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { + $Uri -eq "http://localhost:8080/tfs/defaultcollection/_apis/tfvc/branches/$/TfvcProject/Master?api-version=$(_getApiVersion Tfvc)&includeDeleted=True" + } + } + } + + Context 'Get-VSTeamTfvcBranch with all switches' { + Mock Invoke-RestMethod { return $singleResult } -Verifiable + + Get-VSTeamTfvcBranch -Path $/TfvcProject/Master -IncludeChildren -IncludeParent -IncludeDeleted + + It 'should call the REST endpoint with correct parameters' { + Assert-MockCalled Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { + $Uri -eq "http://localhost:8080/tfs/defaultcollection/_apis/tfvc/branches/$/TfvcProject/Master?api-version=$(_getApiVersion Tfvc)&includeChildren=True&includeParent=True&includeDeleted=True" + } + } + } + } } \ No newline at end of file diff --git a/unit/test/Get-VSTeamTfvcRootBranch.Tests.ps1 b/unit/test/Get-VSTeamTfvcRootBranch.Tests.ps1 index e82db21d6..3b69cd4ec 100644 --- a/unit/test/Get-VSTeamTfvcRootBranch.Tests.ps1 +++ b/unit/test/Get-VSTeamTfvcRootBranch.Tests.ps1 @@ -6,13 +6,14 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/Set-VSTeamAPIVersion.ps1" . "$here/../../Source/Public/$sut" #endregion -Describe 'VSTeamTfvcRootBranch' -Tag 'unit', 'tfvc' { +Describe 'VSTeamTfvcRootBranch' -Tag 'unit', 'tfvc', 'get' { $singleResult = [PSCustomObject]@{ path = "$/TfvcProject/Master"; description = 'desc'; diff --git a/unit/test/Get-VSTeamUser.Tests.ps1 b/unit/test/Get-VSTeamUser.Tests.ps1 index e6bb39294..7ddf328e8 100644 --- a/unit/test/Get-VSTeamUser.Tests.ps1 +++ b/unit/test/Get-VSTeamUser.Tests.ps1 @@ -10,6 +10,7 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamUser.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/Set-VSTeamAPIVersion.ps1" diff --git a/unit/test/Get-VSTeamUserEntitlement.Tests.ps1 b/unit/test/Get-VSTeamUserEntitlement.Tests.ps1 index f78602be1..ea815210f 100644 --- a/unit/test/Get-VSTeamUserEntitlement.Tests.ps1 +++ b/unit/test/Get-VSTeamUserEntitlement.Tests.ps1 @@ -5,6 +5,8 @@ $here = Split-Path -Parent $MyInvocation.MyCommand.Path $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" +. "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/$sut" @@ -37,8 +39,6 @@ Describe "VSTeamUserEntitlement" { Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'MemberEntitlementManagement' } Mock _getInstance { return 'https://dev.azure.com/test' } - . "$PSScriptRoot\mocks\mockProjectDynamicParamMandatoryFalse.ps1" - Context 'Get-VSTeamUserEntitlement' { Mock Invoke-RestMethod { return [PSCustomObject]@{ members = [PSCustomObject]@{ accessLevel = [PSCustomObject]@{ } } } } Mock Invoke-RestMethod { return [PSCustomObject]@{ accessLevel = [PSCustomObject]@{ }; email = 'fake@email.com' } } -ParameterFilter { diff --git a/unit/test/Get-VSTeamVariableGroup.Tests.ps1 b/unit/test/Get-VSTeamVariableGroup.Tests.ps1 index cccd39003..0c89c88e4 100644 --- a/unit/test/Get-VSTeamVariableGroup.Tests.ps1 +++ b/unit/test/Get-VSTeamVariableGroup.Tests.ps1 @@ -6,6 +6,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/Set-VSTeamAPIVersion.ps1" @@ -20,8 +22,6 @@ Describe 'VSTeamVariableGroup' { Context 'Get-VSTeamVariableGroup' { Context 'Services' { - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" - $sampleFileVSTS = $(Get-Content "$PSScriptRoot\sampleFiles\variableGroupSamples.json" | ConvertFrom-Json) Mock _getApiVersion { return 'VSTS' } @@ -50,8 +50,6 @@ Describe 'VSTeamVariableGroup' { } Context 'Server' { - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" - $sampleFile2017 = $(Get-Content "$PSScriptRoot\sampleFiles\variableGroupSamples2017.json" | ConvertFrom-Json) Mock _getApiVersion { return 'TFS2017' } diff --git a/unit/test/Get-VSTeamWiql.Tests.ps1 b/unit/test/Get-VSTeamWiql.Tests.ps1 index 88122f939..d4a171d9d 100644 --- a/unit/test/Get-VSTeamWiql.Tests.ps1 +++ b/unit/test/Get-VSTeamWiql.Tests.ps1 @@ -6,6 +6,7 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/Get-VSTeamWorkItem.ps1" @@ -13,8 +14,6 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") #endregion Describe 'VSTeamWiql' { - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" - Mock _getInstance { return 'https://dev.azure.com/test' } # Mock the call to Get-Projects by the dynamic parameter for ProjectName @@ -67,7 +66,7 @@ Describe 'VSTeamWiql' { } It 'Get work items with custom WIQL query' { - $Global:PSDefaultParameterValues.Remove("*:projectName") + $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") $wiqlQuery = "Select [System.Id], [System.Title], [System.State] From WorkItems" Get-VSTeamWiql -ProjectName "test" -Team "test team" -Query $wiqlQuery @@ -84,7 +83,7 @@ Describe 'VSTeamWiql' { } It 'Get work items with custom WIQL query with -Top 250' { - $Global:PSDefaultParameterValues.Remove("*:projectName") + $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") $wiqlQuery = "Select [System.Id], [System.Title], [System.State] From WorkItems" Get-VSTeamWiql -ProjectName "test" -Team "test team" -Query $wiqlQuery -Top 250 @@ -101,7 +100,7 @@ Describe 'VSTeamWiql' { } It 'Get work items with custom WIQL query with -Top 0' { - $Global:PSDefaultParameterValues.Remove("*:projectName") + $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") $wiqlQuery = "Select [System.Id], [System.Title], [System.State] From WorkItems" Get-VSTeamWiql -ProjectName "test" -Team "test team" -Query $wiqlQuery -Top 0 @@ -118,7 +117,7 @@ Describe 'VSTeamWiql' { } It 'Get work items with custom WIQL query with expanded work items' { - $Global:PSDefaultParameterValues.Remove("*:projectName") + $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") $wiqlQuery = "Select [System.Id], [System.Title], [System.State] From WorkItems" Get-VSTeamWiql -ProjectName "test" -Team "test team" -Query $wiqlQuery -Expand @@ -135,7 +134,7 @@ Describe 'VSTeamWiql' { } It 'Get work items with custom WIQL query with time precision' { - $Global:PSDefaultParameterValues.Remove("*:projectName") + $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") $wiqlQuery = "Select [System.Id], [System.Title], [System.State] From WorkItems" Get-VSTeamWiql -ProjectName "test" -Team "test team" -Query $wiqlQuery -TimePrecision @@ -154,7 +153,7 @@ Describe 'VSTeamWiql' { } It 'Get work items with query ID query' { - $Global:PSDefaultParameterValues.Remove("*:projectName") + $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") Get-VSTeamWiql -ProjectName "test" -Team "test team" -Id 1 Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { @@ -163,7 +162,7 @@ Describe 'VSTeamWiql' { } It 'Get work items with query ID query with expanded work items' { - $Global:PSDefaultParameterValues.Remove("*:projectName") + $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") Get-VSTeamWiql -ProjectName "test" -Team "test team" -Id 1 -Expand Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { diff --git a/unit/test/Get-VSTeamWorkItem.Tests.ps1 b/unit/test/Get-VSTeamWorkItem.Tests.ps1 index b5901d1b9..f7546977d 100644 --- a/unit/test/Get-VSTeamWorkItem.Tests.ps1 +++ b/unit/test/Get-VSTeamWorkItem.Tests.ps1 @@ -6,6 +6,7 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/$sut" @@ -18,8 +19,6 @@ Describe 'VSTeamWorkItem' { # Mock the call to Get-Projects by the dynamic parameter for ProjectName Mock Invoke-RestMethod { return @() } -ParameterFilter { $Uri -like "*_apis/projects*" } - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" - $obj = @{ id = 47 rev = 1 diff --git a/unit/test/Get-VSTeamWorkItemType.Tests.ps1 b/unit/test/Get-VSTeamWorkItemType.Tests.ps1 index 2c68d871b..092567b85 100644 --- a/unit/test/Get-VSTeamWorkItemType.Tests.ps1 +++ b/unit/test/Get-VSTeamWorkItemType.Tests.ps1 @@ -6,6 +6,10 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" +. "$here/../../Source/Classes/WorkItemTypeCompleter.ps1" +. "$here/../../Source/Classes/WorkItemTypeValidateAttribute.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Public/$sut" @@ -13,26 +17,14 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") Describe 'VSTeamWorkItemType' { ## Arrange - # Load the mocks to create the project name dynamic parameter - . "$PSScriptRoot\mocks\mockProjectNameDynamicParam.ps1" - # Set the account to use for testing. A normal user would do this # using the Set-VSTeamAccount function. Mock _getInstance { return 'https://dev.azure.com/test' } Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } + $sampleFile = $(Get-Content "$PSScriptRoot\sampleFiles\get-vsteamworkitemtype.json" -Raw) Context 'Get-VSTeamWorkItemType' { - $testSuite = @{ - count = 1 - value = @{ - name = "Test Suite" - referenceName = "Microsoft.VSTS.WorkItemTypes.TestSuite" - description = "Tracks test activites for a specific feature, requirement, or user story." - color = "004B50" - } - } - $bug = @{ name = "Bug" referenceName = "Microsoft.VSTS.WorkItemTypes.Bug" @@ -40,7 +32,7 @@ Describe 'VSTeamWorkItemType' { color = "CC293D" } - Mock Invoke-RestMethod { return ConvertTo-Json $testSuite } + Mock Invoke-RestMethod { return ConvertTo-Json $sampleFile } Mock Invoke-RestMethod { return ConvertTo-Json $bug } -ParameterFilter{ $Uri -like "*bug*" } It 'with project only should return all work item types' { @@ -55,7 +47,7 @@ Describe 'VSTeamWorkItemType' { It 'by type with default project should return 1 work item type' { ## Arrange - $Global:PSDefaultParameterValues["*:projectName"] = 'test' + $Global:PSDefaultParameterValues["*-vsteam*:projectName"] = 'test' ## Act Get-VSTeamWorkItemType -WorkItemType bug @@ -68,7 +60,7 @@ Describe 'VSTeamWorkItemType' { It 'by type with explicit project should return 1 work item type' { ## Arrange - $Global:PSDefaultParameterValues.Remove("*:projectName") + $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") ## Act Get-VSTeamWorkItemType -ProjectName test -WorkItemType bug diff --git a/unit/test/Invoke-VSTeamRequest.Tests.ps1 b/unit/test/Invoke-VSTeamRequest.Tests.ps1 index 536c1480f..26b3354a7 100644 --- a/unit/test/Invoke-VSTeamRequest.Tests.ps1 +++ b/unit/test/Invoke-VSTeamRequest.Tests.ps1 @@ -1,59 +1,87 @@ -Set-StrictMode -Version Latest - -#region include -$here = Split-Path -Parent $MyInvocation.MyCommand.Path -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") - -. "$here/../../Source/Classes/VSTeamVersions.ps1" -. "$here/../../Source/Classes/VSTeamProjectCache.ps1" -. "$here/../../Source/Private/common.ps1" -. "$here/../../Source/Public/Get-VSTeamProject.ps1" -. "$here/../../Source/Public/$sut" -#endregion - -Describe 'Invoke-VSTeamRequest' { - Mock _hasProjectCacheExpired { return $false } - - Context 'Invoke-VSTeamRequest Options' { - Mock Invoke-RestMethod - - Mock _getInstance { return 'https://dev.azure.com/test' } - - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { $Uri -like "*_apis/projects*" } - - # Called to convert from ProjectName to ProjectID - Mock Get-VSTeamProject { return [PSCustomObject]@{ id = '00000000-0000-0000-0000-000000000000' } } -Verifiable - - It 'options should call API' { - Invoke-VSTeamRequest -Method Options - Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Method -eq "Options" -and - $Uri -eq "https://dev.azure.com/test/_apis" - } - } - - It 'release should call API' { - Invoke-VSTeamRequest -Area release -Resource releases -Id 1 -SubDomain vsrm -Version '4.1-preview' -ProjectName testproject -JSON - Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://vsrm.dev.azure.com/test/testproject/_apis/release/releases/1?api-version=4.1-preview" - } - } - - It 'AdditionalHeaders should call API' { - Invoke-VSTeamRequest -Area release -Resource releases -Id 1 -SubDomain vsrm -Version '4.1-preview' -ProjectName testproject -JSON -AdditionalHeaders @{Test = "Test" } - Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Headers["Test"] -eq 'Test' -and - $Uri -eq "https://vsrm.dev.azure.com/test/testproject/_apis/release/releases/1?api-version=4.1-preview" - } - } - - It 'by Product Id should call API with product id instead of name' { - Invoke-VSTeamRequest -ProjectName testproject -UseProjectId -Area release -Resource releases -Id 1 -SubDomain vsrm -Version '4.1-preview' - - Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/release/releases/1?api-version=4.1-preview" - } - } - } +Set-StrictMode -Version Latest + +#region include +Import-Module SHiPS + +$here = Split-Path -Parent $MyInvocation.MyCommand.Path +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") + +. "$here/../../Source/Private/common.ps1" +. "$here/../../Source/Classes/VSTeamVersions.ps1" +. "$here/../../Source/Classes/VSTeamLeaf.ps1" +. "$here/../../Source/Classes/VSTeamDirectory.ps1" +. "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" +. "$here/../../Source/Classes/UncachedProjectCompleter.ps1" +. "$here/../../Source/Classes/UncachedProjectValidateAttribute.ps1" +. "$here/../../Source/Classes/VSTeamTask.ps1" +. "$here/../../Source/Classes/VSTeamAttempt.ps1" +. "$here/../../Source/Classes/VSTeamEnvironment.ps1" +. "$here/../../Source/Classes/VSTeamReleaseDefinitions.ps1" +. "$here/../../Source/Classes/VSTeamUserEntitlement.ps1" +. "$here/../../Source/Classes/VSTeamRelease.ps1" +. "$here/../../Source/Classes/VSTeamReleases.ps1" +. "$here/../../Source/Classes/VSTeamBuild.ps1" +. "$here/../../Source/Classes/VSTeamTeams.ps1" +. "$here/../../Source/Classes/VSTeamRepositories.ps1" +. "$here/../../Source/Classes/VSTeamQueues.ps1" +. "$here/../../Source/Classes/VSTeamBuilds.ps1" +. "$here/../../Source/Classes/VSTeamBuildDefinitions.ps1" +. "$here/../../Source/Classes/VSTeamProject.ps1" +. "$here/../../Source/Public/Get-VSTeamProject.ps1" +. "$here/../../Source/Public/$sut" +#endregion + +Describe 'Invoke-VSTeamRequest' { + Mock _getProjects { return @() } + Mock _hasProjectCacheExpired { return $true } + + Context 'Invoke-VSTeamRequest Options' { + Mock Invoke-RestMethod + Mock _getInstance { return 'https://dev.azure.com/test' } + + $projectResult = $(Get-Content "$PSScriptRoot\sampleFiles\projectResult.json" | ConvertFrom-Json) + + Mock _callAPI { return $projectResult } -ParameterFilter { + $Area -eq 'projects' -and + $id -eq 'testproject' -and + $Version -eq "$(_getApiVersion Core)" -and + $IgnoreDefaultProject -eq $true + } + + It 'options should call API' { + Invoke-VSTeamRequest -Method Options -NoProject + + Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Method -eq "Options" -and + $Uri -eq "https://dev.azure.com/test/_apis" + } + } + + It 'release should call API' { + Invoke-VSTeamRequest -Area release -Resource releases -Id 1 -SubDomain vsrm -Version '4.1-preview' -ProjectName testproject -JSON + + Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://vsrm.dev.azure.com/test/testproject/_apis/release/releases/1?api-version=4.1-preview" + } + } + + It 'AdditionalHeaders should call API' { + Invoke-VSTeamRequest -Area release -Resource releases -Id 1 -SubDomain vsrm -Version '4.1-preview' -ProjectName testproject -JSON -AdditionalHeaders @{Test = "Test" } + + Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Headers["Test"] -eq 'Test' -and + $Uri -eq "https://vsrm.dev.azure.com/test/testproject/_apis/release/releases/1?api-version=4.1-preview" + } + } + + It 'by Product Id should call API with product id instead of name' { + Invoke-VSTeamRequest -ProjectName testproject -UseProjectId -Area release -Resource releases -Id 1 -SubDomain vsrm -Version '4.1-preview' + + Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://vsrm.dev.azure.com/test/010d06f0-00d5-472a-bb47-58947c230876/_apis/release/releases/1?api-version=4.1-preview" + } + } + } } \ No newline at end of file diff --git a/unit/test/ProcessValidateAttribute.Tests.ps1 b/unit/test/ProcessValidateAttribute.Tests.ps1 new file mode 100644 index 000000000..73fe3c224 --- /dev/null +++ b/unit/test/ProcessValidateAttribute.Tests.ps1 @@ -0,0 +1,41 @@ +Set-StrictMode -Version Latest + +#region include +$here = Split-Path -Parent $MyInvocation.MyCommand.Path +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") + +. "$here/../../Source/Classes/VSTeamProcessCache.ps1" +. "$here/../../Source/Private/applyTypes.ps1" +. "$here/../../Source/Private/common.ps1" +. "$here/../../Source/Classes/$sut" +#endregion + +Describe "ProcessValidateAttribute" { + Context "Existing Process" { + Mock _hasProcessTemplateCacheExpired { return $true } + Mock _getProcesses { return @("Test1", "Test2") } + + It "it is not in list and should throw" { + $target = [ProcessValidateAttribute]::new() + + { $target.Validate("Test", $null) } | Should Throw + } + + It "it is in list and should not throw" { + $target = [ProcessValidateAttribute]::new() + + { $target.Validate("Test1", $null) } | Should Not Throw + } + } + + Context "No Processes" { + Mock _getProcesses { return @() } + Mock _hasProcessTemplateCacheExpired { return $true } + + It "list is empty and should not throw" { + $target = [ProcessValidateAttribute]::new() + + { $target.Validate("Test", $null) } | Should Not Throw + } + } +} \ No newline at end of file diff --git a/unit/test/ProjectValidateAttribute.Tests.ps1 b/unit/test/ProjectValidateAttribute.Tests.ps1 new file mode 100644 index 000000000..d5a157e94 --- /dev/null +++ b/unit/test/ProjectValidateAttribute.Tests.ps1 @@ -0,0 +1,41 @@ +Set-StrictMode -Version Latest + +#region include +$here = Split-Path -Parent $MyInvocation.MyCommand.Path +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") + +. "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Private/applyTypes.ps1" +. "$here/../../Source/Private/common.ps1" +. "$here/../../Source/Classes/$sut" +#endregion + +Describe "ProjectValidateAttribute" { + Context "Existing Project" { + Mock _hasProjectCacheExpired { return $true } + Mock _getProjects { return @("Test1", "Test2") } + + It "it is not in list and should throw" { + $target = [ProjectValidateAttribute]::new() + + { $target.Validate("Test", $null) } | Should Throw + } + + It "it is in list and should not throw" { + $target = [ProjectValidateAttribute]::new() + + { $target.Validate("Test1", $null) } | Should Not Throw + } + } + + Context "No Projects" { + Mock _getProjects { return @() } + Mock _hasProjectCacheExpired { return $true } + + It "list is empty and should not throw" { + $target = [ProjectValidateAttribute]::new() + + { $target.Validate("Test", $null) } | Should Not Throw + } + } +} \ No newline at end of file diff --git a/unit/test/Remove-VSTeam.Tests.ps1 b/unit/test/Remove-VSTeam.Tests.ps1 index 832814a67..85f608a56 100644 --- a/unit/test/Remove-VSTeam.Tests.ps1 +++ b/unit/test/Remove-VSTeam.Tests.ps1 @@ -10,35 +10,26 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamTeam.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/Get-VSTeam.ps1" . "$here/../../Source/Public/$sut" #endregion - -$results = [PSCustomObject]@{ - value = [PSCustomObject]@{ +Describe "VSTeam" { + $singleResult = [PSCustomObject]@{ id = '6f365a7143e492e911c341451a734401bcacadfd' name = 'refs/heads/master' description = 'team description' } -} - -$singleResult = [PSCustomObject]@{ - id = '6f365a7143e492e911c341451a734401bcacadfd' - name = 'refs/heads/master' - description = 'team description' -} -Describe "VSTeam" { Context "Get-VSTeam" { Context "services" { Mock _getInstance { return 'https://dev.azure.com/test' } Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } - . "$PSScriptRoot\mocks\mockProjectNameDynamicParam.ps1" - Context 'Remove-VSTeam' { Mock Invoke-RestMethod { return $singleResult } @@ -67,10 +58,7 @@ Describe "VSTeam" { } } - Context "Server" { - . "$PSScriptRoot\mocks\mockProjectNameDynamicParam.ps1" - Mock _useWindowsAuthenticationOnPremise { return $true } Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } diff --git a/unit/test/Remove-VSTeamAccessControlEntry.Tests.ps1 b/unit/test/Remove-VSTeamAccessControlEntry.Tests.ps1 index b53d67d92..221b679b9 100644 --- a/unit/test/Remove-VSTeamAccessControlEntry.Tests.ps1 +++ b/unit/test/Remove-VSTeamAccessControlEntry.Tests.ps1 @@ -15,8 +15,10 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Public/$sut" #endregion -$securityNamespace = -@" +Describe 'VSTeamSecurityNamespace' { + + $securityNamespace = + @" { "namespaceId": "2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87", "name": "Git Repositories", @@ -116,7 +118,6 @@ $securityNamespace = } "@ | ConvertFrom-Json -Describe 'VSTeamSecurityNamespace' { # Set the account to use for testing. A normal user would do this # using the Set-VSTeamAccount function. Mock _getInstance { return 'https://dev.azure.com/test' } diff --git a/unit/test/Remove-VSTeamAccount.Tests.ps1 b/unit/test/Remove-VSTeamAccount.Tests.ps1 index 8216101ac..0bfd68fe4 100644 --- a/unit/test/Remove-VSTeamAccount.Tests.ps1 +++ b/unit/test/Remove-VSTeamAccount.Tests.ps1 @@ -1,135 +1,133 @@ -Set-StrictMode -Version Latest - -#region include -$here = Split-Path -Parent $MyInvocation.MyCommand.Path -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") - -. "$here/../../Source/Classes/VSTeamVersions.ps1" -. "$here/../../Source/Classes/VSTeamProjectCache.ps1" -. "$here/../../Source/Private/common.ps1" -. "$here/../../Source/Public/$sut" -#endregion - -Describe 'Remove-VSTeamAccount' { - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { - $Uri -like "*_apis/projects*" - } - - . "$PSScriptRoot\mocks\mockProjectDynamicParamMandatoryFalse.ps1" - - Context 'Remove-VSTeamAccount run as administrator' { - Mock _isOnWindows { return $true } - Mock _testAdministrator { return $true } - Mock _clearEnvironmentVariables - - It 'should clear env at process level' { - Remove-VSTeamAccount - - # Assert - # Make sure set env vars was called with the correct parameters - Assert-MockCalled _clearEnvironmentVariables -Exactly -Scope It -Times 1 -ParameterFilter { - $Level -eq 'Process' - } - } - } - - Context 'Remove-VSTeamAccount run as normal user' { - Mock _isOnWindows { return $true } - Mock _testAdministrator { return $false } - Mock _clearEnvironmentVariables - - It 'should clear env at process level' { - # Act - Remove-VSTeamAccount - - # Assert - # Make sure set env vars was called with the correct parameters - Assert-MockCalled _clearEnvironmentVariables -Exactly -Scope It -Times 1 -ParameterFilter { - $Level -eq 'Process' - } - } - } - - Context 'Remove-VSTeamAccount with no arguments' { - Mock _isOnWindows { return $false } - Mock _clearEnvironmentVariables - - It 'should clear env at process level' { - # Act - Remove-VSTeamAccount - - # Assert - # Make sure set env vars was called with the correct parameters - Assert-MockCalled _clearEnvironmentVariables -Exactly -Scope It -Times 1 -ParameterFilter { - $Level -eq 'Process' - } - } - } - - Context 'Remove-VSTeamAccount at user level' { - Mock _isOnWindows { return $true } - Mock _testAdministrator { return $false } - Mock _clearEnvironmentVariables - - It 'should clear env at user level' { - # Act - Remove-VSTeamAccount -Level User - - # Assert - # Make sure set env vars was called with the correct parameters - Assert-MockCalled _clearEnvironmentVariables -Exactly -Scope It -Times 1 -ParameterFilter { - $Level -eq 'User' - } - } - } - - Context 'Remove-VSTeamAccount at all levels as administrator' { - Mock _testAdministrator { return $true } - Mock _isOnWindows { return $true } - Mock _clearEnvironmentVariables - - It 'should clear env at all levels' { - # Act - Remove-VSTeamAccount -Level All - - # Assert - Assert-MockCalled _clearEnvironmentVariables -Exactly -Scope It -Times 1 -ParameterFilter { - $Level -eq 'User' - } - - Assert-MockCalled _clearEnvironmentVariables -Exactly -Scope It -Times 1 -ParameterFilter { - $Level -eq 'Process' - } - - Assert-MockCalled _clearEnvironmentVariables -Exactly -Scope It -Times 1 -ParameterFilter { - $Level -eq 'Machine' - } - } - } - - Context 'Remove-VSTeamAccount at all levels as normal user' { - Mock _testAdministrator { return $false } - Mock _isOnWindows { return $true } - Mock Write-Warning - Mock _clearEnvironmentVariables - - It 'should clear env at all levels' { - # Act - Remove-VSTeamAccount -Level All - - # Assert - Assert-MockCalled _clearEnvironmentVariables -Exactly -Scope It -Times 1 -ParameterFilter { - $Level -eq 'User' - } - - Assert-MockCalled _clearEnvironmentVariables -Exactly -Scope It -Times 1 -ParameterFilter { - $Level -eq 'Process' - } - - Assert-MockCalled _clearEnvironmentVariables -Exactly -Scope It -Times 0 -ParameterFilter { - $Level -eq 'Machine' - } - } - } +Set-StrictMode -Version Latest + +#region include +$here = Split-Path -Parent $MyInvocation.MyCommand.Path +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") + +. "$here/../../Source/Classes/VSTeamVersions.ps1" +. "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Private/common.ps1" +. "$here/../../Source/Public/$sut" +#endregion + +Describe 'Remove-VSTeamAccount' { + # Mock the call to Get-Projects by the dynamic parameter for ProjectName + Mock Invoke-RestMethod { return @() } -ParameterFilter { + $Uri -like "*_apis/projects*" + } + + Context 'Remove-VSTeamAccount run as administrator' { + Mock _isOnWindows { return $true } + Mock _testAdministrator { return $true } + Mock _clearEnvironmentVariables + + It 'should clear env at process level' { + Remove-VSTeamAccount + + # Assert + # Make sure set env vars was called with the correct parameters + Assert-MockCalled _clearEnvironmentVariables -Exactly -Scope It -Times 1 -ParameterFilter { + $Level -eq 'Process' + } + } + } + + Context 'Remove-VSTeamAccount run as normal user' { + Mock _isOnWindows { return $true } + Mock _testAdministrator { return $false } + Mock _clearEnvironmentVariables + + It 'should clear env at process level' { + # Act + Remove-VSTeamAccount + + # Assert + # Make sure set env vars was called with the correct parameters + Assert-MockCalled _clearEnvironmentVariables -Exactly -Scope It -Times 1 -ParameterFilter { + $Level -eq 'Process' + } + } + } + + Context 'Remove-VSTeamAccount with no arguments' { + Mock _isOnWindows { return $false } + Mock _clearEnvironmentVariables + + It 'should clear env at process level' { + # Act + Remove-VSTeamAccount + + # Assert + # Make sure set env vars was called with the correct parameters + Assert-MockCalled _clearEnvironmentVariables -Exactly -Scope It -Times 1 -ParameterFilter { + $Level -eq 'Process' + } + } + } + + Context 'Remove-VSTeamAccount at user level' { + Mock _isOnWindows { return $true } + Mock _testAdministrator { return $false } + Mock _clearEnvironmentVariables + + It 'should clear env at user level' { + # Act + Remove-VSTeamAccount -Level User + + # Assert + # Make sure set env vars was called with the correct parameters + Assert-MockCalled _clearEnvironmentVariables -Exactly -Scope It -Times 1 -ParameterFilter { + $Level -eq 'User' + } + } + } + + Context 'Remove-VSTeamAccount at all levels as administrator' { + Mock _testAdministrator { return $true } + Mock _isOnWindows { return $true } + Mock _clearEnvironmentVariables + + It 'should clear env at all levels' { + # Act + Remove-VSTeamAccount -Level All + + # Assert + Assert-MockCalled _clearEnvironmentVariables -Exactly -Scope It -Times 1 -ParameterFilter { + $Level -eq 'User' + } + + Assert-MockCalled _clearEnvironmentVariables -Exactly -Scope It -Times 1 -ParameterFilter { + $Level -eq 'Process' + } + + Assert-MockCalled _clearEnvironmentVariables -Exactly -Scope It -Times 1 -ParameterFilter { + $Level -eq 'Machine' + } + } + } + + Context 'Remove-VSTeamAccount at all levels as normal user' { + Mock _testAdministrator { return $false } + Mock _isOnWindows { return $true } + Mock Write-Warning + Mock _clearEnvironmentVariables + + It 'should clear env at all levels' { + # Act + Remove-VSTeamAccount -Level All + + # Assert + Assert-MockCalled _clearEnvironmentVariables -Exactly -Scope It -Times 1 -ParameterFilter { + $Level -eq 'User' + } + + Assert-MockCalled _clearEnvironmentVariables -Exactly -Scope It -Times 1 -ParameterFilter { + $Level -eq 'Process' + } + + Assert-MockCalled _clearEnvironmentVariables -Exactly -Scope It -Times 0 -ParameterFilter { + $Level -eq 'Machine' + } + } + } } \ No newline at end of file diff --git a/unit/test/Remove-VSTeamAgent.Tests.ps1 b/unit/test/Remove-VSTeamAgent.Tests.ps1 index c6dd78c32..1389f96f4 100644 --- a/unit/test/Remove-VSTeamAgent.Tests.ps1 +++ b/unit/test/Remove-VSTeamAgent.Tests.ps1 @@ -1,12 +1,15 @@ Set-StrictMode -Version Latest +#region include $here = Split-Path -Parent $MyInvocation.MyCommand.Path $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/$sut" +#endregion Describe 'Remove-VSTeamAgent' { Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable diff --git a/unit/test/Remove-VSTeamBuild.Tests.ps1 b/unit/test/Remove-VSTeamBuild.Tests.ps1 index 98fa15e23..5ef2d4ea0 100644 --- a/unit/test/Remove-VSTeamBuild.Tests.ps1 +++ b/unit/test/Remove-VSTeamBuild.Tests.ps1 @@ -1,12 +1,16 @@ Set-StrictMode -Version Latest +#region include $here = Split-Path -Parent $MyInvocation.MyCommand.Path $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/$sut" +#endregion Describe 'Remove-VSTeamBuild' { # Mock the call to Get-Projects by the dynamic parameter for ProjectName @@ -15,9 +19,6 @@ Describe 'Remove-VSTeamBuild' { } Context 'Service' { - # Load the mocks to create the project name dynamic parameter - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" - # Set the account to use for testing. A normal user would do this # using the Set-VSTeamAccount function. Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable @@ -39,8 +40,6 @@ Describe 'Remove-VSTeamBuild' { } Context 'Server local Auth' { - . "$PSScriptRoot\mocks\mockProjectNameDynamicParam.ps1" - Mock _useWindowsAuthenticationOnPremise { return $true } Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } -Verifiable diff --git a/unit/test/Remove-VSTeamBuildDefinition.Tests.ps1 b/unit/test/Remove-VSTeamBuildDefinition.Tests.ps1 index ae125ea67..50eae85c1 100644 --- a/unit/test/Remove-VSTeamBuildDefinition.Tests.ps1 +++ b/unit/test/Remove-VSTeamBuildDefinition.Tests.ps1 @@ -1,15 +1,20 @@ Set-StrictMode -Version Latest +#region include $here = Split-Path -Parent $MyInvocation.MyCommand.Path $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" +. "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/$sut" - -$resultsVSTS = Get-Content "$PSScriptRoot\sampleFiles\buildDefvsts.json" -Raw | ConvertFrom-Json +#endregion Describe 'Remove-VSTeamBuildDefinition' { + $resultsVSTS = Get-Content "$PSScriptRoot\sampleFiles\buildDefvsts.json" -Raw | ConvertFrom-Json + Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable # Mock the call to Get-Projects by the dynamic parameter for ProjectName @@ -17,8 +22,6 @@ Describe 'Remove-VSTeamBuildDefinition' { $Uri -like "*_apis/projects*" } - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" - Context 'Succeeds' { Mock Invoke-RestMethod { return $resultsVSTS } diff --git a/unit/test/Remove-VSTeamBuildTag.Tests.ps1 b/unit/test/Remove-VSTeamBuildTag.Tests.ps1 index 54bf019b2..31823aa26 100644 --- a/unit/test/Remove-VSTeamBuildTag.Tests.ps1 +++ b/unit/test/Remove-VSTeamBuildTag.Tests.ps1 @@ -1,69 +1,62 @@ Set-StrictMode -Version Latest +#region include $here = Split-Path -Parent $MyInvocation.MyCommand.Path $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" +. "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/$sut" +#endregion -Describe 'Remove-VSTeamBuildTag' { - # Load the mocks to create the project name dynamic parameter - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" - - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable - - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { - $Uri -like "*_apis/projects*" - } - +Describe 'VSTeamBuildTag' { Context 'Remove-VSTeamBuildTag' { - Mock Invoke-RestMethod { - return @{ value = $null } - } [string[]] $inputTags = "Test1", "Test2", "Test3" + Mock Invoke-RestMethod { return @{ value = $null } } - It 'should add tags to Build' { - Remove-VSTeamBuildTag -ProjectName project -id 2 -Tags $inputTags + Context 'Services' { + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } - foreach ($inputTag in $inputTags) { - Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Method -eq 'Delete' -and - $Uri -eq "https://dev.azure.com/test/project/_apis/build/builds/2/tags?api-version=$(_getApiVersion Build)" + "&tag=$inputTag" - } + # Mock the call to Get-Projects by the dynamic parameter for ProjectName + Mock Invoke-RestMethod { return @() } -ParameterFilter { + $Uri -like "*_apis/projects*" } - } - } -} -Describe 'Remove-VSTeamBuildTag' { - . "$PSScriptRoot\mocks\mockProjectNameDynamicParam.ps1" + It 'should add tags to Build' { + Remove-VSTeamBuildTag -ProjectName project -id 2 -Tags $inputTags - Mock _useWindowsAuthenticationOnPremise { return $true } + foreach ($inputTag in $inputTags) { + Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Method -eq 'Delete' -and + $Uri -eq "https://dev.azure.com/test/project/_apis/build/builds/2/tags?api-version=$(_getApiVersion Build)" + "&tag=$inputTag" + } + } + } + } - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { - $Uri -like "*_apis/projects*" - } + Context 'Server' { + Mock _useWindowsAuthenticationOnPremise { return $true } - Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } -Verifiable + # Mock the call to Get-Projects by the dynamic parameter for ProjectName + Mock Invoke-RestMethod { return @() } -ParameterFilter { + $Uri -like "*_apis/projects*" + } - Context 'Remove-VSTeamBuildTag' { - Mock Invoke-RestMethod { - return @{ value = $null } - } - [string[]] $inputTags = "Test1", "Test2", "Test3" + Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } - It 'should add tags to Build' { - Remove-VSTeamBuildTag -ProjectName project -id 2 -Tags $inputTags + It 'should add tags to Build' { + Remove-VSTeamBuildTag -ProjectName project -id 2 -Tags $inputTags - foreach ($inputTag in $inputTags) { - Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Method -eq 'Delete' -and - $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/build/builds/2/tags?api-version=$(_getApiVersion Build)" + "&tag=$inputTag" + foreach ($inputTag in $inputTags) { + Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Method -eq 'Delete' -and + $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/build/builds/2/tags?api-version=$(_getApiVersion Build)" + "&tag=$inputTag" + } } } } diff --git a/unit/test/Remove-VSTeamExtension.Tests.ps1 b/unit/test/Remove-VSTeamExtension.Tests.ps1 index a8c5ebd4c..830772342 100644 --- a/unit/test/Remove-VSTeamExtension.Tests.ps1 +++ b/unit/test/Remove-VSTeamExtension.Tests.ps1 @@ -1,5 +1,6 @@ Set-StrictMode -Version Latest +#region include Import-Module SHiPS $here = Split-Path -Parent $MyInvocation.MyCommand.Path @@ -11,10 +12,11 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamExtension.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/$sut" - -$singleResult = Get-Content "$PSScriptRoot\sampleFiles\singleExtensionResult.json" -Raw | ConvertFrom-Json +#endregion Describe 'VSTeamExtension' { + $singleResult = Get-Content "$PSScriptRoot\sampleFiles\singleExtensionResult.json" -Raw | ConvertFrom-Json + Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable Context 'Remove-VSTeamExtension' { diff --git a/unit/test/Remove-VSTeamFeed.Tests.ps1 b/unit/test/Remove-VSTeamFeed.Tests.ps1 index f0f3cd67b..d6493c563 100644 --- a/unit/test/Remove-VSTeamFeed.Tests.ps1 +++ b/unit/test/Remove-VSTeamFeed.Tests.ps1 @@ -8,6 +8,7 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/$sut" #endregion diff --git a/unit/test/Remove-VSTeamGitRepository.Tests.ps1 b/unit/test/Remove-VSTeamGitRepository.Tests.ps1 index 4ab1a06a8..798d1e14f 100644 --- a/unit/test/Remove-VSTeamGitRepository.Tests.ps1 +++ b/unit/test/Remove-VSTeamGitRepository.Tests.ps1 @@ -10,6 +10,7 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamDirectory.ps1" . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Classes/VSTeamUserEntitlement.ps1" . "$here/../../Source/Classes/VSTeamTeams.ps1" . "$here/../../Source/Classes/VSTeamRepositories.ps1" @@ -43,32 +44,30 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Public/$sut" #endregion -$singleResult = [PSCustomObject]@{ - id = '' - url = '' - sshUrl = '' - remoteUrl = '' - defaultBranch = '' - size = 0 - name = '' - project = [PSCustomObject]@{ - name = 'Project' - id = 1 - description = '' - url = '' - state = '' - revision = '' - visibility = '' +Describe "VSTeamGitRepository" { + ## Arrange + $singleResult = [PSCustomObject]@{ + id = '' + url = '' + sshUrl = '' + remoteUrl = '' + defaultBranch = '' + size = 0 + name = '' + project = [PSCustomObject]@{ + name = 'Project' + id = 1 + description = '' + url = '' + state = '' + revision = '' + visibility = '' + } } -} -Describe "VSTeamGitRepository" { - ## Arrange # Mock the call to Get-Projects by the dynamic parameter for ProjectName Mock Invoke-RestMethod { return @() } -ParameterFilter { $Uri -like "*_apis/projects*" } - . "$PSScriptRoot\mocks\mockProjectNameDynamicParam.ps1" - Mock Invoke-RestMethod { # Write-Host "Single $Uri" return $singleResult } -ParameterFilter { diff --git a/unit/test/Remove-VSTeamMembership.Tests.ps1 b/unit/test/Remove-VSTeamMembership.Tests.ps1 index c79bd38c7..37ed64786 100644 --- a/unit/test/Remove-VSTeamMembership.Tests.ps1 +++ b/unit/test/Remove-VSTeamMembership.Tests.ps1 @@ -6,6 +6,7 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Private/callMembershipAPI.ps1" . "$here/../../Source/Public/Get-VSTeamProject.ps1" diff --git a/unit/test/Remove-VSTeamPolicy.Tests.ps1 b/unit/test/Remove-VSTeamPolicy.Tests.ps1 index 92b55c340..f215bc202 100644 --- a/unit/test/Remove-VSTeamPolicy.Tests.ps1 +++ b/unit/test/Remove-VSTeamPolicy.Tests.ps1 @@ -6,6 +6,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Public/Get-VSTeamProject.ps1" diff --git a/unit/test/Remove-VSTeamProject.Tests.ps1 b/unit/test/Remove-VSTeamProject.Tests.ps1 index 598127790..29fb94780 100644 --- a/unit/test/Remove-VSTeamProject.Tests.ps1 +++ b/unit/test/Remove-VSTeamProject.Tests.ps1 @@ -10,6 +10,10 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamDirectory.ps1" . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" +. "$here/../../Source/Classes/UncachedProjectCompleter.ps1" +. "$here/../../Source/Classes/UncachedProjectValidateAttribute.ps1" . "$here/../../Source/Classes/VSTeamUserEntitlement.ps1" . "$here/../../Source/Classes/VSTeamTeams.ps1" . "$here/../../Source/Classes/VSTeamRepositories.ps1" @@ -41,9 +45,6 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") #endregion Describe 'VSTeamProject' { - . "$PSScriptRoot\mocks\mockProjectNameDynamicParam.ps1" - . "$PSScriptRoot\mocks\mockProcessNameDynamicParam.ps1" - $singleResult = [PSCustomObject]@{ name = 'Test' description = '' diff --git a/unit/test/Remove-VSTeamRelease.Tests.ps1 b/unit/test/Remove-VSTeamRelease.Tests.ps1 index e5db48470..ff3206085 100644 --- a/unit/test/Remove-VSTeamRelease.Tests.ps1 +++ b/unit/test/Remove-VSTeamRelease.Tests.ps1 @@ -10,6 +10,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamFeed.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Public/Get-VSTeamBuild.ps1" @@ -19,9 +21,7 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") Describe 'VSTeamRelease' { ## Arrange - [VSTeamVersions]::Release = '1.0-unittest' - - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" + Mock _getApiVersion { return '1.0-unittest' } -ParameterFilter { $Service -eq 'Release' } Mock _getInstance { return 'https://dev.azure.com/test' } diff --git a/unit/test/Remove-VSTeamReleaseDefinition.Tests.ps1 b/unit/test/Remove-VSTeamReleaseDefinition.Tests.ps1 index 88256164f..3d518270c 100644 --- a/unit/test/Remove-VSTeamReleaseDefinition.Tests.ps1 +++ b/unit/test/Remove-VSTeamReleaseDefinition.Tests.ps1 @@ -6,6 +6,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/Get-VSTeamProject.ps1" . "$here/../../Source/Public/$sut" @@ -13,9 +15,7 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") Describe 'VSTeamReleaseDefinition' { ## Arrange - [VSTeamVersions]::Release = '1.0-unittest' - - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" + Mock _getApiVersion { return '1.0-unittest' } -ParameterFilter { $Service -eq 'Release' } $results = [PSCustomObject]@{ value = [PSCustomObject]@{ diff --git a/unit/test/Remove-VSTeamTaskGroup.Tests.ps1 b/unit/test/Remove-VSTeamTaskGroup.Tests.ps1 index 99a28295b..194cabd96 100644 --- a/unit/test/Remove-VSTeamTaskGroup.Tests.ps1 +++ b/unit/test/Remove-VSTeamTaskGroup.Tests.ps1 @@ -6,18 +6,15 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/Set-VSTeamAPIVersion.ps1" . "$here/../../Source/Public/$sut" #endregion -$taskGroupsJson = "$PSScriptRoot\sampleFiles\taskGroups.json" -$taskGroupJson = "$PSScriptRoot\sampleFiles\taskGroup.json" - -Describe 'VSTeamTaskGroup' { - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" - +Describe 'VSTeamTaskGroup' { # Set the account to use for testing. A normal user would do this # using the Set-VSTeamAccount function. Mock _getInstance { return 'https://dev.azure.com/test' } @@ -26,21 +23,16 @@ Describe 'VSTeamTaskGroup' { # Mock the call to Get-Projects by the dynamic parameter for ProjectName Mock Invoke-RestMethod { return @() } -ParameterFilter { $Uri -like "*_apis/project*" } - BeforeAll { - $projectName = "project" - $taskGroupJsonAsString = Get-Content $taskGroupJson -Raw - } - Context 'Remove-VSTeamTaskGroup' { Mock Invoke-RestMethod It 'should delete Task group' { $projectID = "d30f8b85-6b13-41a9-bb77-2e1a9c611def" - Remove-VSTeamTaskGroup -projectName $projectName -Id $projectID -Force + Remove-VSTeamTaskGroup -projectName "project" -Id $projectID -Force Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/$projectName/_apis/distributedtask/taskgroups/$($projectID)?api-version=$(_getApiVersion TaskGroups)" -and + $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/taskgroups/$($projectID)?api-version=$(_getApiVersion TaskGroups)" -and $Method -eq 'Delete' } } diff --git a/unit/test/Remove-VSTeamUserEntitlement.Tests.ps1 b/unit/test/Remove-VSTeamUserEntitlement.Tests.ps1 index f4180b88a..b9b5d6206 100644 --- a/unit/test/Remove-VSTeamUserEntitlement.Tests.ps1 +++ b/unit/test/Remove-VSTeamUserEntitlement.Tests.ps1 @@ -6,6 +6,7 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/Get-VSTeamUserEntitlement.ps1" diff --git a/unit/test/Remove-VSTeamVariableGroup.Tests.ps1 b/unit/test/Remove-VSTeamVariableGroup.Tests.ps1 index fab421193..35829df4e 100644 --- a/unit/test/Remove-VSTeamVariableGroup.Tests.ps1 +++ b/unit/test/Remove-VSTeamVariableGroup.Tests.ps1 @@ -6,6 +6,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/Set-VSTeamAPIVersion.ps1" @@ -18,9 +20,7 @@ Describe 'VSTeamVariableGroup' { Context 'Remove-VSTeamVariableGroup' { Context 'Services' { - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" - - [VSTeamVersions]::VariableGroups = '5.0-preview.1' + Mock _getApiVersion { return '5.0-preview.1' } -ParameterFilter { $Service -eq 'VariableGroups' } Mock _getInstance { return 'https://dev.azure.com/test' } @@ -42,9 +42,7 @@ Describe 'VSTeamVariableGroup' { } Context 'Server' { - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" - - [VSTeamVersions]::VariableGroups = '3.2-preview.1' + Mock _getApiVersion { return '3.2-preview.1' } -ParameterFilter { $Service -eq 'VariableGroups' } Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } -Verifiable diff --git a/unit/test/Remove-VSTeamWorkItem.Tests.ps1 b/unit/test/Remove-VSTeamWorkItem.Tests.ps1 index 76f32e73e..00ec6014f 100644 --- a/unit/test/Remove-VSTeamWorkItem.Tests.ps1 +++ b/unit/test/Remove-VSTeamWorkItem.Tests.ps1 @@ -6,6 +6,7 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/Set-VSTeamAPIVersion.ps1" @@ -17,9 +18,7 @@ Describe 'VSTeamWorkItem' { Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { $Uri -like "*_apis/projects*" } - - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" + Mock Invoke-RestMethod { return @() } -ParameterFilter { $Uri -like "*_apis/projects*" } $obj = @{ id = 47 diff --git a/unit/test/Set-VSTeamAPIVersion.Tests.ps1 b/unit/test/Set-VSTeamAPIVersion.Tests.ps1 index c5293cce2..97b69bd32 100644 --- a/unit/test/Set-VSTeamAPIVersion.Tests.ps1 +++ b/unit/test/Set-VSTeamAPIVersion.Tests.ps1 @@ -1,95 +1,95 @@ -Set-StrictMode -Version Latest - -#region include -$here = Split-Path -Parent $MyInvocation.MyCommand.Path -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") - -. "$here/../../Source/Classes/VSTeamVersions.ps1" -. "$here/../../Source/Classes/VSTeamProjectCache.ps1" -. "$here/../../Source/Private/common.ps1" -. "$here/../../Source/Public/$sut" -#endregion - -Describe 'VSTeamAPIVersion' { - Context 'Set-VSTeamAPIVersion' { - It 'Should default to TFS2017' { - Set-VSTeamAPIVersion - [VSTeamVersions]::Version | Should Be 'TFS2017' - } - - It 'Should return TFS2018' { - Set-VSTeamAPIVersion -Target TFS2018 - [VSTeamVersions]::Version | Should Be 'TFS2018' - } - - It 'Should return AzD2019' { - Set-VSTeamAPIVersion -Target AzD2019 - [VSTeamVersions]::Version | Should Be 'AzD2019' - } - - It 'Should VSTS' { - Set-VSTeamAPIVersion -Target VSTS - [VSTeamVersions]::Version | Should Be 'VSTS' - } - - It 'Should AzD' { - Set-VSTeamAPIVersion -Target AzD - [VSTeamVersions]::Version | Should Be 'AzD' - } - - It 'Should change just TaskGroups' { - Set-VSTeamAPIVersion -Service TaskGroups -Version '7.0' - [VSTeamVersions]::TaskGroups | Should Be '7.0' - } - - It 'Should change just Build' { - Set-VSTeamAPIVersion -Service Build -Version '7.0' - [VSTeamVersions]::Build | Should Be '7.0' - } - - It 'Should change just Git' { - Set-VSTeamAPIVersion -Service Git -Version '7.0' - [VSTeamVersions]::Git | Should Be '7.0' - } - - It 'Should change just Core' { - Set-VSTeamAPIVersion -Service Core -Version '7.0' - [VSTeamVersions]::Core | Should Be '7.0' - } - - It 'Should change just Release' { - Set-VSTeamAPIVersion -Service Release -Version '7.0' - [VSTeamVersions]::Release | Should Be '7.0' - } - - It 'Should change just DistributedTask' { - Set-VSTeamAPIVersion -Service DistributedTask -Version '7.0' - [VSTeamVersions]::DistributedTask | Should Be '7.0' - } - - It 'Should change just Tfvc' { - Set-VSTeamAPIVersion -Service Tfvc -Version '7.0' - [VSTeamVersions]::Tfvc | Should Be '7.0' - } - - It 'Should change just Packaging' { - Set-VSTeamAPIVersion -Service Packaging -Version '7.0' - [VSTeamVersions]::Packaging | Should Be '7.0' - } - - It 'Should change just MemberEntitlementManagement' { - Set-VSTeamAPIVersion -Service MemberEntitlementManagement -Version '7.0' - [VSTeamVersions]::MemberEntitlementManagement | Should Be '7.0' - } - - It 'Should change just ServiceFabricEndpoint' { - Set-VSTeamAPIVersion -Service ServiceFabricEndpoint -Version '7.0' - [VSTeamVersions]::ServiceFabricEndpoint | Should Be '7.0' - } - - It 'Should change just ExtensionsManagement' { - Set-VSTeamAPIVersion -Service ExtensionsManagement -Version '7.0' - [VSTeamVersions]::ExtensionsManagement | Should Be '7.0' - } - } +Set-StrictMode -Version Latest + +#region include +$here = Split-Path -Parent $MyInvocation.MyCommand.Path +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") + +. "$here/../../Source/Classes/VSTeamVersions.ps1" +. "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Private/common.ps1" +. "$here/../../Source/Public/$sut" +#endregion + +Describe 'VSTeamAPIVersion' { + Context 'Set-VSTeamAPIVersion' { + It 'Should default to TFS2017' { + Set-VSTeamAPIVersion + [VSTeamVersions]::Version | Should Be 'TFS2017' + } + + It 'Should return TFS2018' { + Set-VSTeamAPIVersion -Target TFS2018 + [VSTeamVersions]::Version | Should Be 'TFS2018' + } + + It 'Should return AzD2019' { + Set-VSTeamAPIVersion -Target AzD2019 + [VSTeamVersions]::Version | Should Be 'AzD2019' + } + + It 'Should VSTS' { + Set-VSTeamAPIVersion -Target VSTS + [VSTeamVersions]::Version | Should Be 'VSTS' + } + + It 'Should AzD' { + Set-VSTeamAPIVersion -Target AzD + [VSTeamVersions]::Version | Should Be 'AzD' + } + + It 'Should change just TaskGroups' { + Set-VSTeamAPIVersion -Service TaskGroups -Version '7.0' + [VSTeamVersions]::TaskGroups | Should Be '7.0' + } + + It 'Should change just Build' { + Set-VSTeamAPIVersion -Service Build -Version '7.0' + [VSTeamVersions]::Build | Should Be '7.0' + } + + It 'Should change just Git' { + Set-VSTeamAPIVersion -Service Git -Version '7.0' + [VSTeamVersions]::Git | Should Be '7.0' + } + + It 'Should change just Core' { + Set-VSTeamAPIVersion -Service Core -Version '7.0' + [VSTeamVersions]::Core | Should Be '7.0' + } + + It 'Should change just Release' { + Set-VSTeamAPIVersion -Service Release -Version '7.0' + [VSTeamVersions]::Release | Should Be '7.0' + } + + It 'Should change just DistributedTask' { + Set-VSTeamAPIVersion -Service DistributedTask -Version '7.0' + [VSTeamVersions]::DistributedTask | Should Be '7.0' + } + + It 'Should change just Tfvc' { + Set-VSTeamAPIVersion -Service Tfvc -Version '7.0' + [VSTeamVersions]::Tfvc | Should Be '7.0' + } + + It 'Should change just Packaging' { + Set-VSTeamAPIVersion -Service Packaging -Version '7.0' + [VSTeamVersions]::Packaging | Should Be '7.0' + } + + It 'Should change just MemberEntitlementManagement' { + Set-VSTeamAPIVersion -Service MemberEntitlementManagement -Version '7.0' + [VSTeamVersions]::MemberEntitlementManagement | Should Be '7.0' + } + + It 'Should change just ServiceFabricEndpoint' { + Set-VSTeamAPIVersion -Service ServiceFabricEndpoint -Version '7.0' + [VSTeamVersions]::ServiceFabricEndpoint | Should Be '7.0' + } + + It 'Should change just ExtensionsManagement' { + Set-VSTeamAPIVersion -Service ExtensionsManagement -Version '7.0' + [VSTeamVersions]::ExtensionsManagement | Should Be '7.0' + } + } } \ No newline at end of file diff --git a/unit/test/Set-VSTeamAccount.Tests.ps1 b/unit/test/Set-VSTeamAccount.Tests.ps1 index 4d47cc3c9..694976561 100644 --- a/unit/test/Set-VSTeamAccount.Tests.ps1 +++ b/unit/test/Set-VSTeamAccount.Tests.ps1 @@ -1,330 +1,330 @@ -Set-StrictMode -Version Latest - -#region include -$here = Split-Path -Parent $MyInvocation.MyCommand.Path -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") - -. "$here/../../Source/Classes/VSTeamVersions.ps1" -. "$here/../../Source/Classes/VSTeamProjectCache.ps1" -. "$here/../../Source/Private/applyTypes.ps1" -. "$here/../../Source/Private/common.ps1" -. "$here/../../Source/Public/Clear-VSTeamDefaultProject.ps1" -. "$here/../../Source/Public/Get-VSTeamProfile.ps1" -. "$here/../../Source/Public/Set-VSTeamAPIVersion.ps1" -. "$here/../../Source/Public/Remove-VSTeamAccount.ps1" -. "$here/../../Source/Public/$sut" -#endregion - -Describe 'VSTeamAccount' { - $contents = @" - [ - { - "Name": "http://localhost:8080/tfs/defaultcollection", - "URL": "http://localhost:8080/tfs/defaultcollection", - "Pat": "", - "Type": "OnPremise", - "Version": "TFS2017", - "Token": "" - }, - { - "Name": "mydemos", - "URL": "https://dev.azure.com/mydemos", - "Pat": "OjEyMzQ1", - "Type": "Pat", - "Token": "", - "Version": "VSTS" - }, - { - "Name": "demonstrations", - "URL": "https://dev.azure.com/demonstrations", - "Pat": "dzY2a2x5am13YWtkcXVwYmg0emE=", - "Type": "Pat", - "Token": "", - "Version": "VSTS" - } - ] -"@ - - AfterAll { - Remove-VSTeamAccount - } - - Context 'You cannot use -UseWindowsAuthentication with Azd' { - # This is only supported on a Windows machine. So we have - # to Mock the call to _isOnWindows so you can develop on a - # Mac or Linux machine. - Mock _isOnWindows { return $true } - - # Have to Mock this because you can't call - # [Security.Principal.WindowsIdentity]::GetCurrent() - # on Mac and Linux - Mock _testAdministrator { return $false } - - Mock Write-Error { } -Verifiable - - It 'Should return error' { - Set-VSTeamAccount -Account test -UseWindowsAuthentication - Assert-VerifiableMock - } - } - - Context 'Set-VSTeamAccount invalid profile' { - Mock _isOnWindows { return $false } - Mock Write-Error -Verifiable - Mock Get-VSTeamProfile { return "[]" | ConvertFrom-Json | ForEach-Object { $_ } } - - Set-VSTeamAccount -Profile notFound - - It 'should write error' { - Assert-VerifiableMock - } - } - - Context 'Set-VSTeamAccount profile' { - Mock _isOnWindows { return $false } - Mock _setEnvironmentVariables - Mock Set-VSTeamAPIVersion - Mock Get-VSTeamProfile { return $contents | ConvertFrom-Json | ForEach-Object { $_ } } - - It 'should set env at process level' { - Set-VSTeamAccount -Profile mydemos - - Assert-MockCalled Set-VSTeamAPIVersion -Exactly -Scope It -Times 1 -ParameterFilter { - $Target -eq 'VSTS' - } - - # Make sure set env vars was called with the correct parameters - Assert-MockCalled _setEnvironmentVariables -Exactly -Scope It -Times 1 -ParameterFilter { - $Level -eq 'Process' -and $Pat -eq 'OjEyMzQ1' -and $Acct -eq 'https://dev.azure.com/mydemos' - } - } - } - - Context 'Set-VSTeamAccount profile and drive' { - Mock _isOnWindows { return $false } - Mock _setEnvironmentVariables - Mock Set-VSTeamAPIVersion - Mock Write-Output -Verifiable - Mock Get-VSTeamProfile { return $contents | ConvertFrom-Json | ForEach-Object { $_ } } - - It 'should set env at process level' { - Set-VSTeamAccount -Profile mydemos -Drive mydemos - - Assert-VerifiableMock - - Assert-MockCalled Set-VSTeamAPIVersion -Exactly -Scope It -Times 1 -ParameterFilter { - $Target -eq 'VSTS' - } - - # Make sure set env vars was called with the correct parameters - Assert-MockCalled _setEnvironmentVariables -Exactly -Scope It -Times 1 -ParameterFilter { - $Level -eq 'Process' -and $Pat -eq 'OjEyMzQ1' -and $Acct -eq 'https://dev.azure.com/mydemos' - } - } - } - - Context 'Set-VSTeamAccount vsts' { - Mock _isOnWindows { return $false } - Mock _setEnvironmentVariables - Mock Set-VSTeamAPIVersion - - It 'should set env at process level' { - Set-VSTeamAccount -a mydemos -pe 12345 -Version VSTS - - Assert-MockCalled Set-VSTeamAPIVersion -Exactly -Scope It -Times 1 -ParameterFilter { - $Target -eq 'VSTS' - } - - # Make sure set env vars was called with the correct parameters - Assert-MockCalled _setEnvironmentVariables -Exactly -Scope It -Times 1 -ParameterFilter { - $Level -eq 'Process' -and $Pat -eq 'OjEyMzQ1' -and $Acct -eq 'https://dev.azure.com/mydemos' - } - } - } - - Context 'Set-VSTeamAccount vsts (old URL)' { - Mock _isOnWindows { return $false } - Mock _setEnvironmentVariables - Mock Set-VSTeamAPIVersion - - It 'should set env at process level' { - Set-VSTeamAccount -a https://mydemos.visualstudio.com -pe 12345 -Version VSTS - - Assert-MockCalled Set-VSTeamAPIVersion -Exactly -Scope It -Times 1 -ParameterFilter { - $Target -eq 'VSTS' - } - - # Make sure set env vars was called with the correct parameters - Assert-MockCalled _setEnvironmentVariables -Exactly -Scope It -Times 1 -ParameterFilter { - $Level -eq 'Process' -and $Pat -eq 'OjEyMzQ1' -and $Acct -eq 'https://dev.azure.com/mydemos' - } - } - } - - Context 'Set-VSTeamAccount vsts OAuth' { - Mock _isOnWindows { return $false } - Mock _setEnvironmentVariables - Mock Set-VSTeamAPIVersion - - It 'should set env at process level' { - Set-VSTeamAccount -a mydemos -pe 12345 -Version VSTS -UseBearerToken - - Assert-MockCalled Set-VSTeamAPIVersion -Exactly -Scope It -Times 1 -ParameterFilter { - $Target -eq 'VSTS' - } - - # Make sure set env vars was called with the correct parameters - Assert-MockCalled _setEnvironmentVariables -Exactly -Scope It -Times 1 -ParameterFilter { - $Level -eq 'Process' -and $Pat -eq '' -and $BearerToken -eq 12345 -and $Acct -eq 'https://dev.azure.com/mydemos' - } - } - } - - Context 'Set-VSTeamAccount vsts with securePersonalAccessToken' { - Mock _isOnWindows { return $false } - Mock _setEnvironmentVariables - Mock Set-VSTeamAPIVersion - - It 'should set env at process level' { - $password = '12345' | ConvertTo-SecureString -AsPlainText -Force - - Set-VSTeamAccount -a mydemos -SecurePersonalAccessToken $password -Version VSTS - - Assert-MockCalled Set-VSTeamAPIVersion -Exactly -Scope It -Times 1 -ParameterFilter { - $Target -eq 'VSTS' - } - - # Make sure set env vars was called with the correct parameters - Assert-MockCalled _setEnvironmentVariables -Exactly -Scope It -Times 1 -ParameterFilter { - $Level -eq 'Process' -and $Pat -eq 'OjEyMzQ1' -and $Acct -eq 'https://dev.azure.com/mydemos' - } - } - } - - Context 'Set-VSTeamAccount run as administrator' { - # I have to write both test just in case the actually - # start the PowerShell window as Admin or not. If I - # don't write both of these I will get different code - # coverage depending on if I started the PowerShell session - # as admin or not. - Mock _isOnWindows { return $true } - Mock _testAdministrator { return $true } - Mock Set-VSTeamAPIVersion - Mock _setEnvironmentVariables - - It 'should set env at process level' { - Set-VSTeamAccount -a mydemos -pe 12345 - - Assert-MockCalled Set-VSTeamAPIVersion -Exactly -Scope It -Times 1 -ParameterFilter { - $Target -eq 'VSTS' - } - - # Make sure set env vars was called with the correct parameters - Assert-MockCalled _setEnvironmentVariables -Exactly -Scope It -Times 1 -ParameterFilter { - $Level -eq 'Process' -and $Pat -eq 'OjEyMzQ1' -and $Acct -eq 'https://dev.azure.com/mydemos' - } - } - } - - Context 'Set-VSTeamAccount run as normal user' { - # I have to write both test just in case the actually - # start the PowerShell window as Admin or not. If I - # don't write both of these I will get different code - # coverage depending on if I started the PowerShell session - # as admin or not. - Mock _isOnWindows { return $false } - Mock _testAdministrator { return $false } - Mock Set-VSTeamAPIVersion - Mock _setEnvironmentVariables - - It 'should set env at process level' { - Set-VSTeamAccount -a mydemos -pe 12345 - - Assert-MockCalled Set-VSTeamAPIVersion -Exactly -Scope It -Times 1 -ParameterFilter { - $Target -eq 'VSTS' - } - - # Make sure set env vars was called with the correct parameters - Assert-MockCalled _setEnvironmentVariables -Exactly -Scope It -Times 1 -ParameterFilter { - $Level -eq 'Process' -and $Pat -eq 'OjEyMzQ1' -and $Acct -eq 'https://dev.azure.com/mydemos' - } - } - } - - Context 'Set-VSTeamAccount TFS from windows' { - # I have to write both test just in case the actually - # start the PowerShell window as Admin or not. If I - # don't write both of these I will get different code - # coverage depending on if I started the PowerShell session - # as admin or not. - Mock _isOnWindows { return $true } - Mock _testAdministrator { return $false } - Mock Set-VSTeamAPIVersion - Mock _setEnvironmentVariables - - It 'should set env at process level' { - Set-VSTeamAccount -a http://localhost:8080/tfs/defaultcollection -UseWindowsAuthentication - - Assert-MockCalled Set-VSTeamAPIVersion -Exactly -Scope It -Times 1 -ParameterFilter { - $Target -eq 'TFS2017' - } - - # Make sure set env vars was called with the correct parameters - Assert-MockCalled _setEnvironmentVariables -Exactly -Scope It -Times 1 -ParameterFilter { - $Level -eq 'Process' -and $Acct -eq 'http://localhost:8080/tfs/defaultcollection' - } - } - } - - Context 'Set-VSTeamAccount TFS' { - # I have to write both test just in case the actually - # start the PowerShell window as Admin or not. If I - # don't write both of these I will get different code - # coverage depending on if I started the PowerShell session - # as admin or not. - Mock _isOnWindows { return $false } - Mock _testAdministrator { return $false } - Mock Set-VSTeamAPIVersion - Mock _setEnvironmentVariables - - It 'should set env at process level' { - Set-VSTeamAccount -a http://localhost:8080/tfs/defaultcollection -pe 12345 - - Assert-MockCalled Set-VSTeamAPIVersion -Exactly -Scope It -Times 1 -ParameterFilter { - $Target -eq 'TFS2017' - } - - # Make sure set env vars was called with the correct parameters - Assert-MockCalled _setEnvironmentVariables -Exactly -Scope It -Times 1 -ParameterFilter { - $Level -eq 'Process' -and $Pat -eq 'OjEyMzQ1' -and $Acct -eq 'http://localhost:8080/tfs/defaultcollection' - } - } - } - - Context 'Set-VSTeamAccount at user level on Windows machine' { - # This is only supported on a Windows machine. So we have - # to Mock the call to _isOnWindows so you can develop on a - # Mac or Linux machine. - Mock _isOnWindows { return $true } - - # Have to Mock this because you can't call - # [Security.Principal.WindowsIdentity]::GetCurrent() - # on Mac and Linux - Mock _testAdministrator { return $false } - Mock _setEnvironmentVariables - Mock Set-VSTeamAPIVersion - - It 'should set env at user level' { - Set-VSTeamAccount -a mydemos -pe 12345 -Level User - - Assert-MockCalled Set-VSTeamAPIVersion -Exactly -Scope It -Times 1 -ParameterFilter { - $Target -eq 'VSTS' - } - - # Make sure set env vars was called with the correct parameters - Assert-MockCalled _setEnvironmentVariables -Exactly -Scope It -Times 1 -ParameterFilter { - $Level -eq 'User' -and $Pat -eq 'OjEyMzQ1' -and $Acct -eq 'https://dev.azure.com/mydemos' - } - } - } +Set-StrictMode -Version Latest + +#region include +$here = Split-Path -Parent $MyInvocation.MyCommand.Path +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") + +. "$here/../../Source/Classes/VSTeamVersions.ps1" +. "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Private/applyTypes.ps1" +. "$here/../../Source/Private/common.ps1" +. "$here/../../Source/Public/Clear-VSTeamDefaultProject.ps1" +. "$here/../../Source/Public/Get-VSTeamProfile.ps1" +. "$here/../../Source/Public/Set-VSTeamAPIVersion.ps1" +. "$here/../../Source/Public/Remove-VSTeamAccount.ps1" +. "$here/../../Source/Public/$sut" +#endregion + +Describe 'VSTeamAccount' { + $contents = @" + [ + { + "Name": "http://localhost:8080/tfs/defaultcollection", + "URL": "http://localhost:8080/tfs/defaultcollection", + "Pat": "", + "Type": "OnPremise", + "Version": "TFS2017", + "Token": "" + }, + { + "Name": "mydemos", + "URL": "https://dev.azure.com/mydemos", + "Pat": "OjEyMzQ1", + "Type": "Pat", + "Token": "", + "Version": "VSTS" + }, + { + "Name": "demonstrations", + "URL": "https://dev.azure.com/demonstrations", + "Pat": "dzY2a2x5am13YWtkcXVwYmg0emE=", + "Type": "Pat", + "Token": "", + "Version": "VSTS" + } + ] +"@ + + AfterAll { + Remove-VSTeamAccount + } + + Context 'You cannot use -UseWindowsAuthentication with Azd' { + # This is only supported on a Windows machine. So we have + # to Mock the call to _isOnWindows so you can develop on a + # Mac or Linux machine. + Mock _isOnWindows { return $true } + + # Have to Mock this because you can't call + # [Security.Principal.WindowsIdentity]::GetCurrent() + # on Mac and Linux + Mock _testAdministrator { return $false } + + Mock Write-Error { } -Verifiable + + It 'Should return error' { + Set-VSTeamAccount -Account test -UseWindowsAuthentication + Assert-VerifiableMock + } + } + + Context 'Set-VSTeamAccount invalid profile' { + Mock _isOnWindows { return $false } + Mock Write-Error -Verifiable + Mock Get-VSTeamProfile { return "[]" | ConvertFrom-Json | ForEach-Object { $_ } } + + Set-VSTeamAccount -Profile notFound + + It 'should write error' { + Assert-VerifiableMock + } + } + + Context 'Set-VSTeamAccount profile' { + Mock _isOnWindows { return $false } + Mock _setEnvironmentVariables + Mock Set-VSTeamAPIVersion + Mock Get-VSTeamProfile { return $contents | ConvertFrom-Json | ForEach-Object { $_ } } + + It 'should set env at process level' { + Set-VSTeamAccount -Profile mydemos + + Assert-MockCalled Set-VSTeamAPIVersion -Exactly -Scope It -Times 1 -ParameterFilter { + $Target -eq 'VSTS' + } + + # Make sure set env vars was called with the correct parameters + Assert-MockCalled _setEnvironmentVariables -Exactly -Scope It -Times 1 -ParameterFilter { + $Level -eq 'Process' -and $Pat -eq 'OjEyMzQ1' -and $Acct -eq 'https://dev.azure.com/mydemos' + } + } + } + + Context 'Set-VSTeamAccount profile and drive' { + Mock _isOnWindows { return $false } + Mock _setEnvironmentVariables + Mock Set-VSTeamAPIVersion + Mock Write-Output -Verifiable + Mock Get-VSTeamProfile { return $contents | ConvertFrom-Json | ForEach-Object { $_ } } + + It 'should set env at process level' { + Set-VSTeamAccount -Profile mydemos -Drive mydemos + + Assert-VerifiableMock + + Assert-MockCalled Set-VSTeamAPIVersion -Exactly -Scope It -Times 1 -ParameterFilter { + $Target -eq 'VSTS' + } + + # Make sure set env vars was called with the correct parameters + Assert-MockCalled _setEnvironmentVariables -Exactly -Scope It -Times 1 -ParameterFilter { + $Level -eq 'Process' -and $Pat -eq 'OjEyMzQ1' -and $Acct -eq 'https://dev.azure.com/mydemos' + } + } + } + + Context 'Set-VSTeamAccount vsts' { + Mock _isOnWindows { return $false } + Mock _setEnvironmentVariables + Mock Set-VSTeamAPIVersion + + It 'should set env at process level' { + Set-VSTeamAccount -a mydemos -pe 12345 -Version VSTS + + Assert-MockCalled Set-VSTeamAPIVersion -Exactly -Scope It -Times 1 -ParameterFilter { + $Target -eq 'VSTS' + } + + # Make sure set env vars was called with the correct parameters + Assert-MockCalled _setEnvironmentVariables -Exactly -Scope It -Times 1 -ParameterFilter { + $Level -eq 'Process' -and $Pat -eq 'OjEyMzQ1' -and $Acct -eq 'https://dev.azure.com/mydemos' + } + } + } + + Context 'Set-VSTeamAccount vsts (old URL)' { + Mock _isOnWindows { return $false } + Mock _setEnvironmentVariables + Mock Set-VSTeamAPIVersion + + It 'should set env at process level' { + Set-VSTeamAccount -a https://mydemos.visualstudio.com -pe 12345 -Version VSTS + + Assert-MockCalled Set-VSTeamAPIVersion -Exactly -Scope It -Times 1 -ParameterFilter { + $Target -eq 'VSTS' + } + + # Make sure set env vars was called with the correct parameters + Assert-MockCalled _setEnvironmentVariables -Exactly -Scope It -Times 1 -ParameterFilter { + $Level -eq 'Process' -and $Pat -eq 'OjEyMzQ1' -and $Acct -eq 'https://dev.azure.com/mydemos' + } + } + } + + Context 'Set-VSTeamAccount vsts OAuth' { + Mock _isOnWindows { return $false } + Mock _setEnvironmentVariables + Mock Set-VSTeamAPIVersion + + It 'should set env at process level' { + Set-VSTeamAccount -a mydemos -pe 12345 -Version VSTS -UseBearerToken + + Assert-MockCalled Set-VSTeamAPIVersion -Exactly -Scope It -Times 1 -ParameterFilter { + $Target -eq 'VSTS' + } + + # Make sure set env vars was called with the correct parameters + Assert-MockCalled _setEnvironmentVariables -Exactly -Scope It -Times 1 -ParameterFilter { + $Level -eq 'Process' -and $Pat -eq '' -and $BearerToken -eq 12345 -and $Acct -eq 'https://dev.azure.com/mydemos' + } + } + } + + Context 'Set-VSTeamAccount vsts with securePersonalAccessToken' { + Mock _isOnWindows { return $false } + Mock _setEnvironmentVariables + Mock Set-VSTeamAPIVersion + + It 'should set env at process level' { + $password = '12345' | ConvertTo-SecureString -AsPlainText -Force + + Set-VSTeamAccount -a mydemos -SecurePersonalAccessToken $password -Version VSTS + + Assert-MockCalled Set-VSTeamAPIVersion -Exactly -Scope It -Times 1 -ParameterFilter { + $Target -eq 'VSTS' + } + + # Make sure set env vars was called with the correct parameters + Assert-MockCalled _setEnvironmentVariables -Exactly -Scope It -Times 1 -ParameterFilter { + $Level -eq 'Process' -and $Pat -eq 'OjEyMzQ1' -and $Acct -eq 'https://dev.azure.com/mydemos' + } + } + } + + Context 'Set-VSTeamAccount run as administrator' { + # I have to write both test just in case the actually + # start the PowerShell window as Admin or not. If I + # don't write both of these I will get different code + # coverage depending on if I started the PowerShell session + # as admin or not. + Mock _isOnWindows { return $true } + Mock _testAdministrator { return $true } + Mock Set-VSTeamAPIVersion + Mock _setEnvironmentVariables + + It 'should set env at process level' { + Set-VSTeamAccount -a mydemos -pe 12345 + + Assert-MockCalled Set-VSTeamAPIVersion -Exactly -Scope It -Times 1 -ParameterFilter { + $Target -eq 'VSTS' + } + + # Make sure set env vars was called with the correct parameters + Assert-MockCalled _setEnvironmentVariables -Exactly -Scope It -Times 1 -ParameterFilter { + $Level -eq 'Process' -and $Pat -eq 'OjEyMzQ1' -and $Acct -eq 'https://dev.azure.com/mydemos' + } + } + } + + Context 'Set-VSTeamAccount run as normal user' { + # I have to write both test just in case the actually + # start the PowerShell window as Admin or not. If I + # don't write both of these I will get different code + # coverage depending on if I started the PowerShell session + # as admin or not. + Mock _isOnWindows { return $false } + Mock _testAdministrator { return $false } + Mock Set-VSTeamAPIVersion + Mock _setEnvironmentVariables + + It 'should set env at process level' { + Set-VSTeamAccount -a mydemos -pe 12345 + + Assert-MockCalled Set-VSTeamAPIVersion -Exactly -Scope It -Times 1 -ParameterFilter { + $Target -eq 'VSTS' + } + + # Make sure set env vars was called with the correct parameters + Assert-MockCalled _setEnvironmentVariables -Exactly -Scope It -Times 1 -ParameterFilter { + $Level -eq 'Process' -and $Pat -eq 'OjEyMzQ1' -and $Acct -eq 'https://dev.azure.com/mydemos' + } + } + } + + Context 'Set-VSTeamAccount TFS from windows' { + # I have to write both test just in case the actually + # start the PowerShell window as Admin or not. If I + # don't write both of these I will get different code + # coverage depending on if I started the PowerShell session + # as admin or not. + Mock _isOnWindows { return $true } + Mock _testAdministrator { return $false } + Mock Set-VSTeamAPIVersion + Mock _setEnvironmentVariables + + It 'should set env at process level' { + Set-VSTeamAccount -a http://localhost:8080/tfs/defaultcollection -UseWindowsAuthentication + + Assert-MockCalled Set-VSTeamAPIVersion -Exactly -Scope It -Times 1 -ParameterFilter { + $Target -eq 'TFS2017' + } + + # Make sure set env vars was called with the correct parameters + Assert-MockCalled _setEnvironmentVariables -Exactly -Scope It -Times 1 -ParameterFilter { + $Level -eq 'Process' -and $Acct -eq 'http://localhost:8080/tfs/defaultcollection' + } + } + } + + Context 'Set-VSTeamAccount TFS' { + # I have to write both test just in case the actually + # start the PowerShell window as Admin or not. If I + # don't write both of these I will get different code + # coverage depending on if I started the PowerShell session + # as admin or not. + Mock _isOnWindows { return $false } + Mock _testAdministrator { return $false } + Mock Set-VSTeamAPIVersion + Mock _setEnvironmentVariables + + It 'should set env at process level' { + Set-VSTeamAccount -a http://localhost:8080/tfs/defaultcollection -pe 12345 + + Assert-MockCalled Set-VSTeamAPIVersion -Exactly -Scope It -Times 1 -ParameterFilter { + $Target -eq 'TFS2017' + } + + # Make sure set env vars was called with the correct parameters + Assert-MockCalled _setEnvironmentVariables -Exactly -Scope It -Times 1 -ParameterFilter { + $Level -eq 'Process' -and $Pat -eq 'OjEyMzQ1' -and $Acct -eq 'http://localhost:8080/tfs/defaultcollection' + } + } + } + + Context 'Set-VSTeamAccount at user level on Windows machine' { + # This is only supported on a Windows machine. So we have + # to Mock the call to _isOnWindows so you can develop on a + # Mac or Linux machine. + Mock _isOnWindows { return $true } + + # Have to Mock this because you can't call + # [Security.Principal.WindowsIdentity]::GetCurrent() + # on Mac and Linux + Mock _testAdministrator { return $false } + Mock _setEnvironmentVariables + Mock Set-VSTeamAPIVersion + + It 'should set env at user level' { + Set-VSTeamAccount -a mydemos -pe 12345 -Level User + + Assert-MockCalled Set-VSTeamAPIVersion -Exactly -Scope It -Times 1 -ParameterFilter { + $Target -eq 'VSTS' + } + + # Make sure set env vars was called with the correct parameters + Assert-MockCalled _setEnvironmentVariables -Exactly -Scope It -Times 1 -ParameterFilter { + $Level -eq 'User' -and $Pat -eq 'OjEyMzQ1' -and $Acct -eq 'https://dev.azure.com/mydemos' + } + } + } } \ No newline at end of file diff --git a/unit/test/Set-VSTeamAlias.Tests.ps1 b/unit/test/Set-VSTeamAlias.Tests.ps1 new file mode 100644 index 000000000..a2d83a47c --- /dev/null +++ b/unit/test/Set-VSTeamAlias.Tests.ps1 @@ -0,0 +1,785 @@ +Set-StrictMode -Version Latest + +#region include +$here = Split-Path -Parent $MyInvocation.MyCommand.Path +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") + +. "$here/../../Source/Public/$sut" +#endregion + +Describe "VSTeamAlias" { + Context "Set-VSTeamAlias" { + Set-VSTeamAlias -Force + + It "Should set ata for Set-VSTeamAccount" { + $actual = Get-Alias ata + + $actual.Name | Should be 'ata' + $actual.Definition | Should be 'Set-VSTeamAccount' + } + + It "Should set sta for Set-VSTeamAccount" { + $actual = Get-Alias sta + + $actual.Name | Should be 'sta' + $actual.Definition | Should be 'Set-VSTeamAccount' + } + + It "Should set gti for Get-VSTeamInfo" { + $actual = Get-Alias gti + + $actual.Name | Should be 'gti' + $actual.Definition | Should be 'Get-VSTeamInfo' + } + + It "Should set ivr for Invoke-VSTeamRequest" { + $actual = Get-Alias ivr + + $actual.Name | Should be 'ivr' + $actual.Definition | Should be 'Invoke-VSTeamRequest' + } + + It "Should set Get-ServiceEndpoint for Get-VSTeamServiceEndpoint" { + $actual = Get-Alias Get-ServiceEndpoint + + $actual.Name | Should be 'Get-ServiceEndpoint' + $actual.Definition | Should be 'Get-VSTeamServiceEndpoint' + } + + It "Should set Add-AzureRMServiceEndpoint for Add-VSTeamAzureRMServiceEndpoint" { + $actual = Get-Alias Add-AzureRMServiceEndpoint + + $actual.Name | Should be 'Add-AzureRMServiceEndpoint' + $actual.Definition | Should be 'Add-VSTeamAzureRMServiceEndpoint' + } + + It "Should set Remove-ServiceEndpoint for Remove-VSTeamServiceEndpoint" { + $actual = Get-Alias Remove-ServiceEndpoint + + $actual.Name | Should be 'Remove-ServiceEndpoint' + $actual.Definition | Should be 'Remove-VSTeamServiceEndpoint' + } + + It "Should set Add-SonarQubeEndpoint for Add-VSTeamSonarQubeEndpoint" { + $actual = Get-Alias Add-SonarQubeEndpoint + + $actual.Name | Should be 'Add-SonarQubeEndpoint' + $actual.Definition | Should be 'Add-VSTeamSonarQubeEndpoint' + } + + It "Should set Add-KubernetesEndpoint for Add-VSTeamKubernetesEndpoint" { + $actual = Get-Alias Add-KubernetesEndpoint + + $actual.Name | Should be 'Add-KubernetesEndpoint' + $actual.Definition | Should be 'Add-VSTeamKubernetesEndpoint' + } + + It "Should set Add-ServiceEndpoint for Add-VSTeamServiceEndpoint" { + $actual = Get-Alias Add-ServiceEndpoint + + $actual.Name | Should be 'Add-ServiceEndpoint' + $actual.Definition | Should be 'Add-VSTeamServiceEndpoint' + } + + It "Should set Update-ServiceEndpoint for Update-VSTeamServiceEndpoint" { + $actual = Get-Alias Update-ServiceEndpoint + + $actual.Name | Should be 'Update-ServiceEndpoint' + $actual.Definition | Should be 'Update-VSTeamServiceEndpoint' + } + + It "Should set Add-ServiceFabricEndpoint for Add-VSTeamServiceFabricEndpoint" { + $actual = Get-Alias Add-ServiceFabricEndpoint + + $actual.Name | Should be 'Add-ServiceFabricEndpoint' + $actual.Definition | Should be 'Add-VSTeamServiceFabricEndpoint' + } + + It "Should set Remove-ServiceFabricEndpoint for Remove-VSTeamServiceFabricEndpoint" { + $actual = Get-Alias Remove-ServiceFabricEndpoint + + $actual.Name | Should be 'Remove-ServiceFabricEndpoint' + $actual.Definition | Should be 'Remove-VSTeamServiceFabricEndpoint' + } + + It "Should set Remove-AzureRMServiceEndpoint for Remove-VSTeamAzureRMServiceEndpoint" { + $actual = Get-Alias Remove-AzureRMServiceEndpoint + + $actual.Name | Should be 'Remove-AzureRMServiceEndpoint' + $actual.Definition | Should be 'Remove-VSTeamAzureRMServiceEndpoint' + } + + It "Should set Remove-SonarQubeEndpoint for Remove-VSTeamSonarQubeEndpoint" { + $actual = Get-Alias Remove-SonarQubeEndpoint + + $actual.Name | Should be 'Remove-SonarQubeEndpoint' + $actual.Definition | Should be 'Remove-VSTeamSonarQubeEndpoint' + } + + It "Should set Get-Build for Get-VSTeamBuild" { + $actual = Get-Alias Get-Build + + $actual.Name | Should be 'Get-Build' + $actual.Definition | Should be 'Get-VSTeamBuild' + } + + It "Should set Show-Build for Show-VSTeamBuild" { + $actual = Get-Alias Show-Build + + $actual.Name | Should be 'Show-Build' + $actual.Definition | Should be 'Show-VSTeamBuild' + } + + It "Should set Get-BuildLog for Get-VSTeamBuildLog" { + $actual = Get-Alias Get-BuildLog + + $actual.Name | Should be 'Get-BuildLog' + $actual.Definition | Should be 'Get-VSTeamBuildLog' + } + + It "Should set Get-BuildTag for Get-VSTeamBuildTag" { + $actual = Get-Alias Get-BuildTag + + $actual.Name | Should be 'Get-BuildTag' + $actual.Definition | Should be 'Get-VSTeamBuildTag' + } + + It "Should set Get-BuildArtifact for Get-VSTeamBuildArtifact" { + $actual = Get-Alias Get-BuildArtifact + + $actual.Name | Should be 'Get-BuildArtifact' + $actual.Definition | Should be 'Get-VSTeamBuildArtifact' + } + + It "Should set Add-Build for Add-VSTeamBuild" { + $actual = Get-Alias Add-Build + + $actual.Name | Should be 'Add-Build' + $actual.Definition | Should be 'Add-VSTeamBuild' + } + + It "Should set Add-BuildTag for Add-VSTeamBuildTag" { + $actual = Get-Alias Add-BuildTag + + $actual.Name | Should be 'Add-BuildTag' + $actual.Definition | Should be 'Add-VSTeamBuildTag' + } + + It "Should set Remove-Build for Remove-VSTeamBuild" { + $actual = Get-Alias Remove-Build + + $actual.Name | Should be 'Remove-Build' + $actual.Definition | Should be 'Remove-VSTeamBuild' + } + + It "Should set Remove-BuildTag for Remove-VSTeamBuildTag" { + $actual = Get-Alias Remove-BuildTag + + $actual.Name | Should be 'Remove-BuildTag' + $actual.Definition | Should be 'Remove-VSTeamBuildTag' + } + + It "Should set Update-Build for Update-VSTeamBuild" { + $actual = Get-Alias Update-Build + + $actual.Name | Should be 'Update-Build' + $actual.Definition | Should be 'Update-VSTeamBuild' + } + + It "Should set Get-BuildDefinition for Get-VSTeamBuildDefinition" { + $actual = Get-Alias Get-BuildDefinition + + $actual.Name | Should be 'Get-BuildDefinition' + $actual.Definition | Should be 'Get-VSTeamBuildDefinition' + } + + It "Should set Add-BuildDefinition for Add-VSTeamBuildDefinition" { + $actual = Get-Alias Add-BuildDefinition + + $actual.Name | Should be 'Add-BuildDefinition' + $actual.Definition | Should be 'Add-VSTeamBuildDefinition' + } + + It "Should set Show-BuildDefinition for Show-VSTeamBuildDefinition" { + $actual = Get-Alias Show-BuildDefinition + + $actual.Name | Should be 'Show-BuildDefinition' + $actual.Definition | Should be 'Show-VSTeamBuildDefinition' + } + + It "Should set Remove-BuildDefinition for Remove-VSTeamBuildDefinition" { + $actual = Get-Alias Remove-BuildDefinition + + $actual.Name | Should be 'Remove-BuildDefinition' + $actual.Definition | Should be 'Remove-VSTeamBuildDefinition' + } + + It "Should set Show-Approval for Show-VSTeamApproval" { + $actual = Get-Alias Show-Approval + + $actual.Name | Should be 'Show-Approval' + $actual.Definition | Should be 'Show-VSTeamApproval' + } + + It "Should set Get-Approval for Get-VSTeamApproval" { + $actual = Get-Alias Get-Approval + + $actual.Name | Should be 'Get-Approval' + $actual.Definition | Should be 'Get-VSTeamApproval' + } + + It "Should set Set-Approval for Set-VSTeamApproval" { + $actual = Get-Alias Set-Approval + + $actual.Name | Should be 'Set-Approval' + $actual.Definition | Should be 'Set-VSTeamApproval' + } + + It "Should set Get-CloudSubscription for Get-VSTeamCloudSubscription" { + $actual = Get-Alias Get-CloudSubscription + + $actual.Name | Should be 'Get-CloudSubscription' + $actual.Definition | Should be 'Get-VSTeamCloudSubscription' + } + + It "Should set Get-GitRepository for Get-VSTeamGitRepository" { + $actual = Get-Alias Get-GitRepository + + $actual.Name | Should be 'Get-GitRepository' + $actual.Definition | Should be 'Get-VSTeamGitRepository' + } + + It "Should set Show-GitRepository for Show-VSTeamGitRepository" { + $actual = Get-Alias Show-GitRepository + + $actual.Name | Should be 'Show-GitRepository' + $actual.Definition | Should be 'Show-VSTeamGitRepository' + } + + It "Should set Add-GitRepository for Add-VSTeamGitRepository" { + $actual = Get-Alias Add-GitRepository + + $actual.Name | Should be 'Add-GitRepository' + $actual.Definition | Should be 'Add-VSTeamGitRepository' + } + + It "Should set Remove-GitRepository for Remove-VSTeamGitRepository" { + $actual = Get-Alias Remove-GitRepository + + $actual.Name | Should be 'Remove-GitRepository' + $actual.Definition | Should be 'Remove-VSTeamGitRepository' + } + + It "Should set Get-Pool for Get-VSTeamPool" { + $actual = Get-Alias Get-Pool + + $actual.Name | Should be 'Get-Pool' + $actual.Definition | Should be 'Get-VSTeamPool' + } + + It "Should set Get-Project for Get-VSTeamProject" { + $actual = Get-Alias Get-Project + + $actual.Name | Should be 'Get-Project' + $actual.Definition | Should be 'Get-VSTeamProject' + } + + It "Should set Show-Project for Show-VSTeamProject" { + $actual = Get-Alias Show-Project + + $actual.Name | Should be 'Show-Project' + $actual.Definition | Should be 'Show-VSTeamProject' + } + + It "Should set Update-Project for Update-VSTeamProject" { + $actual = Get-Alias Update-Project + + $actual.Name | Should be 'Update-Project' + $actual.Definition | Should be 'Update-VSTeamProject' + } + + It "Should set Add-Project for Add-VSTeamProject" { + $actual = Get-Alias Add-Project + + $actual.Name | Should be 'Add-Project' + $actual.Definition | Should be 'Add-VSTeamProject' + } + + It "Should set Remove-Project for Remove-VSTeamProject" { + $actual = Get-Alias Remove-Project + + $actual.Name | Should be 'Remove-Project' + $actual.Definition | Should be 'Remove-VSTeamProject' + } + + It "Should set Get-Queue for Get-VSTeamQueue" { + $actual = Get-Alias Get-Queue + + $actual.Name | Should be 'Get-Queue' + $actual.Definition | Should be 'Get-VSTeamQueue' + } + + It "Should set Get-ReleaseDefinition for Get-VSTeamReleaseDefinition" { + $actual = Get-Alias Get-ReleaseDefinition + + $actual.Name | Should be 'Get-ReleaseDefinition' + $actual.Definition | Should be 'Get-VSTeamReleaseDefinition' + } + + It "Should set Show-ReleaseDefinition for Show-VSTeamReleaseDefinition" { + $actual = Get-Alias Show-ReleaseDefinition + + $actual.Name | Should be 'Show-ReleaseDefinition' + $actual.Definition | Should be 'Show-VSTeamReleaseDefinition' + } + + It "Should set Add-ReleaseDefinition for Add-VSTeamReleaseDefinition" { + $actual = Get-Alias Add-ReleaseDefinition + + $actual.Name | Should be 'Add-ReleaseDefinition' + $actual.Definition | Should be 'Add-VSTeamReleaseDefinition' + } + + It "Should set Remove-ReleaseDefinition for Remove-VSTeamReleaseDefinition" { + $actual = Get-Alias Remove-ReleaseDefinition + + $actual.Name | Should be 'Remove-ReleaseDefinition' + $actual.Definition | Should be 'Remove-VSTeamReleaseDefinition' + } + + It "Should set Get-Release for Get-VSTeamRelease" { + $actual = Get-Alias Get-Release + + $actual.Name | Should be 'Get-Release' + $actual.Definition | Should be 'Get-VSTeamRelease' + } + + It "Should set Show-Release for Show-VSTeamRelease" { + $actual = Get-Alias Show-Release + + $actual.Name | Should be 'Show-Release' + $actual.Definition | Should be 'Show-VSTeamRelease' + } + + It "Should set Add-Release for Add-VSTeamRelease" { + $actual = Get-Alias Add-Release + + $actual.Name | Should be 'Add-Release' + $actual.Definition | Should be 'Add-VSTeamRelease' + } + + It "Should set Remove-Release for Remove-VSTeamRelease" { + $actual = Get-Alias Remove-Release + + $actual.Name | Should be 'Remove-Release' + $actual.Definition | Should be 'Remove-VSTeamRelease' + } + + It "Should set Set-ReleaseStatus for Set-VSTeamReleaseStatus" { + $actual = Get-Alias Set-ReleaseStatus + + $actual.Name | Should be 'Set-ReleaseStatus' + $actual.Definition | Should be 'Set-VSTeamReleaseStatus' + } + + It "Should set Add-ReleaseEnvironment for Add-VSTeamReleaseEnvironment" { + $actual = Get-Alias Add-ReleaseEnvironment + + $actual.Name | Should be 'Add-ReleaseEnvironment' + $actual.Definition | Should be 'Add-VSTeamReleaseEnvironment' + } + + It "Should set Get-TeamInfo for Get-VSTeamInfo" { + $actual = Get-Alias Get-TeamInfo + + $actual.Name | Should be 'Get-TeamInfo' + $actual.Definition | Should be 'Get-VSTeamInfo' + } + + It "Should set Add-TeamAccount for Set-VSTeamAccount" { + $actual = Get-Alias Add-TeamAccount + + $actual.Name | Should be 'Add-TeamAccount' + $actual.Definition | Should be 'Set-VSTeamAccount' + } + + It "Should set Remove-TeamAccount for Remove-VSTeamAccount" { + $actual = Get-Alias Remove-TeamAccount + + $actual.Name | Should be 'Remove-TeamAccount' + $actual.Definition | Should be 'Remove-VSTeamAccount' + } + + It "Should set Get-TeamOption for Get-VSTeamOption" { + $actual = Get-Alias Get-TeamOption + + $actual.Name | Should be 'Get-TeamOption' + $actual.Definition | Should be 'Get-VSTeamOption' + } + + It "Should set Get-TeamResourceArea for Get-VSTeamResourceArea" { + $actual = Get-Alias Get-TeamResourceArea + + $actual.Name | Should be 'Get-TeamResourceArea' + $actual.Definition | Should be 'Get-VSTeamResourceArea' + } + + It "Should set Clear-DefaultProject for Clear-VSTeamDefaultProject" { + $actual = Get-Alias Clear-DefaultProject + + $actual.Name | Should be 'Clear-DefaultProject' + $actual.Definition | Should be 'Clear-VSTeamDefaultProject' + } + + It "Should set Set-DefaultProject for Set-VSTeamDefaultProject" { + $actual = Get-Alias Set-DefaultProject + + $actual.Name | Should be 'Set-DefaultProject' + $actual.Definition | Should be 'Set-VSTeamDefaultProject' + } + + It "Should set Get-TeamMember for Get-VSTeamMember" { + $actual = Get-Alias Get-TeamMember + + $actual.Name | Should be 'Get-TeamMember' + $actual.Definition | Should be 'Get-VSTeamMember' + } + + It "Should set Get-Team for Get-VSTeam" { + $actual = Get-Alias Get-Team + + $actual.Name | Should be 'Get-Team' + $actual.Definition | Should be 'Get-VSTeam' + } + + It "Should set Add-Team for Add-VSTeam" { + $actual = Get-Alias Add-Team + + $actual.Name | Should be 'Add-Team' + $actual.Definition | Should be 'Add-VSTeam' + } + + It "Should set Update-Team for Update-VSTeam" { + $actual = Get-Alias Update-Team + + $actual.Name | Should be 'Update-Team' + $actual.Definition | Should be 'Update-VSTeam' + } + + It "Should set Remove-Team for Remove-VSTeam" { + $actual = Get-Alias Remove-Team + + $actual.Name | Should be 'Remove-Team' + $actual.Definition | Should be 'Remove-VSTeam' + } + + It "Should set Add-Profile for Add-VSTeamProfile" { + $actual = Get-Alias Add-Profile + + $actual.Name | Should be 'Add-Profile' + $actual.Definition | Should be 'Add-VSTeamProfile' + } + + It "Should set Remove-Profile for Remove-VSTeamProfile" { + $actual = Get-Alias Remove-Profile + + $actual.Name | Should be 'Remove-Profile' + $actual.Definition | Should be 'Remove-VSTeamProfile' + } + + It "Should set Get-Profile for Get-VSTeamProfile" { + $actual = Get-Alias Get-Profile + + $actual.Name | Should be 'Get-Profile' + $actual.Definition | Should be 'Get-VSTeamProfile' + } + + It "Should set Set-APIVersion for Set-VSTeamAPIVersion" { + $actual = Get-Alias Set-APIVersion + + $actual.Name | Should be 'Set-APIVersion' + $actual.Definition | Should be 'Set-VSTeamAPIVersion' + } + + It "Should set Add-UserEntitlement for Add-VSTeamUserEntitlement" { + $actual = Get-Alias Add-UserEntitlement + + $actual.Name | Should be 'Add-UserEntitlement' + $actual.Definition | Should be 'Add-VSTeamUserEntitlement' + } + + It "Should set Remove-UserEntitlement for Remove-VSTeamUserEntitlement" { + $actual = Get-Alias Remove-UserEntitlement + + $actual.Name | Should be 'Remove-UserEntitlement' + $actual.Definition | Should be 'Remove-VSTeamUserEntitlement' + } + + It "Should set Get-UserEntitlement for Get-VSTeamUserEntitlement" { + $actual = Get-Alias Get-UserEntitlement + + $actual.Name | Should be 'Get-UserEntitlement' + $actual.Definition | Should be 'Get-VSTeamUserEntitlement' + } + + It "Should set Update-UserEntitlement for Update-VSTeamUserEntitlement" { + $actual = Get-Alias Update-UserEntitlement + + $actual.Name | Should be 'Update-UserEntitlement' + $actual.Definition | Should be 'Update-VSTeamUserEntitlement' + } + + It "Should set Set-EnvironmentStatus for Set-VSTeamEnvironmentStatus" { + $actual = Get-Alias Set-EnvironmentStatus + + $actual.Name | Should be 'Set-EnvironmentStatus' + $actual.Definition | Should be 'Set-VSTeamEnvironmentStatus' + } + + It "Should set Get-ServiceEndpointType for Get-VSTeamServiceEndpointType" { + $actual = Get-Alias Get-ServiceEndpointType + + $actual.Name | Should be 'Get-ServiceEndpointType' + $actual.Definition | Should be 'Get-VSTeamServiceEndpointType' + } + + It "Should set Update-BuildDefinition for Update-VSTeamBuildDefinition" { + $actual = Get-Alias Update-BuildDefinition + + $actual.Name | Should be 'Update-BuildDefinition' + $actual.Definition | Should be 'Update-VSTeamBuildDefinition' + } + + It "Should set Get-TfvcRootBranch for Get-VSTeamTfvcRootBranch" { + $actual = Get-Alias Get-TfvcRootBranch + + $actual.Name | Should be 'Get-TfvcRootBranch' + $actual.Definition | Should be 'Get-VSTeamTfvcRootBranch' + } + + It "Should set Get-TfvcBranch for Get-VSTeamTfvcBranch" { + $actual = Get-Alias Get-TfvcBranch + + $actual.Name | Should be 'Get-TfvcBranch' + $actual.Definition | Should be 'Get-VSTeamTfvcBranch' + } + + It "Should set Get-WorkItemType for Get-VSTeamWorkItemType" { + $actual = Get-Alias Get-WorkItemType + + $actual.Name | Should be 'Get-WorkItemType' + $actual.Definition | Should be 'Get-VSTeamWorkItemType' + } + + It "Should set Add-WorkItem for Add-VSTeamWorkItem" { + $actual = Get-Alias Add-WorkItem + + $actual.Name | Should be 'Add-WorkItem' + $actual.Definition | Should be 'Add-VSTeamWorkItem' + } + + It "Should set Get-WorkItem for Get-VSTeamWorkItem" { + $actual = Get-Alias Get-WorkItem + + $actual.Name | Should be 'Get-WorkItem' + $actual.Definition | Should be 'Get-VSTeamWorkItem' + } + + It "Should set Remove-WorkItem for Remove-VSTeamWorkItem" { + $actual = Get-Alias Remove-WorkItem + + $actual.Name | Should be 'Remove-WorkItem' + $actual.Definition | Should be 'Remove-VSTeamWorkItem' + } + + It "Should set Show-WorkItem for Show-VSTeamWorkItem" { + $actual = Get-Alias Show-WorkItem + + $actual.Name | Should be 'Show-WorkItem' + $actual.Definition | Should be 'Show-VSTeamWorkItem' + } + + It "Should set Get-Policy for Get-VSTeamPolicy" { + $actual = Get-Alias Get-Policy + + $actual.Name | Should be 'Get-Policy' + $actual.Definition | Should be 'Get-VSTeamPolicy' + } + + It "Should set Get-PolicyType for Get-VSTeamPolicyType" { + $actual = Get-Alias Get-PolicyType + + $actual.Name | Should be 'Get-PolicyType' + $actual.Definition | Should be 'Get-VSTeamPolicyType' + } + + It "Should set Add-Policy for Add-VSTeamPolicy" { + $actual = Get-Alias Add-Policy + + $actual.Name | Should be 'Add-Policy' + $actual.Definition | Should be 'Add-VSTeamPolicy' + } + + It "Should set Update-Policy for Update-VSTeamPolicy" { + $actual = Get-Alias Update-Policy + + $actual.Name | Should be 'Update-Policy' + $actual.Definition | Should be 'Update-VSTeamPolicy' + } + + It "Should set Remove-Policy for Remove-VSTeamPolicy" { + $actual = Get-Alias Remove-Policy + + $actual.Name | Should be 'Remove-Policy' + $actual.Definition | Should be 'Remove-VSTeamPolicy' + } + + It "Should set Get-GitRef for Get-VSTeamGitRef" { + $actual = Get-Alias Get-GitRef + + $actual.Name | Should be 'Get-GitRef' + $actual.Definition | Should be 'Get-VSTeamGitRef' + } + + It "Should set Get-Agent for Get-VSTeamAgent" { + $actual = Get-Alias Get-Agent + + $actual.Name | Should be 'Get-Agent' + $actual.Definition | Should be 'Get-VSTeamAgent' + } + + It "Should set Remove-Agent for Remove-VSTeamAgent" { + $actual = Get-Alias Remove-Agent + + $actual.Name | Should be 'Remove-Agent' + $actual.Definition | Should be 'Remove-VSTeamAgent' + } + + It "Should set Enable-Agent for Enable-VSTeamAgent" { + $actual = Get-Alias Enable-Agent + + $actual.Name | Should be 'Enable-Agent' + $actual.Definition | Should be 'Enable-VSTeamAgent' + } + + It "Should set Disable-Agent for Disable-VSTeamAgent" { + $actual = Get-Alias Disable-Agent + + $actual.Name | Should be 'Disable-Agent' + $actual.Definition | Should be 'Disable-VSTeamAgent' + } + + It "Should set Update-Profile for Update-VSTeamProfile" { + $actual = Get-Alias Update-Profile + + $actual.Name | Should be 'Update-Profile' + $actual.Definition | Should be 'Update-VSTeamProfile' + } + + It "Should set Get-APIVersion for Get-VSTeamAPIVersion" { + $actual = Get-Alias Get-APIVersion + + $actual.Name | Should be 'Get-APIVersion' + $actual.Definition | Should be 'Get-VSTeamAPIVersion' + } + + It "Should set Add-NuGetEndpoint for Add-VSTeamNuGetEndpoint" { + $actual = Get-Alias Add-NuGetEndpoint + + $actual.Name | Should be 'Add-NuGetEndpoint' + $actual.Definition | Should be 'Add-VSTeamNuGetEndpoint' + } + + It "Should set Get-Feed for Get-VSTeamFeed" { + $actual = Get-Alias Get-Feed + + $actual.Name | Should be 'Get-Feed' + $actual.Definition | Should be 'Get-VSTeamFeed' + } + + It "Should set Add-Feed for Add-VSTeamFeed" { + $actual = Get-Alias Add-Feed + + $actual.Name | Should be 'Add-Feed' + $actual.Definition | Should be 'Add-VSTeamFeed' + } + + It "Should set Show-Feed for Show-VSTeamFeed" { + $actual = Get-Alias Show-Feed + + $actual.Name | Should be 'Show-Feed' + $actual.Definition | Should be 'Show-VSTeamFeed' + } + + It "Should set Remove-Feed for Remove-VSTeamFeed" { + $actual = Get-Alias Remove-Feed + + $actual.Name | Should be 'Remove-Feed' + $actual.Definition | Should be 'Remove-VSTeamFeed' + } + + It "Should set Get-PullRequest for Get-VSTeamPullRequest" { + $actual = Get-Alias Get-PullRequest + + $actual.Name | Should be 'Get-PullRequest' + $actual.Definition | Should be 'Get-VSTeamPullRequest' + } + + It "Should set Show-PullRequest for Show-VSTeamPullRequest" { + $actual = Get-Alias Show-PullRequest + + $actual.Name | Should be 'Show-PullRequest' + $actual.Definition | Should be 'Show-VSTeamPullRequest' + } + + It "Should set Add-Extension for Add-VSTeamExtension" { + $actual = Get-Alias Add-Extension + + $actual.Name | Should be 'Add-Extension' + $actual.Definition | Should be 'Add-VSTeamExtension' + } + + It "Should set Get-Extension for Get-VSTeamExtension" { + $actual = Get-Alias Get-Extension + + $actual.Name | Should be 'Get-Extension' + $actual.Definition | Should be 'Get-VSTeamExtension' + } + + It "Should set Update-Extension for Update-VSTeamExtension" { + $actual = Get-Alias Update-Extension + + $actual.Name | Should be 'Update-Extension' + $actual.Definition | Should be 'Update-VSTeamExtension' + } + + It "Should set Remove-Extension for Remove-VSTeamExtension" { + $actual = Get-Alias Remove-Extension + + $actual.Name | Should be 'Remove-Extension' + $actual.Definition | Should be 'Remove-VSTeamExtension' + } + + It "Should set Update-WorkItem for Update-VSTeamWorkItem" { + $actual = Get-Alias Update-WorkItem + + $actual.Name | Should be 'Update-WorkItem' + $actual.Definition | Should be 'Update-VSTeamWorkItem' + } + + It "Should set Get-JobRequest for Get-VSTeamJobRequest" { + $actual = Get-Alias Get-JobRequest + + $actual.Name | Should be 'Get-JobRequest' + $actual.Definition | Should be 'Get-VSTeamJobRequest' + } + + It "Should set Update-ReleaseDefinition for Update-VSTeamReleaseDefinition" { + $actual = Get-Alias Update-ReleaseDefinition + + $actual.Name | Should be 'Update-ReleaseDefinition' + $actual.Definition | Should be 'Update-VSTeamReleaseDefinition' + } + + } +} \ No newline at end of file diff --git a/unit/test/Set-VSTeamApproval.Tests.ps1 b/unit/test/Set-VSTeamApproval.Tests.ps1 index 70531dbb8..0e57b165a 100644 --- a/unit/test/Set-VSTeamApproval.Tests.ps1 +++ b/unit/test/Set-VSTeamApproval.Tests.ps1 @@ -1,14 +1,18 @@ Set-StrictMode -Version Latest +#region include $here = Split-Path -Parent $MyInvocation.MyCommand.Path $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/$sut" +#endregion -Describe 'Set-VSTeamApproval' -Tag 'unit', 'approvals' { +Describe 'VSTeamApproval' -Tag 'unit', 'approvals' { # Set the account to use for testing. A normal user would do this # using the Set-VSTeamAccount function. Mock _getInstance { return 'https://dev.azure.com/test' } @@ -18,9 +22,6 @@ Describe 'Set-VSTeamApproval' -Tag 'unit', 'approvals' { $Uri -like "*_apis/projects*" } - # Load the mocks to create the project name dynamic parameter - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" - Context 'Set-VSTeamApproval' { Mock Invoke-RestMethod { return @{ id = 1 diff --git a/unit/test/Set-VSTeamDefaultProject.Tests.ps1 b/unit/test/Set-VSTeamDefaultProject.Tests.ps1 index 5789c066c..06b3ebc4e 100644 --- a/unit/test/Set-VSTeamDefaultProject.Tests.ps1 +++ b/unit/test/Set-VSTeamDefaultProject.Tests.ps1 @@ -10,7 +10,11 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamDirectory.ps1" . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Classes/VSTeamProcessCache.ps1" +. "$here/../../Source/Classes/ProcessTemplateCompleter.ps1" +. "$here/../../Source/Classes/ProcessValidateAttribute.ps1" . "$here/../../Source/Classes/VSTeamUserEntitlement.ps1" . "$here/../../Source/Classes/VSTeamTeams.ps1" . "$here/../../Source/Classes/VSTeamRepositories.ps1" @@ -43,34 +47,31 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") #endregion Describe 'VSTeamProject' { - . "$PSScriptRoot\mocks\mockProjectNameDynamicParam.ps1" - . "$PSScriptRoot\mocks\mockProcessNameDynamicParam.ps1" - Mock _getInstance { return 'https://dev.azure.com/test' } Context 'Set-VSTeamDefaultProject' { AfterAll { - $Global:PSDefaultParameterValues.Remove("*:projectName") + $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") } It 'should set default project' { Set-VSTeamDefaultProject 'DefaultProject' - $Global:PSDefaultParameterValues['*:projectName'] | Should be 'DefaultProject' + $Global:PSDefaultParameterValues['*-vsteam*:projectName'] | Should be 'DefaultProject' } It 'should update default project' { - $Global:PSDefaultParameterValues['*:projectName'] = 'DefaultProject' + $Global:PSDefaultParameterValues['*-vsteam*:projectName'] = 'DefaultProject' Set-VSTeamDefaultProject -Project 'NextProject' - $Global:PSDefaultParameterValues['*:projectName'] | Should be 'NextProject' + $Global:PSDefaultParameterValues['*-vsteam*:projectName'] | Should be 'NextProject' } } Context 'Set-VSTeamDefaultProject on Non Windows' { AfterAll { - $Global:PSDefaultParameterValues.Remove("*:projectName") + $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") } Mock _isOnWindows { return $false } -Verifiable @@ -79,13 +80,13 @@ Describe 'VSTeamProject' { Set-VSTeamDefaultProject 'MyProject' Assert-VerifiableMock - $Global:PSDefaultParameterValues['*:projectName'] | Should be 'MyProject' + $Global:PSDefaultParameterValues['*-vsteam*:projectName'] | Should be 'MyProject' } } Context 'Set-VSTeamDefaultProject As Admin on Windows' { AfterAll { - $Global:PSDefaultParameterValues.Remove("*:projectName") + $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") } Mock _isOnWindows { return $true } @@ -95,7 +96,7 @@ Describe 'VSTeamProject' { Set-VSTeamDefaultProject 'MyProject' Assert-VerifiableMock - $Global:PSDefaultParameterValues['*:projectName'] | Should be 'MyProject' + $Global:PSDefaultParameterValues['*-vsteam*:projectName'] | Should be 'MyProject' } } } \ No newline at end of file diff --git a/unit/test/Set-VSTeamEnvironmentStatus.Tests.ps1 b/unit/test/Set-VSTeamEnvironmentStatus.Tests.ps1 index 6cb2d9711..c6df71b5d 100644 --- a/unit/test/Set-VSTeamEnvironmentStatus.Tests.ps1 +++ b/unit/test/Set-VSTeamEnvironmentStatus.Tests.ps1 @@ -10,6 +10,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamFeed.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Public/Get-VSTeamBuild.ps1" @@ -19,9 +21,7 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") Describe 'VSTeamReleaseStatus' { ## Arrange - [VSTeamVersions]::Release = '1.0-unittest' - - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" + Mock _getApiVersion { return '1.0-unittest' } -ParameterFilter { $Service -eq 'Release' } Mock _getInstance { return 'https://dev.azure.com/test' } diff --git a/unit/test/Set-VSTeamPermissionInheritance.Tests.ps1 b/unit/test/Set-VSTeamPermissionInheritance.Tests.ps1 index 57739d199..727427db5 100644 --- a/unit/test/Set-VSTeamPermissionInheritance.Tests.ps1 +++ b/unit/test/Set-VSTeamPermissionInheritance.Tests.ps1 @@ -1,24 +1,52 @@ Set-StrictMode -Version Latest +#region include Import-Module SHiPS $here = Split-Path -Parent $MyInvocation.MyCommand.Path $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +. "$here/../../Source/Classes/VSTeamLeaf.ps1" +. "$here/../../Source/Classes/VSTeamDirectory.ps1" . "$here/../../Source/Classes/VSTeamVersions.ps1" +. "$here/../../Source/Private/common.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" -. "$here/../../Source/Classes/VSTeamLeaf.ps1" +. "$here/../../Source/Classes/VSTeamUserEntitlement.ps1" +. "$here/../../Source/Classes/VSTeamTeams.ps1" +. "$here/../../Source/Classes/VSTeamRepositories.ps1" +. "$here/../../Source/Classes/VSTeamReleaseDefinitions.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" +. "$here/../../Source/Classes/UncachedProjectCompleter.ps1" +. "$here/../../Source/Classes/UncachedProjectValidateAttribute.ps1" . "$here/../../Source/Classes/VSTeamSecurityNamespace.ps1" . "$here/../../Source/Classes/VSTeamPermissionInheritance.ps1" -. "$here/../../Source/Private/common.ps1" +. "$here/../../Source/Classes/VSTeamTask.ps1" +. "$here/../../Source/Classes/VSTeamAttempt.ps1" +. "$here/../../Source/Classes/VSTeamEnvironment.ps1" +. "$here/../../Source/Classes/VSTeamRelease.ps1" +. "$here/../../Source/Classes/VSTeamReleases.ps1" +. "$here/../../Source/Classes/VSTeamBuild.ps1" +. "$here/../../Source/Classes/VSTeamBuilds.ps1" +. "$here/../../Source/Classes/VSTeamPool.ps1" +. "$here/../../Source/Classes/VSTeamQueue.ps1" +. "$here/../../Source/Classes/VSTeamQueues.ps1" +. "$here/../../Source/Classes/VSTeamBuildDefinitionProcessPhaseStep.ps1" +. "$here/../../Source/Classes/VSTeamBuildDefinitionProcessPhase.ps1" +. "$here/../../Source/Classes/VSTeamBuildDefinitionProcess.ps1" +. "$here/../../Source/Classes/VSTeamProject.ps1" +. "$here/../../Source/Classes/VSTeamGitRepository.ps1" +. "$here/../../Source/Classes/VSTeamBuildDefinition.ps1" +. "$here/../../Source/Classes/VSTeamBuildDefinitions.ps1" . "$here/../../Source/Public/Get-VSTeamProject.ps1" . "$here/../../Source/Public/Get-VSTeamBuildDefinition.ps1" . "$here/../../Source/Public/Get-VSTeamReleaseDefinition.ps1" . "$here/../../Source/Public/Get-VSTeamGitRepository.ps1" . "$here/../../Source/Public/Get-VSTeamAccessControlList.ps1" . "$here/../../Source/Public/$sut" +#endregion -Describe 'Set-VSTeamPermissionInheritance' { +Describe 'VSTeamPermissionInheritance' { $gitRepoResult = Get-Content "$PSScriptRoot\sampleFiles\singleGitRepo.json" -Raw | ConvertFrom-Json $buildDefresults = Get-Content "$PSScriptRoot\sampleFiles\buildDefAzD.json" -Raw | ConvertFrom-Json $releaseDefresults = Get-Content "$PSScriptRoot\sampleFiles\releaseDefAzD.json" -Raw | ConvertFrom-Json @@ -45,10 +73,22 @@ Describe 'Set-VSTeamPermissionInheritance' { # Mock the call to Get-Projects by the dynamic parameter for ProjectName Mock Invoke-RestMethod { return @() } -ParameterFilter { $Uri -like "*_apis/projects*" } + Mock _callAPI { return $singleResult } -ParameterFilter { + $Area -eq 'projects' -and + $id -eq 'project' -and + $Version -eq "$(_getApiVersion Core)" -and + $IgnoreDefaultProject -eq $true + } + + Mock _useWindowsAuthenticationOnPremise { return $true } + Context 'Set-VSTeamPermissionInheritance buildDef' { - Mock Get-VSTeamProject { return $singleResult } - Mock _useWindowsAuthenticationOnPremise { return $true } - Mock Get-VSTeamBuildDefinition { return $buildDefresults.value } + Mock _callAPI { return $buildDefresults } -ParameterFilter { + $Area -eq 'build' -and + $Resource -eq 'definitions' -and + $Version -eq "$(_getApiVersion Build)" + } + Mock Invoke-RestMethod { # If this test fails uncomment the line below to see how the mock was called. # Write-Host $args @@ -71,8 +111,6 @@ Describe 'Set-VSTeamPermissionInheritance' { } Context 'Set-VSTeamPermissionInheritance releaseDef' { - Mock _useWindowsAuthenticationOnPremise { return $true } - Mock Get-VSTeamProject { return $singleResult } Mock Get-VSTeamReleaseDefinition { return $releaseDefresults.value } Mock Invoke-RestMethod { # If this test fails uncomment the line below to see how the mock was called. @@ -96,8 +134,6 @@ Describe 'Set-VSTeamPermissionInheritance' { } Context 'Set-VSTeamPermissionInheritance repository' { - Mock _useWindowsAuthenticationOnPremise { return $true } - Mock Get-VSTeamProject { return $singleResult } Mock Get-VSTeamGitRepository { return $gitRepoResult } Mock Get-VSTeamAccessControlList { return $accesscontrollistsResult.value } diff --git a/unit/test/Set-VSTeamReleaseStatus.Tests.ps1 b/unit/test/Set-VSTeamReleaseStatus.Tests.ps1 index 9f44727a0..440bdc363 100644 --- a/unit/test/Set-VSTeamReleaseStatus.Tests.ps1 +++ b/unit/test/Set-VSTeamReleaseStatus.Tests.ps1 @@ -10,6 +10,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamFeed.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Public/Get-VSTeamBuild.ps1" @@ -19,9 +21,7 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") Describe 'VSTeamReleaseStatus' { ## Arrange - [VSTeamVersions]::Release = '1.0-unittest' - - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" + Mock _getApiVersion { return '1.0-unittest' } -ParameterFilter { $Service -eq 'Release' } Mock _getInstance { return 'https://dev.azure.com/test' } diff --git a/unit/test/Show-VSTeamApproval.Tests.ps1 b/unit/test/Show-VSTeamApproval.Tests.ps1 index d10d86fdc..93a5c3b53 100644 --- a/unit/test/Show-VSTeamApproval.Tests.ps1 +++ b/unit/test/Show-VSTeamApproval.Tests.ps1 @@ -1,12 +1,16 @@ Set-StrictMode -Version Latest +#region include $here = Split-Path -Parent $MyInvocation.MyCommand.Path $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/$sut" +#endregion Describe 'Show-VSTeamApproval' -Tag 'unit', 'approvals' { # Set the account to use for testing. A normal user would do this @@ -18,9 +22,6 @@ Describe 'Show-VSTeamApproval' -Tag 'unit', 'approvals' { $Uri -like "*_apis/projects*" } - # Load the mocks to create the project name dynamic parameter - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" - Context 'Succeeds' { Mock Show-Browser -Verifiable diff --git a/unit/test/Show-VSTeamBuild.Tests.ps1 b/unit/test/Show-VSTeamBuild.Tests.ps1 index 1f182df38..6f6f30606 100644 --- a/unit/test/Show-VSTeamBuild.Tests.ps1 +++ b/unit/test/Show-VSTeamBuild.Tests.ps1 @@ -1,15 +1,18 @@ Set-StrictMode -Version Latest +#region include $here = Split-Path -Parent $MyInvocation.MyCommand.Path $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +. "$here/../../Source/Classes/VSTeamVersions.ps1" +. "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/$sut" +#endregion Describe 'Show-VSTeamBuild' { - # Load the mocks to create the project name dynamic parameter - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" - # Set the account to use for testing. A normal user would do this # using the Set-VSTeamAccount function. Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable diff --git a/unit/test/Show-VSTeamBuildDefinition.Tests.ps1 b/unit/test/Show-VSTeamBuildDefinition.Tests.ps1 index d64c1dc74..d85b974e5 100644 --- a/unit/test/Show-VSTeamBuildDefinition.Tests.ps1 +++ b/unit/test/Show-VSTeamBuildDefinition.Tests.ps1 @@ -1,10 +1,16 @@ Set-StrictMode -Version Latest +#region include $here = Split-Path -Parent $MyInvocation.MyCommand.Path $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +. "$here/../../Source/Classes/VSTeamVersions.ps1" +. "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/$sut" +#endregion Describe 'Show-VSTeamBuildDefinition' { Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable @@ -14,8 +20,6 @@ Describe 'Show-VSTeamBuildDefinition' { $Uri -like "*_apis/projects*" } - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" - Context 'Show-VSTeamBuildDefinition by ID' { Mock Show-Browser { } diff --git a/unit/test/Show-VSTeamGitRepository.Tests.ps1 b/unit/test/Show-VSTeamGitRepository.Tests.ps1 index 96654369b..be0e08f8c 100644 --- a/unit/test/Show-VSTeamGitRepository.Tests.ps1 +++ b/unit/test/Show-VSTeamGitRepository.Tests.ps1 @@ -10,6 +10,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamDirectory.ps1" . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Classes/VSTeamUserEntitlement.ps1" . "$here/../../Source/Classes/VSTeamTeams.ps1" . "$here/../../Source/Classes/VSTeamRepositories.ps1" @@ -48,8 +50,6 @@ Describe "VSTeamGitRepository" { # Mock the call to Get-Projects by the dynamic parameter for ProjectName Mock Invoke-RestMethod { return @() } -ParameterFilter { $Uri -like "*_apis/projects*" } - . "$PSScriptRoot\mocks\mockProjectNameDynamicParam.ps1" - Context 'Show-VSTeamGitRepository' { Mock Show-Browser Mock _getInstance { return 'https://dev.azure.com/test' } diff --git a/unit/test/Show-VSTeamProject.Tests.ps1 b/unit/test/Show-VSTeamProject.Tests.ps1 index 01c012817..eb14d6e69 100644 --- a/unit/test/Show-VSTeamProject.Tests.ps1 +++ b/unit/test/Show-VSTeamProject.Tests.ps1 @@ -1,10 +1,16 @@ Set-StrictMode -Version Latest +#region include $here = Split-Path -Parent $MyInvocation.MyCommand.Path $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +. "$here/../../Source/Classes/VSTeamVersions.ps1" +. "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/$sut" +#endregion Describe 'VSTeamProject' { Mock _getInstance { return 'https://dev.azure.com/test' } diff --git a/unit/test/Show-VSTeamPullRequest.Tests.ps1 b/unit/test/Show-VSTeamPullRequest.Tests.ps1 index f6d4bdc70..cf2fe0e96 100644 --- a/unit/test/Show-VSTeamPullRequest.Tests.ps1 +++ b/unit/test/Show-VSTeamPullRequest.Tests.ps1 @@ -5,8 +5,10 @@ $here = Split-Path -Parent $MyInvocation.MyCommand.Path $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" -. "$here/../../Source/Classes/VSTeamProcess.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" +. "$here/../../Source/Classes/VSTeamProcess.ps1" . "$here/../../Source/Classes/VSTeamProcessCache.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Private/common.ps1" @@ -15,12 +17,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") #endregion Describe 'VSTeamPullRequest' { - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" - Mock _getInstance { return 'https://dev.azure.com/test' } - - # You have to set the version or the api-version will not be added when versions = '' - [VSTeamVersions]::Git = '5.1-preview' + Mock _getApiVersion { return '1.0-unitTest' } -ParameterFilter { $Service -eq 'Git' } $singleResult = @{ pullRequestId = 1 diff --git a/unit/test/Show-VSTeamRelease.Tests.ps1 b/unit/test/Show-VSTeamRelease.Tests.ps1 index 19361e19f..dc0037ba7 100644 --- a/unit/test/Show-VSTeamRelease.Tests.ps1 +++ b/unit/test/Show-VSTeamRelease.Tests.ps1 @@ -10,6 +10,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamFeed.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Public/Get-VSTeamBuild.ps1" @@ -19,11 +21,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") Describe 'VSTeamRelease' { ## Arrange - [VSTeamVersions]::Release = '1.0-unittest' - - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" - Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '1.0-unittest' } -ParameterFilter { $Service -eq 'Release' } # Mock the call to Get-Projects by the dynamic parameter for ProjectName Mock Invoke-RestMethod { return @() } -ParameterFilter { $Uri -like "*_apis/projects*" } diff --git a/unit/test/Show-VSTeamReleaseDefinition.Tests.ps1 b/unit/test/Show-VSTeamReleaseDefinition.Tests.ps1 index c0b34b482..6b440ced8 100644 --- a/unit/test/Show-VSTeamReleaseDefinition.Tests.ps1 +++ b/unit/test/Show-VSTeamReleaseDefinition.Tests.ps1 @@ -6,6 +6,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/Get-VSTeamProject.ps1" . "$here/../../Source/Public/$sut" @@ -13,9 +15,7 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") Describe 'VSTeamReleaseDefinition' { ## Arrange - [VSTeamVersions]::Release = '1.0-unittest' - - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" + Mock _getApiVersion { return '1.0-unittest' } -ParameterFilter { $Service -eq 'Release' } # Mock the call to Get-Projects by the dynamic parameter for ProjectName Mock Invoke-RestMethod { return @() } -ParameterFilter { $Uri -like "*_apis/projects*" } diff --git a/unit/test/Show-VSTeamWorkItem.Tests.ps1 b/unit/test/Show-VSTeamWorkItem.Tests.ps1 index 8910a7c43..6244f924c 100644 --- a/unit/test/Show-VSTeamWorkItem.Tests.ps1 +++ b/unit/test/Show-VSTeamWorkItem.Tests.ps1 @@ -6,6 +6,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/$sut" diff --git a/unit/test/Test-VSTeamMembership.Tests.ps1 b/unit/test/Test-VSTeamMembership.Tests.ps1 index 8a85cc3c1..26550986c 100644 --- a/unit/test/Test-VSTeamMembership.Tests.ps1 +++ b/unit/test/Test-VSTeamMembership.Tests.ps1 @@ -6,6 +6,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Private/callMembershipAPI.ps1" . "$here/../../Source/Public/Get-VSTeamProject.ps1" @@ -14,9 +16,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") Describe 'VSTeamMembership' { ## Arrange - # You have to set the version or the api-version will not be added when [VSTeamVersions]::Graph = '' - [VSTeamVersions]::Graph = '5.0' Mock _supportsGraph + Mock _getApiVersion { return '5.0' } -ParameterFilter { $Service -eq 'Graph' } # Set the account to use for testing. A normal user would do this # using the Set-VSTeamAccount function. diff --git a/unit/test/Test-VSTeamYamlPipeline.Tests.ps1 b/unit/test/Test-VSTeamYamlPipeline.Tests.ps1 index b59b28d2b..8ca944b05 100644 --- a/unit/test/Test-VSTeamYamlPipeline.Tests.ps1 +++ b/unit/test/Test-VSTeamYamlPipeline.Tests.ps1 @@ -1,80 +1,81 @@ -Set-StrictMode -Version Latest - -$here = Split-Path -Parent $MyInvocation.MyCommand.Path -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") - -. "$here/../../Source/Classes/VSTeamVersions.ps1" -. "$here/../../Source/Classes/VSTeamProjectCache.ps1" -. "$here/../../Source/Private/applyTypes.ps1" -. "$here/../../Source/Private/common.ps1" -. "$here/../../Source/Public/$sut" - -$resultsAzD = Get-Content "$PSScriptRoot\sampleFiles\pipelineDefYamlResult.json" -Raw | ConvertFrom-Json - -Describe 'Test-VSTeamYamlPipeline' { - Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable - - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { - $Uri -like "*_apis/projects*" - } - - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" - $testYamlPath = "$PSScriptRoot\sampleFiles\azure-pipelines.test.yml" - - Context 'Yaml Pipeline Checks AzD Services' { - Mock Invoke-RestMethod { - # If this test fails uncomment the line below to see how the mock was called. - # Write-Host $args - # Write-Host $([VSTeamVersions]::Build) - # Write-Host $([VSTeamVersions]::Account) - - return $resultsAzD - } - - It 'With Pipeline with PipelineID and without extra YAML' { - Test-VSTeamYamlPipeline -projectName project -PipelineId 24 - - Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - - $Uri -like "*https://dev.azure.com/test/project/_apis/pipelines/24/runs*" -and - $Uri -like "*api-version=$(_getApiVersion Build)*" -and - $Body -like '*"PreviewRun":*true*' -and - $Body -notlike '*YamlOverride*' - } - } - - It 'With Pipeline with PipelineID and YAML file path' { - - Test-VSTeamYamlPipeline -projectName project -PipelineId 24 -FilePath $testYamlPath - - Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - - $Uri -like "*https://dev.azure.com/test/project/_apis/pipelines/24/runs*" -and - $Uri -like "*api-version=$(_getApiVersion Build)*" -and - $Body -like '*"PreviewRun":*true*' -and - $Body -like '*YamlOverride*' - } - } - - It 'With Pipeline with PipelineID and YAML code' { - - $yamlOverride = [string](Get-Content -raw $testYamlPath) - Test-VSTeamYamlPipeline -projectName project -PipelineId 24 -YamlOverride $yamlOverride - - Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - - $Uri -like "*https://dev.azure.com/test/project/_apis/pipelines/24/runs*" -and - $Uri -like "*api-version=$(_getApiVersion Build)*" -and - $Body -like '*"PreviewRun":*true*' -and - $Body -like '*YamlOverride*' - } - } - - $yamlResult = Test-VSTeamYamlPipeline -projectName project -PipelineId 24 -FilePath $testYamlPath - - It 'Should create Yaml result' { - $yamlResult | Should Not be $null - } - } +Set-StrictMode -Version Latest + +$here = Split-Path -Parent $MyInvocation.MyCommand.Path +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") + +. "$here/../../Source/Classes/VSTeamVersions.ps1" +. "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" +. "$here/../../Source/Private/applyTypes.ps1" +. "$here/../../Source/Private/common.ps1" +. "$here/../../Source/Public/$sut" + +$resultsAzD = Get-Content "$PSScriptRoot\sampleFiles\pipelineDefYamlResult.json" -Raw | ConvertFrom-Json + +Describe 'Test-VSTeamYamlPipeline' { + Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable + + # Mock the call to Get-Projects by the dynamic parameter for ProjectName + Mock Invoke-RestMethod { return @() } -ParameterFilter { + $Uri -like "*_apis/projects*" + } + + $testYamlPath = "$PSScriptRoot\sampleFiles\azure-pipelines.test.yml" + + Context 'Yaml Pipeline Checks AzD Services' { + Mock Invoke-RestMethod { + # If this test fails uncomment the line below to see how the mock was called. + # Write-Host $args + # Write-Host $([VSTeamVersions]::Build) + # Write-Host $([VSTeamVersions]::Account) + + return $resultsAzD + } + + It 'With Pipeline with PipelineID and without extra YAML' { + Test-VSTeamYamlPipeline -projectName project -PipelineId 24 + + Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + + $Uri -like "*https://dev.azure.com/test/project/_apis/pipelines/24/runs*" -and + $Uri -like "*api-version=$(_getApiVersion Build)*" -and + $Body -like '*"PreviewRun":*true*' -and + $Body -notlike '*YamlOverride*' + } + } + + It 'With Pipeline with PipelineID and YAML file path' { + + Test-VSTeamYamlPipeline -projectName project -PipelineId 24 -FilePath $testYamlPath + + Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + + $Uri -like "*https://dev.azure.com/test/project/_apis/pipelines/24/runs*" -and + $Uri -like "*api-version=$(_getApiVersion Build)*" -and + $Body -like '*"PreviewRun":*true*' -and + $Body -like '*YamlOverride*' + } + } + + It 'With Pipeline with PipelineID and YAML code' { + + $yamlOverride = [string](Get-Content -raw $testYamlPath) + Test-VSTeamYamlPipeline -projectName project -PipelineId 24 -YamlOverride $yamlOverride + + Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + + $Uri -like "*https://dev.azure.com/test/project/_apis/pipelines/24/runs*" -and + $Uri -like "*api-version=$(_getApiVersion Build)*" -and + $Body -like '*"PreviewRun":*true*' -and + $Body -like '*YamlOverride*' + } + } + + $yamlResult = Test-VSTeamYamlPipeline -projectName project -PipelineId 24 -FilePath $testYamlPath + + It 'Should create Yaml result' { + $yamlResult | Should Not be $null + } + } } \ No newline at end of file diff --git a/unit/test/Update-VSTeam.Tests.ps1 b/unit/test/Update-VSTeam.Tests.ps1 index 144f79098..75e6f2d39 100644 --- a/unit/test/Update-VSTeam.Tests.ps1 +++ b/unit/test/Update-VSTeam.Tests.ps1 @@ -8,37 +8,28 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamLeaf.ps1" . "$here/../../Source/Classes/VSTeamVersions.ps1" -. "$here/../../Source/Classes/VSTeamTeam.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" +. "$here/../../Source/Classes/VSTeamTeam.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/Get-VSTeam.ps1" . "$here/../../Source/Public/$sut" #endregion - -$results = [PSCustomObject]@{ - value = [PSCustomObject]@{ +Describe "VSTeam" { + $singleResult = [PSCustomObject]@{ id = '6f365a7143e492e911c341451a734401bcacadfd' name = 'refs/heads/master' description = 'team description' } -} - -$singleResult = [PSCustomObject]@{ - id = '6f365a7143e492e911c341451a734401bcacadfd' - name = 'refs/heads/master' - description = 'team description' -} -Describe "VSTeam" { Context "Get-VSTeam" { Context "services" { Mock _getInstance { return 'https://dev.azure.com/test' } Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } - . "$PSScriptRoot\mocks\mockProjectNameDynamicParam.ps1" - Context 'Update-VSTeam without name or description' { It 'Should throw' { { Update-VSTeam -ProjectName Test -TeamToUpdate "OldTeamName" } | Should Throw @@ -113,8 +104,6 @@ Describe "VSTeam" { Context "Server" { - . "$PSScriptRoot\mocks\mockProjectNameDynamicParam.ps1" - Mock _useWindowsAuthenticationOnPremise { return $true } Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } diff --git a/unit/test/Update-VSTeamAgent.Tests.ps1 b/unit/test/Update-VSTeamAgent.Tests.ps1 index 7e4a8b84b..24f7ed215 100644 --- a/unit/test/Update-VSTeamAgent.Tests.ps1 +++ b/unit/test/Update-VSTeamAgent.Tests.ps1 @@ -1,40 +1,44 @@ -Set-StrictMode -Version Latest - -$here = Split-Path -Parent $MyInvocation.MyCommand.Path -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") - -. "$here/../../Source/Classes/VSTeamVersions.ps1" -. "$here/../../Source/Classes/VSTeamProjectCache.ps1" -. "$here/../../Source/Private/common.ps1" -. "$here/../../Source/Public/$sut" - -Describe 'Update-VSTeamAgent' { - Mock _getInstance { return 'https://dev.azure.com/test' } - [VSTeamVersions]::DistributedTask = '1.0-unitTest' - - Context 'Update-VSTeamAgent by ID' { - Mock Invoke-RestMethod { - # If this test fails uncomment the line below to see how the mock was called. - # Write-Host $args - } - - It 'should update the agent with passed in Id' { - Update-VSTeamAgent -Pool 36 -Id 950 -Force - - Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Method -eq 'Post' -and - $Uri -like "*https://dev.azure.com/test/_apis/distributedtask/pools/36/messages*" -and - $Uri -like "*api-version=$(_getApiVersion DistributedTask)*" -and - $Uri -like "*agentId=950*" - } - } - } - - Context 'Update-VSTeamAgent throws' { - Mock Invoke-RestMethod { throw 'boom' } - - It 'should update the agent with passed in Id' { - { Update-VSTeamAgent -Pool 36 -Id 950 -Force } | Should Throw - } - } +Set-StrictMode -Version Latest + +#region include +$here = Split-Path -Parent $MyInvocation.MyCommand.Path +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") + +. "$here/../../Source/Classes/VSTeamVersions.ps1" +. "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" +. "$here/../../Source/Private/common.ps1" +. "$here/../../Source/Public/$sut" +#endregion + +Describe 'Update-VSTeamAgent' { + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '1.0-unittest' } -ParameterFilter { $Service -eq 'DistributedTask' } + + Context 'Update-VSTeamAgent by ID' { + Mock Invoke-RestMethod { + # If this test fails uncomment the line below to see how the mock was called. + # Write-Host $args + } + + It 'should update the agent with passed in Id' { + Update-VSTeamAgent -Pool 36 -Id 950 -Force + + Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Method -eq 'Post' -and + $Uri -like "*https://dev.azure.com/test/_apis/distributedtask/pools/36/messages*" -and + $Uri -like "*api-version=$(_getApiVersion DistributedTask)*" -and + $Uri -like "*agentId=950*" + } + } + } + + Context 'Update-VSTeamAgent throws' { + Mock Invoke-RestMethod { throw 'boom' } + + It 'should update the agent with passed in Id' { + { Update-VSTeamAgent -Pool 36 -Id 950 -Force } | Should Throw + } + } } \ No newline at end of file diff --git a/unit/test/Update-VSTeamBuild.Tests.ps1 b/unit/test/Update-VSTeamBuild.Tests.ps1 index 3746cbc48..101a8176a 100644 --- a/unit/test/Update-VSTeamBuild.Tests.ps1 +++ b/unit/test/Update-VSTeamBuild.Tests.ps1 @@ -1,12 +1,16 @@ Set-StrictMode -Version Latest +#region include $here = Split-Path -Parent $MyInvocation.MyCommand.Path $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/$sut" +#endregion Describe 'Update-VSTeamBuild' { Mock Invoke-RestMethod @@ -17,9 +21,6 @@ Describe 'Update-VSTeamBuild' { } Context 'Update Build keep forever' { - # Load the mocks to create the project name dynamic parameter - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" - # Set the account to use for testing. A normal user would do this # using the Set-VSTeamAccount function. Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable @@ -35,8 +36,6 @@ Describe 'Update-VSTeamBuild' { } Context 'Update Build number' { - . "$PSScriptRoot\mocks\mockProjectNameDynamicParam.ps1" - Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } -Verifiable Mock _useWindowsAuthenticationOnPremise { return $true } @@ -45,9 +44,9 @@ Describe 'Update-VSTeamBuild' { It 'should post changes' { Assert-MockCalled Invoke-RestMethod -Exactly -Scope Context -Times 1 -ParameterFilter { - $Method -eq 'Patch' -and - $Body -eq '{"keepForever": true, "buildNumber": "TestNumber"}' -and - $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/build/builds/1?api-version=$(_getApiVersion Build)" } + $Method -eq 'Patch' -and + $Body -eq '{"keepForever": true, "buildNumber": "TestNumber"}' -and + $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/build/builds/1?api-version=$(_getApiVersion Build)" } } } } \ No newline at end of file diff --git a/unit/test/Update-VSTeamBuildDefinition.Tests.ps1 b/unit/test/Update-VSTeamBuildDefinition.Tests.ps1 index 8a57792ba..fa72d801e 100644 --- a/unit/test/Update-VSTeamBuildDefinition.Tests.ps1 +++ b/unit/test/Update-VSTeamBuildDefinition.Tests.ps1 @@ -1,81 +1,85 @@ -Set-StrictMode -Version Latest - -$here = Split-Path -Parent $MyInvocation.MyCommand.Path -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") - -. "$here/../../Source/Classes/VSTeamVersions.ps1" -. "$here/../../Source/Classes/VSTeamProjectCache.ps1" -. "$here/../../Source/Private/common.ps1" -. "$here/../../Source/Public/Remove-VSTeamAccount.ps1" -. "$here/../../Source/Public/$sut" - -$resultsAzD = Get-Content "$PSScriptRoot\sampleFiles\buildDefvsts.json" -Raw | ConvertFrom-Json - -Describe "Update-VSTeamBuildDefinition" { - Mock _hasProjectCacheExpired { return $false } - - Context "AzD" { - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } - - Mock Invoke-RestMethod { - # If this test fails uncomment the line below to see how the mock was called. - # Write-Host $args - - return $resultsAzD - } - - It "should update build definition from json" { - # This should stop the call to cache projects - [VSTeamProjectCache]::timestamp = (Get-Date).Minute - - Update-VSTeamBuildDefinition -ProjectName Demo -Id 23 -BuildDefinition 'JSON' - - Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Method -eq 'Put' -and - $Uri -like "*https://dev.azure.com/test/Demo/_apis/build/definitions/23*" -and - $Uri -like "*api-version=$(_getApiVersion Build)*" - } - } - - It 'should update build definition from file' { - # This should stop the call to cache projects - [VSTeamProjectCache]::timestamp = (Get-Date).Minute - - Update-VSTeamBuildDefinition -projectName project -id 2 -inFile 'sampleFiles/builddef.json' -Force - - Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Method -eq 'Put' -and - $InFile -eq 'sampleFiles/builddef.json' -and - $Uri -eq "https://dev.azure.com/test/project/_apis/build/definitions/2?api-version=$(_getApiVersion Build)" - } - } - } - - Context 'TFS local Auth' { - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Remove-VSTeamAccount - Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } - - Mock _useWindowsAuthenticationOnPremise { return $true } - - Mock Invoke-RestMethod { - # If this test fails uncomment the line below to see how the mock was called. - # Write-Host $args - - return $resultsAzD - } - - Update-VSTeamBuildDefinition -projectName project -id 2 -inFile 'sampleFiles/builddef.json' -Force - - It 'should update build definition' { - Assert-MockCalled Invoke-RestMethod -Exactly -Scope Context -Times 1 -ParameterFilter { - $Method -eq 'Put' -and - $InFile -eq 'sampleFiles/builddef.json' -and - $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/build/definitions/2?api-version=$(_getApiVersion Build)" - } - } - } +Set-StrictMode -Version Latest + +#region include +$here = Split-Path -Parent $MyInvocation.MyCommand.Path +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") + +. "$here/../../Source/Classes/VSTeamVersions.ps1" +. "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" +. "$here/../../Source/Private/common.ps1" +. "$here/../../Source/Public/Remove-VSTeamAccount.ps1" +. "$here/../../Source/Public/$sut" +#endregion + +Describe "Update-VSTeamBuildDefinition" { + $resultsAzD = Get-Content "$PSScriptRoot\sampleFiles\buildDefvsts.json" -Raw | ConvertFrom-Json + + Mock _hasProjectCacheExpired { return $false } + + Context "AzD" { + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } + + Mock Invoke-RestMethod { + # If this test fails uncomment the line below to see how the mock was called. + # Write-Host $args + + return $resultsAzD + } + + It "should update build definition from json" { + # This should stop the call to cache projects + [VSTeamProjectCache]::timestamp = (Get-Date).Minute + + Update-VSTeamBuildDefinition -ProjectName Demo -Id 23 -BuildDefinition 'JSON' + + Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Method -eq 'Put' -and + $Uri -like "*https://dev.azure.com/test/Demo/_apis/build/definitions/23*" -and + $Uri -like "*api-version=$(_getApiVersion Build)*" + } + } + + It 'should update build definition from file' { + # This should stop the call to cache projects + [VSTeamProjectCache]::timestamp = (Get-Date).Minute + + Update-VSTeamBuildDefinition -projectName project -id 2 -inFile 'sampleFiles/builddef.json' -Force + + Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Method -eq 'Put' -and + $InFile -eq 'sampleFiles/builddef.json' -and + $Uri -eq "https://dev.azure.com/test/project/_apis/build/definitions/2?api-version=$(_getApiVersion Build)" + } + } + } + + Context 'TFS local Auth' { + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Remove-VSTeamAccount + Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } + + Mock _useWindowsAuthenticationOnPremise { return $true } + + Mock Invoke-RestMethod { + # If this test fails uncomment the line below to see how the mock was called. + # Write-Host $args + + return $resultsAzD + } + + Update-VSTeamBuildDefinition -projectName project -id 2 -inFile 'sampleFiles/builddef.json' -Force + + It 'should update build definition' { + Assert-MockCalled Invoke-RestMethod -Exactly -Scope Context -Times 1 -ParameterFilter { + $Method -eq 'Put' -and + $InFile -eq 'sampleFiles/builddef.json' -and + $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/build/definitions/2?api-version=$(_getApiVersion Build)" + } + } + } } \ No newline at end of file diff --git a/unit/test/Update-VSTeamPolicy.Tests.ps1 b/unit/test/Update-VSTeamPolicy.Tests.ps1 index 677d3578c..669e5dcf2 100644 --- a/unit/test/Update-VSTeamPolicy.Tests.ps1 +++ b/unit/test/Update-VSTeamPolicy.Tests.ps1 @@ -6,6 +6,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Public/Get-VSTeamPolicy.ps1" diff --git a/unit/test/Update-VSTeamProject.Tests.ps1 b/unit/test/Update-VSTeamProject.Tests.ps1 index b7d1d6e74..c06a1e294 100644 --- a/unit/test/Update-VSTeamProject.Tests.ps1 +++ b/unit/test/Update-VSTeamProject.Tests.ps1 @@ -10,6 +10,13 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamDirectory.ps1" . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/VSTeamProcessCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" +. "$here/../../Source/Classes/UncachedProjectCompleter.ps1" +. "$here/../../Source/Classes/UncachedProjectValidateAttribute.ps1" +. "$here/../../Source/Classes/ProcessTemplateCompleter.ps1" +. "$here/../../Source/Classes/ProcessValidateAttribute.ps1" . "$here/../../Source/Classes/VSTeamUserEntitlement.ps1" . "$here/../../Source/Classes/VSTeamTeams.ps1" . "$here/../../Source/Classes/VSTeamRepositories.ps1" @@ -41,9 +48,6 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") #endregion Describe 'VSTeamProject' { - . "$PSScriptRoot\mocks\mockProjectNameDynamicParam.ps1" - . "$PSScriptRoot\mocks\mockProcessNameDynamicParam.ps1" - Mock _getApiVersion { return '1.0-unitTests' } Mock _getInstance { return 'https://dev.azure.com/test' } diff --git a/unit/test/Update-VSTeamPullRequest.Tests.ps1 b/unit/test/Update-VSTeamPullRequest.Tests.ps1 index 37674888b..7dc4902b3 100644 --- a/unit/test/Update-VSTeamPullRequest.Tests.ps1 +++ b/unit/test/Update-VSTeamPullRequest.Tests.ps1 @@ -1,97 +1,105 @@ -Set-StrictMode -Version Latest - -#region include -$here = Split-Path -Parent $MyInvocation.MyCommand.Path -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") - -. "$here/../../Source/Classes/VSTeamVersions.ps1" -. "$here/../../Source/Classes/VSTeamUser.ps1" -. "$here/../../Source/Classes/VSTeamProjectCache.ps1" -. "$here/../../Source/Private/applyTypes.ps1" -. "$here/../../Source/Private/common.ps1" -. "$here/../../Source/Public/Get-VSTeamUser.ps1" -. "$here/../../Source/Public/Set-VSTeamAPIVersion.ps1" -. "$here/../../Source/Public/$sut" -#endregion - -Describe 'Pull Requests' { - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" - - Mock _getInstance { return 'https://dev.azure.com/test' } - - # You have to set the version or the api-version will not be added when versions = '' - Mock _getApiVersion { return '1.0-unitTest' } -ParameterFilter { $Service -eq 'Git' -or $Service -eq 'Graph' } - - $result = Get-Content "$PSScriptRoot\sampleFiles\updatePullRequestResponse.json" -Raw | ConvertFrom-Json - $userSingleResult = Get-Content "$PSScriptRoot\sampleFiles\users.single.json" -Raw | ConvertFrom-Json - - Context 'Update-VSTeamPullRequest' { - - It 'Update-VSTeamPullRequest to Draft' { - Mock Invoke-RestMethod { return $result } - - Update-VSTeamPullRequest -RepositoryId "45df2d67-e709-4557-a7f9-c6812b449277" -PullRequestId 19543 -Draft -Force - - Assert-MockCalled Invoke-RestMethod -Scope It -ParameterFilter { - $Method -eq 'Patch' -and - $Uri -like "*repositories/45df2d67-e709-4557-a7f9-c6812b449277/*" -and - $Uri -like "*pullrequests/19543*" -and - $Body -eq '{"isDraft": true }' - } - } - - It 'Update-VSTeamPullRequest to Published' { - Mock Invoke-RestMethod { return $result } - - Update-VSTeamPullRequest -RepositoryId "45df2d67-e709-4557-a7f9-c6812b449277" -PullRequestId 19543 -Force - - Assert-MockCalled Invoke-RestMethod -Scope It -ParameterFilter { - $Method -eq 'Patch' -and - $Uri -like "*repositories/45df2d67-e709-4557-a7f9-c6812b449277/*" -and - $Uri -like "*pullrequests/19543*" -and - $Body -eq '{"isDraft": false }' - } - } - - It 'Update-VSTeamPullRequest to set status to abandoned' { - Mock Invoke-RestMethod { return $result } - - Update-VSTeamPullRequest -RepositoryId "45df2d67-e709-4557-a7f9-c6812b449277" -PullRequestId 19543 -Status abandoned -Force - - Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Method -eq 'Patch' -and - $Uri -like "*repositories/45df2d67-e709-4557-a7f9-c6812b449277/*" -and - $Uri -like "*pullrequests/19543*" -and - $Body -eq '{"status": "abandoned"}' - } - } - - It 'Update-VSTeamPullRequest to set to enable auto complete' { - Mock Invoke-RestMethod { return $userSingleResult } - - $user = Get-VSTeamUser -Descriptor "aad.OTcyOTJkNzYtMjc3Yi03OTgxLWIzNDMtNTkzYmM3ODZkYjlj" - - Mock Invoke-RestMethod { return $result } - Update-VSTeamPullRequest -RepositoryId "45df2d67-e709-4557-a7f9-c6812b449277" -PullRequestId 19543 -EnableAutoComplete -AutoCompleteIdentity $user -Force - - Assert-MockCalled Invoke-RestMethod -Scope It -ParameterFilter { - $Method -eq 'Patch' -and - $Uri -like "*repositories/45df2d67-e709-4557-a7f9-c6812b449277/*" -and - $Uri -like "*pullrequests/19543*" -and - $Body -eq '{"autoCompleteSetBy": "aad.OTcyOTJkNzYtMjc3Yi03OTgxLWIzNDMtNTkzYmM3ODZkYjlj"}' - } - } - - It 'Update-VSTeamPullRequest to set to disable auto complete' { - Mock Invoke-RestMethod { return $result } - Update-VSTeamPullRequest -RepositoryId "45df2d67-e709-4557-a7f9-c6812b449277" -PullRequestId 19543 -DisableAutoComplete -Force - - Assert-MockCalled Invoke-RestMethod -Scope It -ParameterFilter { - $Method -eq 'Patch' -and - $Uri -like "*repositories/45df2d67-e709-4557-a7f9-c6812b449277/*" -and - $Uri -like "*pullrequests/19543*" -and - $Body -eq '{"autoCompleteSetBy": null}' - } - } - } +Set-StrictMode -Version Latest + +#region include +Import-Module SHiPS + +$here = Split-Path -Parent $MyInvocation.MyCommand.Path +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") + +. "$here/../../Source/Classes/VSTeamLeaf.ps1" +. "$here/../../Source/Classes/VSTeamDirectory.ps1" +. "$here/../../Source/Classes/VSTeamUser.ps1" +. "$here/../../Source/Classes/VSTeamVersions.ps1" +. "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" +. "$here/../../Source/Private/applyTypes.ps1" +. "$here/../../Source/Private/common.ps1" +. "$here/../../Source/Public/Get-VSTeamUser.ps1" +. "$here/../../Source/Public/Set-VSTeamAPIVersion.ps1" +. "$here/../../Source/Public/$sut" +#endregion + +Describe 'Pull Requests' { + Mock _getInstance { return 'https://dev.azure.com/test' } + + # You have to set the version or the api-version will not be added when versions = '' + Mock _getApiVersion { return '1.0-unitTest' } -ParameterFilter { $Service -eq 'Git' -or $Service -eq 'Graph' } + + $result = Get-Content "$PSScriptRoot\sampleFiles\updatePullRequestResponse.json" -Raw | ConvertFrom-Json + $userSingleResult = Get-Content "$PSScriptRoot\sampleFiles\users.single.json" -Raw | ConvertFrom-Json + + Context 'Update-VSTeamPullRequest' { + + It 'Update-VSTeamPullRequest to Draft' { + Mock Invoke-RestMethod { return $result } + + Update-VSTeamPullRequest -RepositoryId "45df2d67-e709-4557-a7f9-c6812b449277" -PullRequestId 19543 -Draft -Force + + Assert-MockCalled Invoke-RestMethod -Scope It -ParameterFilter { + $Method -eq 'Patch' -and + $Uri -like "*repositories/45df2d67-e709-4557-a7f9-c6812b449277/*" -and + $Uri -like "*pullrequests/19543*" -and + $Body -eq '{"isDraft": true }' + } + } + + It 'Update-VSTeamPullRequest to Published' { + Mock Invoke-RestMethod { return $result } + + Update-VSTeamPullRequest -RepositoryId "45df2d67-e709-4557-a7f9-c6812b449277" -PullRequestId 19543 -Force + + Assert-MockCalled Invoke-RestMethod -Scope It -ParameterFilter { + $Method -eq 'Patch' -and + $Uri -like "*repositories/45df2d67-e709-4557-a7f9-c6812b449277/*" -and + $Uri -like "*pullrequests/19543*" -and + $Body -eq '{"isDraft": false }' + } + } + + It 'Update-VSTeamPullRequest to set status to abandoned' { + Mock Invoke-RestMethod { return $result } + + Update-VSTeamPullRequest -RepositoryId "45df2d67-e709-4557-a7f9-c6812b449277" -PullRequestId 19543 -Status abandoned -Force + + Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Method -eq 'Patch' -and + $Uri -like "*repositories/45df2d67-e709-4557-a7f9-c6812b449277/*" -and + $Uri -like "*pullrequests/19543*" -and + $Body -eq '{"status": "abandoned"}' + } + } + + It 'Update-VSTeamPullRequest to set to enable auto complete' { + Mock Invoke-RestMethod { return $userSingleResult } + + $user = Get-VSTeamUser -Descriptor "aad.OTcyOTJkNzYtMjc3Yi03OTgxLWIzNDMtNTkzYmM3ODZkYjlj" + + Mock Invoke-RestMethod { return $result } + Update-VSTeamPullRequest -RepositoryId "45df2d67-e709-4557-a7f9-c6812b449277" ` + -PullRequestId 19543 ` + -EnableAutoComplete ` + -AutoCompleteIdentity $user ` + -Force + + Assert-MockCalled Invoke-RestMethod -Scope It -ParameterFilter { + $Method -eq 'Patch' -and + $Uri -like "*repositories/45df2d67-e709-4557-a7f9-c6812b449277/*" -and + $Uri -like "*pullrequests/19543*" -and + $Body -eq '{"autoCompleteSetBy": "aad.OTcyOTJkNzYtMjc3Yi03OTgxLWIzNDMtNTkzYmM3ODZkYjlj"}' + } + } + + It 'Update-VSTeamPullRequest to set to disable auto complete' { + Mock Invoke-RestMethod { return $result } + Update-VSTeamPullRequest -RepositoryId "45df2d67-e709-4557-a7f9-c6812b449277" -PullRequestId 19543 -DisableAutoComplete -Force + + Assert-MockCalled Invoke-RestMethod -Scope It -ParameterFilter { + $Method -eq 'Patch' -and + $Uri -like "*repositories/45df2d67-e709-4557-a7f9-c6812b449277/*" -and + $Uri -like "*pullrequests/19543*" -and + $Body -eq '{"autoCompleteSetBy": null}' + } + } + } } \ No newline at end of file diff --git a/unit/test/Update-VSTeamRelease.Tests.ps1 b/unit/test/Update-VSTeamRelease.Tests.ps1 index 079a1fa53..89f28e7c1 100644 --- a/unit/test/Update-VSTeamRelease.Tests.ps1 +++ b/unit/test/Update-VSTeamRelease.Tests.ps1 @@ -1,59 +1,59 @@ -Set-StrictMode -Version Latest - -#region include -$here = Split-Path -Parent $MyInvocation.MyCommand.Path -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") - -. "$here/../../Source/Classes/VSTeamVersions.ps1" -. "$here/../../Source/Classes/VSTeamProjectCache.ps1" -. "$here/../../Source/Private/applyTypes.ps1" -. "$here/../../Source/Private/common.ps1" -. "$here/../../Source/Public/Get-VSTeamRelease.ps1" -. "$here/../../Source/Public/$sut" -#endregion - -Describe 'VSTeamRelease' { - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unittest' } -ParameterFilter { $Service -eq 'Release' } - - $singleResult = [PSCustomObject]@{ - environments = [PSCustomObject]@{ } - variables = [PSCustomObject]@{ - BrowserToUse = [PSCustomObject]@{ - value = "phantomjs" - } - } - _links = [PSCustomObject]@{ - self = [PSCustomObject]@{ } - web = [PSCustomObject]@{ } - } - } - - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { - $Uri -like "*_apis/projects*" - } - - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" - - Context 'Update-VSTeamRelease' { - Mock _useWindowsAuthenticationOnPremise { return $true } - Mock Invoke-RestMethod { - return $singleResult - } - - It 'should return releases' { - $r = Get-VSTeamRelease -ProjectName project -Id 15 - - $r.variables | Add-Member NoteProperty temp(@{value = 'temp' }) - - Update-VSTeamRelease -ProjectName project -Id 15 -Release $r - - Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Method -eq 'Put' -and - $Body -ne $null -and - $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/releases/15?api-version=$(_getApiVersion Release)" - } - } - } +Set-StrictMode -Version Latest + +#region include +$here = Split-Path -Parent $MyInvocation.MyCommand.Path +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") + +. "$here/../../Source/Classes/VSTeamVersions.ps1" +. "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" +. "$here/../../Source/Private/applyTypes.ps1" +. "$here/../../Source/Private/common.ps1" +. "$here/../../Source/Public/Get-VSTeamRelease.ps1" +. "$here/../../Source/Public/$sut" +#endregion + +Describe 'VSTeamRelease' { + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '1.0-unittest' } -ParameterFilter { $Service -eq 'Release' } + + $singleResult = [PSCustomObject]@{ + environments = [PSCustomObject]@{ } + variables = [PSCustomObject]@{ + BrowserToUse = [PSCustomObject]@{ + value = "phantomjs" + } + } + _links = [PSCustomObject]@{ + self = [PSCustomObject]@{ } + web = [PSCustomObject]@{ } + } + } + + # Mock the call to Get-Projects by the dynamic parameter for ProjectName + Mock Invoke-RestMethod { return @() } -ParameterFilter { + $Uri -like "*_apis/projects*" + } + + Context 'Update-VSTeamRelease' { + Mock _useWindowsAuthenticationOnPremise { return $true } + Mock Invoke-RestMethod { + return $singleResult + } + + It 'should return releases' { + $r = Get-VSTeamRelease -ProjectName project -Id 15 + + $r.variables | Add-Member NoteProperty temp(@{value = 'temp' }) + + Update-VSTeamRelease -ProjectName project -Id 15 -Release $r + + Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Method -eq 'Put' -and + $Body -ne $null -and + $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/releases/15?api-version=$(_getApiVersion Release)" + } + } + } } \ No newline at end of file diff --git a/unit/test/Update-VSTeamReleaseDefinition.Tests.ps1 b/unit/test/Update-VSTeamReleaseDefinition.Tests.ps1 new file mode 100644 index 000000000..b39ccda2f --- /dev/null +++ b/unit/test/Update-VSTeamReleaseDefinition.Tests.ps1 @@ -0,0 +1,50 @@ +Set-StrictMode -Version Latest + +#region include +$here = Split-Path -Parent $MyInvocation.MyCommand.Path +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") + +. "$here/../../Source/Classes/VSTeamVersions.ps1" +. "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" +. "$here/../../Source/Private/applyTypes.ps1" +. "$here/../../Source/Private/common.ps1" +. "$here/../../Source/Public/$sut" +#endregion + +Describe "VSTeamReleaseDefinition" { + Context "Update-VSTeamReleaseDefinition" { + Mock _callApi + Mock _getApiVersion { return '1.0-unitTests'} -ParameterFilter { $Service -eq 'Release' } + + It "with infile should update release" { + Update-VSTeamReleaseDefinition -ProjectName Test -InFile "releaseDef.json" -Force + + Assert-MockCalled _callApi -Scope It -Exactly -Times 1 -ParameterFilter { + $Method -eq "Put" -and + $SubDomain -eq 'vsrm' -and + $Area -eq 'Release' -and + $Resource -eq 'definitions' -and + $Version -eq "$(_getApiVersion Release)" -and + $ContentType -eq 'application/json' -and + $InFile -eq 'releaseDef.json' + } + } + + It "with release definition should update release" { + Update-VSTeamReleaseDefinition -ProjectName Test -ReleaseDefinition "{}" -Force + + Assert-MockCalled _callApi -Scope It -Exactly -Times 1 -ParameterFilter { + $Method -eq "Put" -and + $SubDomain -eq 'vsrm' -and + $Area -eq 'Release' -and + $Resource -eq 'definitions' -and + $Version -eq "$(_getApiVersion Release)" -and + $ContentType -eq 'application/json' -and + $InFile -eq $null -and + $Body -eq "{}" + } + } + } +} \ No newline at end of file diff --git a/unit/test/Update-VSTeamServiceEndpoint.Tests.ps1 b/unit/test/Update-VSTeamServiceEndpoint.Tests.ps1 index 1ac6521a3..262f9f7b1 100644 --- a/unit/test/Update-VSTeamServiceEndpoint.Tests.ps1 +++ b/unit/test/Update-VSTeamServiceEndpoint.Tests.ps1 @@ -6,6 +6,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/Add-VSTeamServiceEndpoint.ps1" @@ -17,8 +19,6 @@ Describe 'VSTeamServiceEndpoint' { Context 'Update-VSTeamServiceEndpoint' { Mock _hasProjectCacheExpired { return $false } - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" - Mock _getInstance { return 'https://dev.azure.com/test' } Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'ServiceFabricEndpoint' } diff --git a/unit/test/Update-VSTeamTaskGroup.Tests.ps1 b/unit/test/Update-VSTeamTaskGroup.Tests.ps1 index d9c7fd797..cf63fac84 100644 --- a/unit/test/Update-VSTeamTaskGroup.Tests.ps1 +++ b/unit/test/Update-VSTeamTaskGroup.Tests.ps1 @@ -6,18 +6,19 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/Get-VSTeamTaskGroup.ps1" . "$here/../../Source/Public/$sut" #endregion -$taskGroupsJson = "$PSScriptRoot\sampleFiles\taskGroups.json" -$taskGroupJson = "$PSScriptRoot\sampleFiles\taskGroup.json" - -Describe 'VSTeamTaskGroup' { - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" +Describe 'VSTeamTaskGroup' { + $taskGroupJson = "$PSScriptRoot\sampleFiles\taskGroup.json" + $taskGroupJsonAsString = Get-Content $taskGroupJson -Raw + # Set the account to use for testing. A normal user would do this # using the Set-VSTeamAccount function. Mock _getInstance { return 'https://dev.azure.com/test' } @@ -26,35 +27,30 @@ Describe 'VSTeamTaskGroup' { # Mock the call to Get-Projects by the dynamic parameter for ProjectName Mock Invoke-RestMethod { return @() } -ParameterFilter { $Uri -like "*_apis/project*" } - BeforeAll { - $projectName = "project" - $taskGroupJsonAsString = Get-Content $taskGroupJson -Raw - } - Context 'Update-VSTeamTaskGroup' { Mock Invoke-RestMethod { return Get-Content $taskGroupJson | ConvertFrom-Json } It 'should update a task group using body param' { - $taskGroupToUpdate = Get-VSTeamTaskGroup -Name "For Unit Tests" -ProjectName $projectName + $taskGroupToUpdate = Get-VSTeamTaskGroup -Name "For Unit Tests" -ProjectName 'project' - Update-VSTeamTaskGroup -ProjectName $projectName -Body $taskGroupJsonAsString -Id $taskGroupToUpdate.id + Update-VSTeamTaskGroup -ProjectName 'project' -Body $taskGroupJsonAsString -Id $taskGroupToUpdate.id Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/$projectName/_apis/distributedtask/taskgroups/$($taskGroupToUpdate.id)?api-version=$(_getApiVersion TaskGroups)" -and + $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/taskgroups/$($taskGroupToUpdate.id)?api-version=$(_getApiVersion TaskGroups)" -and $Body -eq $taskGroupJsonAsString -and $Method -eq "Put" } } It 'should update a task group using infile param' { - $taskGroupToUpdate = Get-VSTeamTaskGroup -Name "For Unit Tests" -ProjectName $projectName + $taskGroupToUpdate = Get-VSTeamTaskGroup -Name "For Unit Tests" -ProjectName 'project' - Update-VSTeamTaskGroup -ProjectName $projectName -InFile $taskGroupJson -Id $taskGroupToUpdate.id + Update-VSTeamTaskGroup -ProjectName 'project' -InFile $taskGroupJson -Id $taskGroupToUpdate.id Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/$projectName/_apis/distributedtask/taskgroups/$($taskGroupToUpdate.id)?api-version=$(_getApiVersion TaskGroups)" -and + $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/taskgroups/$($taskGroupToUpdate.id)?api-version=$(_getApiVersion TaskGroups)" -and $InFile -eq $taskGroupJson -and $Method -eq "Put" } diff --git a/unit/test/Update-VSTeamUserEntitlement.Tests.ps1 b/unit/test/Update-VSTeamUserEntitlement.Tests.ps1 index 535d38f60..02eac764f 100644 --- a/unit/test/Update-VSTeamUserEntitlement.Tests.ps1 +++ b/unit/test/Update-VSTeamUserEntitlement.Tests.ps1 @@ -6,6 +6,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/Get-VSTeamUserEntitlement.ps1" @@ -39,7 +41,21 @@ Describe "VSTeamUserEntitlement" { } } - It 'Should update a user' { + # Get-VSTeamUserEntitlement by id + Mock _callAPI { + return [PSCustomObject]@{ + accessLevel = [PSCustomObject]@{ + accountLicenseType = "Stakeholder" + licensingSource = "msdn" + msdnLicenseType = "enterprise" + } + email = 'test@user.com' + userName = 'Test User' + id = '00000000-0000-0000-0000-000000000000' + } + } -ParameterFilter { $id -eq '00000000-0000-0000-0000-000000000000' } + + It 'by email should update a user' { Update-VSTeamUserEntitlement -License 'Stakeholder' -LicensingSource msdn -MSDNLicenseType enterprise -Email 'test@user.com' -Force Assert-MockCalled _callAPI -Exactly -Times 1 -Scope It -ParameterFilter { @@ -51,47 +67,24 @@ Describe "VSTeamUserEntitlement" { } } - It 'update user with invalid email should throw' { + It 'by id should update a user' { + Update-VSTeamUserEntitlement -Id '00000000-0000-0000-0000-000000000000' -Force + + Assert-MockCalled _callAPI -Exactly -Times 1 -Scope It -ParameterFilter { + $Method -eq 'Patch' -and + $subDomain -eq 'vsaex' -and + $id -eq '00000000-0000-0000-0000-000000000000' -and + $resource -eq 'userentitlements' -and + $version -eq $(_getApiVersion MemberEntitlementManagement) + } + } + + It 'with wrong email should update user with invalid email should throw' { { Update-VSTeamUserEntitlement -Email 'not@found.com' -License 'Express' -Force } | Should Throw } - It 'update user with invalid id should throw' { + It 'with invalid id should update user with invalid id should throw' { { Update-VSTeamUserEntitlement -Id '11111111-0000-0000-0000-000000000000' -License 'Express' -Force } | Should Throw } - - # Context 'Add-VSTeamUserEntitlement' { - # $obj = @{ - # accessLevel = @{ - # accountLicenseType = 'earlyAdopter' - # licensingSource = 'msdn' - # msdnLicenseType = 'enterprise' - # } - # user = @{ - # principalName = 'test@user.com' - # subjectKind = 'user' - # } - # projectEntitlements = @{ - # group = @{ - # groupType = 'ProjectContributor' - # } - # projectRef = @{ - # id = $null - # } - # } - # } - - # $expected = $obj | ConvertTo-Json - - # Mock _callAPI -ParameterFilter { - # $Method -eq 'Post' -and - # $Body -eq $expected - # } - - # Add-VSTeamUserEntitlement -License earlyAdopter -LicensingSource msdn -MSDNLicenseType enterprise -Email 'test@user.com' - - # It 'Should add a user' { - # Assert-VerifiableMock - # } - # } } } \ No newline at end of file diff --git a/unit/test/Update-VSTeamVariableGroup.Tests.ps1 b/unit/test/Update-VSTeamVariableGroup.Tests.ps1 index 9c29d0f9a..7d372de61 100644 --- a/unit/test/Update-VSTeamVariableGroup.Tests.ps1 +++ b/unit/test/Update-VSTeamVariableGroup.Tests.ps1 @@ -6,6 +6,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/Set-VSTeamAPIVersion.ps1" @@ -19,8 +21,6 @@ Describe 'VSTeamVariableGroup' { Context 'Update-VSTeamVariableGroup' { Context 'Services' { - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" - $sampleFileVSTS = $(Get-Content "$PSScriptRoot\sampleFiles\variableGroupSamples.json" | ConvertFrom-Json) Mock _getApiVersion { return 'VSTS' } @@ -32,12 +32,12 @@ Describe 'VSTeamVariableGroup' { It 'should update an exisiting Variable Group' { $testParameters = @{ - ProjectName = "project" - Id = 1 - Name = "TestVariableGroup1" - Description = "A test variable group" - Type = "Vsts" - Variables = @{ + ProjectName = "project" + Id = 1 + Name = "TestVariableGroup1" + Description = "A test variable group" + Type = "Vsts" + Variables = @{ key1 = @{ value = "value" } @@ -46,6 +46,10 @@ Describe 'VSTeamVariableGroup' { isSecret = $true } } + ProviderData = @{ + serviceEndpointId = "AzureRMServiceEndpointGuid" + vault = "name_of_existing_key_vault" + } } Update-VSTeamVariableGroup @testParameters @@ -69,9 +73,7 @@ Describe 'VSTeamVariableGroup' { } } - Context 'Server' { - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" - + Context 'Server' { $sampleFile2017 = $(Get-Content "$PSScriptRoot\sampleFiles\variableGroupSamples2017.json" | ConvertFrom-Json) Mock _getApiVersion { return 'TFS2017' } @@ -86,6 +88,7 @@ Describe 'VSTeamVariableGroup' { id = 1 Name = "TestVariableGroup1" Description = "A test variable group" + Type = "AzureKeyVault" Variables = @{ key1 = @{ value = "value" diff --git a/unit/test/Update-VSTeamWorkItem.Tests.ps1 b/unit/test/Update-VSTeamWorkItem.Tests.ps1 index 9e1cf94b0..0d69efd38 100644 --- a/unit/test/Update-VSTeamWorkItem.Tests.ps1 +++ b/unit/test/Update-VSTeamWorkItem.Tests.ps1 @@ -6,6 +6,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/$sut" @@ -19,8 +21,6 @@ Describe 'VSTeamWorkItem' { $Uri -like "*_apis/projects*" } - . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" - $obj = @{ id = 47 rev = 1 @@ -36,7 +36,7 @@ Describe 'VSTeamWorkItem' { } It 'Without Default Project should update work item' { - $Global:PSDefaultParameterValues.Remove("*:projectName") + $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") Update-VSTeamWorkItem -Id 1 -Title Test -Force Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { @@ -49,7 +49,7 @@ Describe 'VSTeamWorkItem' { } It 'With Default Project should update work item' { - $Global:PSDefaultParameterValues["*:projectName"] = 'test' + $Global:PSDefaultParameterValues["*-vsteam*:projectName"] = 'test' Update-VSTeamWorkItem 1 -Title Test1 -Description Testing -Force Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { @@ -66,7 +66,7 @@ Describe 'VSTeamWorkItem' { } It 'With Default Project should update work item with 2 parameters and additional properties' { - $Global:PSDefaultParameterValues["*:projectName"] = 'test' + $Global:PSDefaultParameterValues["*-vsteam*:projectName"] = 'test' $additionalFields = @{"System.Tags" = "TestTag"; "System.AreaPath" = "Project\\MyPath" } Update-VSTeamWorkItem 1 -Title Test1 -Description Testing -AdditionalFields $additionalFields @@ -87,7 +87,7 @@ Describe 'VSTeamWorkItem' { } It 'With Default Project should update work item only with 1 parameter and additional properties' { - $Global:PSDefaultParameterValues["*:projectName"] = 'test' + $Global:PSDefaultParameterValues["*-vsteam*:projectName"] = 'test' $additionalFields = @{"System.Tags" = "TestTag"; "System.AreaPath" = "Project\\MyPath" } Update-VSTeamWorkItem 1 -Title Test1 -AdditionalFields $additionalFields @@ -106,7 +106,7 @@ Describe 'VSTeamWorkItem' { } It 'With Default Project should update work item only with additional properties' { - $Global:PSDefaultParameterValues["*:projectName"] = 'test' + $Global:PSDefaultParameterValues["*-vsteam*:projectName"] = 'test' $additionalFields = @{"System.Tags" = "TestTag"; "System.AreaPath" = "Project\\MyPath" } Update-VSTeamWorkItem 1 -AdditionalFields $additionalFields @@ -123,10 +123,10 @@ Describe 'VSTeamWorkItem' { } It 'With Default Project should throw exception when adding existing parameters to additional properties' { - $Global:PSDefaultParameterValues["*:projectName"] = 'test' + $Global:PSDefaultParameterValues["*-vsteam*:projectName"] = 'test' $additionalFields = @{"System.Title" = "Test1"; "System.AreaPath" = "Project\\TestPath" } - { Update-VSTeamWorkItem -ProjectName test -WorkItemType Task -Title Test1 -Description Testing -AdditionalFields $additionalFields } | Should Throw + { Update-VSTeamWorkItem 1 -Title Test1 -Description Testing -AdditionalFields $additionalFields } | Should Throw } } } \ No newline at end of file diff --git a/unit/test/VSTeamAccessControlEntry.Tests.ps1 b/unit/test/VSTeamAccessControlEntry.Tests.ps1 new file mode 100644 index 000000000..47cb95891 --- /dev/null +++ b/unit/test/VSTeamAccessControlEntry.Tests.ps1 @@ -0,0 +1,26 @@ +Set-StrictMode -Version Latest + +#region include +Import-Module SHiPS + +$here = Split-Path -Parent $MyInvocation.MyCommand.Path +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") + +. "$here/../../Source/Classes/VSTeamLeaf.ps1" +. "$here/../../Source/Classes/$sut" +#endregion + +Describe "VSTeamAccessControlEntry" { + Context 'Constructor' { + $accessControlEntryResult = Get-Content "$PSScriptRoot\sampleFiles\accessControlEntryResult.json" -Raw | ConvertFrom-Json + $securityNamespaceObject = [VSTeamAccessControlEntry]::new($accessControlEntryResult.value[0]) + + It 'constructor should create VSTeamAccessControlEntry' { + $securityNamespaceObject | Should Not Be $null + } + + It 'ToString should return full description' { + $securityNamespaceObject.ToString() | Should Be "Descriptor=Microsoft.TeamFoundation.Identity;S-1-9-1551374245-1204400969-2402986413-2179408616-0-0-0-0-1; Allow=8; Deny=0; ExtendedInfo=@{message=Hello World}" + } + } +} \ No newline at end of file diff --git a/unit/test/VSTeamAccessControlList.Tests.ps1 b/unit/test/VSTeamAccessControlList.Tests.ps1 new file mode 100644 index 000000000..0526a0b39 --- /dev/null +++ b/unit/test/VSTeamAccessControlList.Tests.ps1 @@ -0,0 +1,25 @@ +Set-StrictMode -Version Latest + +#region include +Import-Module SHiPS + +$here = Split-Path -Parent $MyInvocation.MyCommand.Path +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") + +. "$here/../../Source/Classes/VSTeamLeaf.ps1" +. "$here/../../Source/Classes/VSTeamAccessControlEntry.ps1" +. "$here/../../Source/Classes/$sut" +#endregion + +Describe "VSTeamAccessControlList" { + $accessControlListResult = Get-Content "$PSScriptRoot\sampleFiles\accessControlListResult.json" -Raw | ConvertFrom-Json + + Context "Constructor" { + + $target = [VSTeamAccessControlList]::new($accessControlListResult.value[0]) + + It "toString should return token" { + $target.ToString() | Should be '1ba198c0-7a12-46ed-a96b-f4e77554c6d4' + } + } +} \ No newline at end of file diff --git a/unit/test/VSTeamAccount.Tests.ps1 b/unit/test/VSTeamAccount.Tests.ps1 index c9e4611da..e526c3f35 100644 --- a/unit/test/VSTeamAccount.Tests.ps1 +++ b/unit/test/VSTeamAccount.Tests.ps1 @@ -10,6 +10,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamDirectory.ps1" . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/UncachedProjectCompleter.ps1" +. "$here/../../Source/Classes/UncachedProjectValidateAttribute.ps1" . "$here/../../Source/Classes/VSTeamBuildDefinitionProcessPhaseStep.ps1" . "$here/../../Source/Classes/VSTeamBuildDefinitionProcessPhase.ps1" . "$here/../../Source/Classes/VSTeamBuildDefinitionProcess.ps1" diff --git a/unit/test/VSTeamAgent.Tests.ps1 b/unit/test/VSTeamAgent.Tests.ps1 new file mode 100644 index 000000000..08c2f752e --- /dev/null +++ b/unit/test/VSTeamAgent.Tests.ps1 @@ -0,0 +1,39 @@ +Set-StrictMode -Version Latest + +#region include +Import-Module SHiPS + +$here = Split-Path -Parent $MyInvocation.MyCommand.Path +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") + +. "$here/../../Source/Classes/VSTeamLeaf.ps1" +. "$here/../../Source/Classes/VSTeamDirectory.ps1" +. "$here/../../Source/Private/applyTypes.ps1" +. "$here/../../Source/Private/common.ps1" +. "$here/../../Source/Public/Get-VSTeamJobRequest.ps1" +. "$here/../../Source/Classes/VSTeamJobRequest.ps1" +. "$here/../../Source/Classes/$sut" +#endregion + +Describe "VSTeamAgent" { + Context "GetChildItem" { + $resultsAzD = Get-Content "$PSScriptRoot/sampleFiles/jobrequestsAzD.json" -Raw | ConvertFrom-Json + Mock Get-VSTeamJobRequest { + $objs = @() + + foreach ($item in $resultsAzD.value) { + $objs += [VSTeamJobRequest]::new($item) + } + + Write-Output $objs + } + + $testAgent = Get-Content "$PSScriptRoot\sampleFiles\agentSingleResult.json" -Raw | ConvertFrom-Json + $target = [VSTeamAgent]::new($testAgent, 1) + + It "should return child items." { + $actual = $target.GetChildItem() + $actual | Should not be $Null + } + } +} \ No newline at end of file diff --git a/unit/test/VSTeamBuildDefinitions.Tests.ps1 b/unit/test/VSTeamBuildDefinitions.Tests.ps1 index c5ff3d307..daff4ff4b 100644 --- a/unit/test/VSTeamBuildDefinitions.Tests.ps1 +++ b/unit/test/VSTeamBuildDefinitions.Tests.ps1 @@ -10,6 +10,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamDirectory.ps1" . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Classes/VSTeamBuildDefinitionProcessPhaseStep.ps1" . "$here/../../Source/Classes/VSTeamBuildDefinitionProcessPhase.ps1" . "$here/../../Source/Classes/VSTeamBuildDefinitionProcess.ps1" diff --git a/unit/test/VSTeamBuilds.Tests.ps1 b/unit/test/VSTeamBuilds.Tests.ps1 index 77a0eb648..481a4e9f6 100644 --- a/unit/test/VSTeamBuilds.Tests.ps1 +++ b/unit/test/VSTeamBuilds.Tests.ps1 @@ -10,6 +10,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamDirectory.ps1" . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Classes/VSTeamUserEntitlement.ps1" . "$here/../../Source/Classes/VSTeamBuild.ps1" . "$here/../../Source/Private/applyTypes.ps1" diff --git a/unit/test/VSTeamPermissions.Tests.ps1 b/unit/test/VSTeamPermissions.Tests.ps1 index 7406b309b..4d6cd3f04 100644 --- a/unit/test/VSTeamPermissions.Tests.ps1 +++ b/unit/test/VSTeamPermissions.Tests.ps1 @@ -11,6 +11,9 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamGroups.ps1" . "$here/../../Source/Classes/VSTeamUsers.ps1" . "$here/../../Source/Classes/VSTeamVersions.ps1" +. "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/UncachedProjectCompleter.ps1" +. "$here/../../Source/Classes/UncachedProjectValidateAttribute.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/Get-VSTeamUser.ps1" diff --git a/unit/test/VSTeamReleases.Tests.ps1 b/unit/test/VSTeamReleases.Tests.ps1 index ebc120a32..e89ebd07d 100644 --- a/unit/test/VSTeamReleases.Tests.ps1 +++ b/unit/test/VSTeamReleases.Tests.ps1 @@ -10,6 +10,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamDirectory.ps1" . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Classes/VSTeamUserEntitlement.ps1" . "$here/../../Source/Classes/VSTeamTask.ps1" . "$here/../../Source/Classes/VSTeamAttempt.ps1" diff --git a/unit/test/VSTeamRepositories.Tests.ps1 b/unit/test/VSTeamRepositories.Tests.ps1 index 4b1b3709c..1ba7db45a 100644 --- a/unit/test/VSTeamRepositories.Tests.ps1 +++ b/unit/test/VSTeamRepositories.Tests.ps1 @@ -10,6 +10,8 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamDirectory.ps1" . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Classes/VSTeamUserEntitlement.ps1" . "$here/../../Source/Classes/VSTeamRef.ps1" . "$here/../../Source/Classes/VSTeamBuildDefinitionProcessPhaseStep.ps1" diff --git a/unit/test/VSTeamTeams.Tests.ps1 b/unit/test/VSTeamTeams.Tests.ps1 index a46e61acc..523ef8354 100644 --- a/unit/test/VSTeamTeams.Tests.ps1 +++ b/unit/test/VSTeamTeams.Tests.ps1 @@ -10,7 +10,11 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here/../../Source/Classes/VSTeamDirectory.ps1" . "$here/../../Source/Classes/VSTeamVersions.ps1" . "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Classes/VSTeamTeam.ps1" +. "$here/../../Source/Classes/ProjectCompleter.ps1" +. "$here/../../Source/Classes/ProjectValidateAttribute.ps1" . "$here/../../Source/Private/applyTypes.ps1" . "$here/../../Source/Private/common.ps1" . "$here/../../Source/Public/Get-VSTeam.ps1" @@ -24,7 +28,8 @@ Describe "VSTeamTeams" { ProjectName = '' description = '' id = 1 - }, 'TestProject') } + }, 'TestProject') + } $teams = [VSTeamTeams]::new('Teams', 'TestProject') diff --git a/unit/test/common.Tests.ps1 b/unit/test/common.Tests.ps1 index 24170a3c7..ddd3f9d78 100644 --- a/unit/test/common.Tests.ps1 +++ b/unit/test/common.Tests.ps1 @@ -1,244 +1,244 @@ -Set-StrictMode -Version Latest - -#region include -$here = Split-Path -Parent $MyInvocation.MyCommand.Path -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") - -. "$here/../../Source/Classes/VSTeamVersions.ps1" -. "$here/../../Source/Classes/VSTeamProjectCache.ps1" -. "$here/../../Source/Private/common.ps1" -. "$here/../../Source/Private/$sut" -#endregion - -Describe 'Common' { - Context '_convertSecureStringTo_PlainText' { - $emptySecureString = ConvertTo-SecureString 'Test String' -AsPlainText -Force - - $actual = _convertSecureStringTo_PlainText -SecureString $emptySecureString - - It 'Should return plain text' { - $actual | Should Be 'Test String' - } - } - - Context '_buildProjectNameDynamicParam set Alias' { - Mock _getProjects - - $actual = _buildProjectNameDynamicParam -AliasName TestAlias - - It 'Should set the alias of dynamic parameter' { - $actual["ProjectName"].Attributes[1].AliasNames | Should Be 'TestAlias' - } - } - - Context '_getUserAgent on Mac' { - Mock Get-OperatingSystem { return 'macOS' } - [VSTeamVersions]::ModuleVersion = '0.0.0' - - $actual = _getUserAgent - - It 'Should return User Agent for macOS' { - $actual | Should BeLike '*macOS*' - } - - It 'Should return User Agent for Module Version' { - $actual | Should BeLike '*0.0.0*' - } - - It 'Should return User Agent for PowerShell Version' { - $actual | Should BeLike "*$($PSVersionTable.PSVersion.ToString())*" - } - } - - Context '_getUserAgent on Linux' { - Mock Get-OperatingSystem { return 'Linux' } - [VSTeamVersions]::ModuleVersion = '0.0.0' - - $actual = _getUserAgent - - It 'Should return User Agent for Linux' { - $actual | Should BeLike '*Linux*' - } - - It 'Should return User Agent for Module Version' { - $actual | Should BeLike '*0.0.0*' - } - - It 'Should return User Agent for PowerShell Version' { - $actual | Should BeLike "*$($PSVersionTable.PSVersion.ToString())*" - } - } - - Context '_buildProjectNameDynamicParam' { - Mock _getProjects { return ConvertFrom-Json '["Demo", "Universal"]' } - - It 'should return dynamic parameter' { - _buildProjectNameDynamicParam | Should Not BeNullOrEmpty - } - } - - Context '_buildDynamicParam no defaults' { - Mock _getProjects { return ConvertFrom-Json '["Demo", "Universal"]' } - - $testParams = @{ - ParameterName = 'TestParam' - arrSet = @(@{A = 'A' }, @{B = 'B' }) - Mandatory = $true - ParameterSetName = "NewTest" - Position = 0 - ParameterType = ([hashtable]) - ValueFromPipelineByPropertyName = $false - AliasName = "TestAlieas" - HelpMessage = "Test Help Message" - } - $param = (_buildDynamicParam @testParams) - - It 'should return dynamic parameter' { - $param | Should Not BeNullOrEmpty - } - - It 'should return dynamic parameter name' { - $param.Name | Should Be $testParams.ParameterName - } - - It 'should return dynamic parameter type' { - $param.ParameterType.FullName | Should Be $testParams.ParameterType.FullName - } - - It 'Should set the basic attributes of the dynamic parameter' { - $param.Attributes[0].Position | Should Be $testParams.Position - $param.Attributes[0].Mandatory | Should Be $testParams.Mandatory - $param.Attributes[0].ParameterSetName | Should Be $testParams.ParameterSetName - $param.Attributes[0].ValueFromPipelineByPropertyName | Should Be $testParams.ValueFromPipelineByPropertyName - $param.Attributes[0].HelpMessage | Should Be $testParams.HelpMessage - } - - It 'Should set the alias attributes of the dynamic parameter' { - $param.Attributes[1].AliasNames | Should Be $testParams.AliasName - } - - It 'Should set the possible vaule attributes of the dynamic parameter' { - (Compare-Object -ReferenceObject $param.Attributes[2].ValidValues -DifferenceObject $testParams.arrSet) | Should BeNullOrEmpty - } - } - - Context '_buildDynamicParam defaults' { - Mock _getProjects { return ConvertFrom-Json '["Demo", "Universal"]' } - - $param = (_buildDynamicParam) - - It 'should return dynamic parameter' { - $param | Should Not BeNullOrEmpty - } - - It 'should return dynamic parameter name' { - $param.Name | Should Be 'QueueName' - } - - It 'should return dynamic parameter type' { - $param.ParameterType.FullName | Should Be ([string]).FullName - } - - It 'Should set the basic attributes of the dynamic parameter' { - ($param.Attributes[0].Position -lt 0) | Should Be ($true) - $param.Attributes[0].Mandatory | Should Be $false - $param.Attributes[0].ParameterSetName | Should Be '__AllParameterSets' - $param.Attributes[0].ValueFromPipelineByPropertyName | Should Be $true - $param.Attributes[0].HelpMessage | Should BeNullOrEmpty - } - - It 'Should have no additoinal attributes of the dynamic parameter' { - $param.Attributes.Count | Should Be 1 - } - } - - Context '_getWorkItemTypes' { - Mock _getInstance { return $null } -Verifiable - - It 'should return empty array' { - _getWorkItemTypes -ProjectName test | Should be @() - Assert-VerifiableMock - } - } - - Context '_handleException' { - # Build a proper error - $obj = "{Value: {Message: 'Top Message'}, Exception: {Message: 'Test Exception', Response: { StatusCode: '401'}}}" - - if ($PSVersionTable.PSEdition -ne 'Core') { - $r = [System.Net.HttpWebResponse]::new() - $e = [System.Net.WebException]::new("Test Exception", $null, [System.Net.WebExceptionStatus]::ProtocolError, $r) - } - else { - $r = [System.Net.Http.HttpResponseMessage]::new([System.Net.HttpStatusCode]::Unauthorized) - $e = [Microsoft.PowerShell.Commands.HttpResponseException]::new("Test Exception", $r) - } - $ex = Write-Error -Exception $e 2>&1 -ErrorAction Continue - $ex.ErrorDetails = [System.Management.Automation.ErrorDetails]::new($obj) - - It 'Should Write two warnings' { - Mock Write-Warning -ParameterFilter { $Message -eq 'An error occurred: Test Exception' } -Verifiable - Mock Write-Warning -ParameterFilter { $Message -eq 'Top Message' } -Verifiable - - _handleException $ex - - Assert-VerifiableMock - } - } - - Context '_handleException should re-throw' { - $e = [System.Management.Automation.RuntimeException]::new('You must call Set-VSTeamAccount before calling any other functions in this module.') - $ex = Write-Error -Exception $e 2>&1 -ErrorAction Continue - - It 'Should throw' { - - { _handleException $ex } | Should Throw - } - } - - Context '_handleException message only' { - # Build a proper error - $obj = "{Value: {Message: 'Test Exception'}, Exception: {Message: 'Test Exception', Response: { StatusCode: '400'}}}" - - if ($PSVersionTable.PSEdition -ne 'Core') { - $e = [System.Net.WebException]::new("Test Exception", $null) - } - else { - $r = [System.Net.Http.HttpResponseMessage]::new([System.Net.HttpStatusCode]::BadRequest) - $e = [Microsoft.PowerShell.Commands.HttpResponseException]::new("Test Exception", $r) - } - - $ex = Write-Error -Exception $e 2>&1 -ErrorAction Continue - $ex.ErrorDetails = [System.Management.Automation.ErrorDetails]::new($obj) - - It 'Should Write one warnings' { - Mock Write-Warning -ParameterFilter { $Message -eq 'Test Exception' } -Verifiable - - _handleException $ex - - Assert-VerifiableMock - } - } - - Context '_isVSTS' { - It '.visualstudio.com should return true' { - _isVSTS 'https://dev.azure.com/test' | Should Be $true - } - - It '.visualstudio.com with / should return true' { - _isVSTS 'https://dev.azure.com/test/' | Should Be $true - } - - It 'https://dev.azure.com should return true' { - _isVSTS 'https://dev.azure.com/test' | Should Be $true - } - - It 'https://dev.azure.com with / should return true' { - _isVSTS 'https://dev.azure.com/test/' | Should Be $true - } - - It 'should return false' { - _isVSTS 'http://localhost:8080/tfs/defaultcollection' | Should Be $false - } - } +Set-StrictMode -Version Latest + +#region include +$here = Split-Path -Parent $MyInvocation.MyCommand.Path +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") + +. "$here/../../Source/Classes/VSTeamVersions.ps1" +. "$here/../../Source/Classes/VSTeamProjectCache.ps1" +. "$here/../../Source/Private/common.ps1" +. "$here/../../Source/Private/$sut" +#endregion + +Describe 'Common' { + Context '_convertSecureStringTo_PlainText' { + $emptySecureString = ConvertTo-SecureString 'Test String' -AsPlainText -Force + + $actual = _convertSecureStringTo_PlainText -SecureString $emptySecureString + + It 'Should return plain text' { + $actual | Should Be 'Test String' + } + } + + Context '_buildProjectNameDynamicParam set Alias' { + Mock _getProjects + + $actual = _buildProjectNameDynamicParam -AliasName TestAlias + + It 'Should set the alias of dynamic parameter' { + $actual["ProjectName"].Attributes[1].AliasNames | Should Be 'TestAlias' + } + } + + Context '_getUserAgent on Mac' { + Mock Get-OperatingSystem { return 'macOS' } + [VSTeamVersions]::ModuleVersion = '0.0.0' + + $actual = _getUserAgent + + It 'Should return User Agent for macOS' { + $actual | Should BeLike '*macOS*' + } + + It 'Should return User Agent for Module Version' { + $actual | Should BeLike '*0.0.0*' + } + + It 'Should return User Agent for PowerShell Version' { + $actual | Should BeLike "*$($PSVersionTable.PSVersion.ToString())*" + } + } + + Context '_getUserAgent on Linux' { + Mock Get-OperatingSystem { return 'Linux' } + [VSTeamVersions]::ModuleVersion = '0.0.0' + + $actual = _getUserAgent + + It 'Should return User Agent for Linux' { + $actual | Should BeLike '*Linux*' + } + + It 'Should return User Agent for Module Version' { + $actual | Should BeLike '*0.0.0*' + } + + It 'Should return User Agent for PowerShell Version' { + $actual | Should BeLike "*$($PSVersionTable.PSVersion.ToString())*" + } + } + + Context '_buildProjectNameDynamicParam' { + Mock _getProjects { return ConvertFrom-Json '["Demo", "Universal"]' } + + It 'should return dynamic parameter' { + _buildProjectNameDynamicParam | Should Not BeNullOrEmpty + } + } + + Context '_buildDynamicParam no defaults' { + Mock _getProjects { return ConvertFrom-Json '["Demo", "Universal"]' } + + $testParams = @{ + ParameterName = 'TestParam' + arrSet = @(@{A = 'A' }, @{B = 'B' }) + Mandatory = $true + ParameterSetName = "NewTest" + Position = 0 + ParameterType = ([hashtable]) + ValueFromPipelineByPropertyName = $false + AliasName = "TestAlieas" + HelpMessage = "Test Help Message" + } + $param = (_buildDynamicParam @testParams) + + It 'should return dynamic parameter' { + $param | Should Not BeNullOrEmpty + } + + It 'should return dynamic parameter name' { + $param.Name | Should Be $testParams.ParameterName + } + + It 'should return dynamic parameter type' { + $param.ParameterType.FullName | Should Be $testParams.ParameterType.FullName + } + + It 'Should set the basic attributes of the dynamic parameter' { + $param.Attributes[0].Position | Should Be $testParams.Position + $param.Attributes[0].Mandatory | Should Be $testParams.Mandatory + $param.Attributes[0].ParameterSetName | Should Be $testParams.ParameterSetName + $param.Attributes[0].ValueFromPipelineByPropertyName | Should Be $testParams.ValueFromPipelineByPropertyName + $param.Attributes[0].HelpMessage | Should Be $testParams.HelpMessage + } + + It 'Should set the alias attributes of the dynamic parameter' { + $param.Attributes[1].AliasNames | Should Be $testParams.AliasName + } + + It 'Should set the possible vaule attributes of the dynamic parameter' { + (Compare-Object -ReferenceObject $param.Attributes[2].ValidValues -DifferenceObject $testParams.arrSet) | Should BeNullOrEmpty + } + } + + Context '_buildDynamicParam defaults' { + Mock _getProjects { return ConvertFrom-Json '["Demo", "Universal"]' } + + $param = (_buildDynamicParam) + + It 'should return dynamic parameter' { + $param | Should Not BeNullOrEmpty + } + + It 'should return dynamic parameter name' { + $param.Name | Should Be 'QueueName' + } + + It 'should return dynamic parameter type' { + $param.ParameterType.FullName | Should Be ([string]).FullName + } + + It 'Should set the basic attributes of the dynamic parameter' { + ($param.Attributes[0].Position -lt 0) | Should Be ($true) + $param.Attributes[0].Mandatory | Should Be $false + $param.Attributes[0].ParameterSetName | Should Be '__AllParameterSets' + $param.Attributes[0].ValueFromPipelineByPropertyName | Should Be $true + $param.Attributes[0].HelpMessage | Should BeNullOrEmpty + } + + It 'Should have no additoinal attributes of the dynamic parameter' { + $param.Attributes.Count | Should Be 1 + } + } + + Context '_getWorkItemTypes' { + Mock _getInstance { return $null } -Verifiable + + It 'should return empty array' { + _getWorkItemTypes -ProjectName test | Should be @() + Assert-VerifiableMock + } + } + + Context '_handleException' { + # Build a proper error + $obj = "{Value: {Message: 'Top Message'}, Exception: {Message: 'Test Exception', Response: { StatusCode: '401'}}}" + + if ($PSVersionTable.PSEdition -ne 'Core') { + $r = [System.Net.HttpWebResponse]::new() + $e = [System.Net.WebException]::new("Test Exception", $null, [System.Net.WebExceptionStatus]::ProtocolError, $r) + } + else { + $r = [System.Net.Http.HttpResponseMessage]::new([System.Net.HttpStatusCode]::Unauthorized) + $e = [Microsoft.PowerShell.Commands.HttpResponseException]::new("Test Exception", $r) + } + $ex = Write-Error -Exception $e 2>&1 -ErrorAction Continue + $ex.ErrorDetails = [System.Management.Automation.ErrorDetails]::new($obj) + + It 'Should Write two warnings' { + Mock Write-Warning -ParameterFilter { $Message -eq 'An error occurred: Test Exception' } -Verifiable + Mock Write-Warning -ParameterFilter { $Message -eq 'Top Message' } -Verifiable + + _handleException $ex + + Assert-VerifiableMock + } + } + + Context '_handleException should re-throw' { + $e = [System.Management.Automation.RuntimeException]::new('You must call Set-VSTeamAccount before calling any other functions in this module.') + $ex = Write-Error -Exception $e 2>&1 -ErrorAction Continue + + It 'Should throw' { + + { _handleException $ex } | Should Throw + } + } + + Context '_handleException message only' { + # Build a proper error + $obj = "{Value: {Message: 'Test Exception'}, Exception: {Message: 'Test Exception', Response: { StatusCode: '400'}}}" + + if ($PSVersionTable.PSEdition -ne 'Core') { + $e = [System.Net.WebException]::new("Test Exception", $null) + } + else { + $r = [System.Net.Http.HttpResponseMessage]::new([System.Net.HttpStatusCode]::BadRequest) + $e = [Microsoft.PowerShell.Commands.HttpResponseException]::new("Test Exception", $r) + } + + $ex = Write-Error -Exception $e 2>&1 -ErrorAction Continue + $ex.ErrorDetails = [System.Management.Automation.ErrorDetails]::new($obj) + + It 'Should Write one warnings' { + Mock Write-Warning -ParameterFilter { $Message -eq 'Test Exception' } -Verifiable + + _handleException $ex + + Assert-VerifiableMock + } + } + + Context '_isVSTS' { + It '.visualstudio.com should return true' { + _isVSTS 'https://dev.azure.com/test' | Should Be $true + } + + It '.visualstudio.com with / should return true' { + _isVSTS 'https://dev.azure.com/test/' | Should Be $true + } + + It 'https://dev.azure.com should return true' { + _isVSTS 'https://dev.azure.com/test' | Should Be $true + } + + It 'https://dev.azure.com with / should return true' { + _isVSTS 'https://dev.azure.com/test/' | Should Be $true + } + + It 'should return false' { + _isVSTS 'http://localhost:8080/tfs/defaultcollection' | Should Be $false + } + } } \ No newline at end of file diff --git a/unit/test/mocks/mockProcessNameDynamicParam.ps1 b/unit/test/mocks/mockProcessNameDynamicParam.ps1 deleted file mode 100644 index f6d2b5e43..000000000 --- a/unit/test/mocks/mockProcessNameDynamicParam.ps1 +++ /dev/null @@ -1,53 +0,0 @@ -Mock _buildProcessNameDynamicParam { - param( - # Set the dynamic parameters' name - $ParameterName = 'ProcessName', - $ParameterSetName, - $AliasName, - $Mandatory = $true - ) - - # Create the dictionary - $RuntimeParameterDictionary = New-Object System.Management.Automation.RuntimeDefinedParameterDictionary - # Create the collection of attributes - $AttributeCollection = New-Object System.Collections.ObjectModel.Collection[System.Attribute] - # Create and set the parameters' attributes - $ParameterAttribute = New-Object System.Management.Automation.ParameterAttribute - $ParameterAttribute.Mandatory = $Mandatory - $ParameterAttribute.Position = 0 - $ParameterAttribute.ParameterSetName = $ParameterSetName - $ParameterAttribute.ValueFromPipelineByPropertyName = $true - - if ($AliasName) { - $AliasAttribute = New-Object System.Management.Automation.AliasAttribute(@($AliasName)) - $AttributeCollection.Add($AliasAttribute) - } - - # Add the attributes to the attributes collection - $AttributeCollection.Add($ParameterAttribute) - # Create and return the dynamic parameter - $RuntimeParameter = New-Object System.Management.Automation.RuntimeDefinedParameter($ParameterName, [string], $AttributeCollection) - $RuntimeParameterDictionary.Add($ParameterName, $RuntimeParameter) - return $RuntimeParameterDictionary -} - -Mock _buildDynamicParam { - param( - # Set the dynamic parameters' name - $ParameterName - ) - - # Create the dictionary - $RuntimeParameterDictionary = New-Object System.Management.Automation.RuntimeDefinedParameterDictionary - # Create the collection of attributes - $AttributeCollection = New-Object System.Collections.ObjectModel.Collection[System.Attribute] - # Create and set the parameters' attributes - $ParameterAttribute = New-Object System.Management.Automation.ParameterAttribute - $ParameterAttribute.Mandatory = $false - $ParameterAttribute.Position = 1 - $ParameterAttribute.ValueFromPipelineByPropertyName = $true - # Add the attributes to the attributes collection - $AttributeCollection.Add($ParameterAttribute) - # Create and return the dynamic parameter - return New-Object System.Management.Automation.RuntimeDefinedParameter($ParameterName, [string], $AttributeCollection) -} \ No newline at end of file diff --git a/unit/test/mocks/mockProjectDynamicParam.ps1 b/unit/test/mocks/mockProjectDynamicParam.ps1 deleted file mode 100644 index ddbe81dba..000000000 --- a/unit/test/mocks/mockProjectDynamicParam.ps1 +++ /dev/null @@ -1,19 +0,0 @@ -Mock _buildProjectNameDynamicParam { - # Set the dynamic parameters' name - $ParameterName = 'Project' - # Create the dictionary - $RuntimeParameterDictionary = New-Object System.Management.Automation.RuntimeDefinedParameterDictionary - # Create the collection of attributes - $AttributeCollection = New-Object System.Collections.ObjectModel.Collection[System.Attribute] - # Create and set the parameters' attributes - $ParameterAttribute = New-Object System.Management.Automation.ParameterAttribute - $ParameterAttribute.Mandatory = $true - $ParameterAttribute.Position = 1 - $ParameterAttribute.ValueFromPipelineByPropertyName = $true - # Add the attributes to the attributes collection - $AttributeCollection.Add($ParameterAttribute) - # Create and return the dynamic parameter - $RuntimeParameter = New-Object System.Management.Automation.RuntimeDefinedParameter($ParameterName, [string], $AttributeCollection) - $RuntimeParameterDictionary.Add($ParameterName, $RuntimeParameter) - return $RuntimeParameterDictionary -} \ No newline at end of file diff --git a/unit/test/mocks/mockProjectDynamicParamMandatoryFalse.ps1 b/unit/test/mocks/mockProjectDynamicParamMandatoryFalse.ps1 deleted file mode 100644 index 8ed07bb1b..000000000 --- a/unit/test/mocks/mockProjectDynamicParamMandatoryFalse.ps1 +++ /dev/null @@ -1,19 +0,0 @@ -Mock _buildProjectNameDynamicParam { - # Set the dynamic parameters' name - $ParameterName = 'Project' - # Create the dictionary - $RuntimeParameterDictionary = New-Object System.Management.Automation.RuntimeDefinedParameterDictionary - # Create the collection of attributes - $AttributeCollection = New-Object System.Collections.ObjectModel.Collection[System.Attribute] - # Create and set the parameters' attributes - $ParameterAttribute = New-Object System.Management.Automation.ParameterAttribute - $ParameterAttribute.Mandatory = $false - $ParameterAttribute.Position = 1 - $ParameterAttribute.ValueFromPipelineByPropertyName = $true - # Add the attributes to the attributes collection - $AttributeCollection.Add($ParameterAttribute) - # Create and return the dynamic parameter - $RuntimeParameter = New-Object System.Management.Automation.RuntimeDefinedParameter($ParameterName, [string], $AttributeCollection) - $RuntimeParameterDictionary.Add($ParameterName, $RuntimeParameter) - return $RuntimeParameterDictionary -} \ No newline at end of file diff --git a/unit/test/mocks/mockProjectNameDynamicParam.ps1 b/unit/test/mocks/mockProjectNameDynamicParam.ps1 deleted file mode 100644 index 54c6ae85e..000000000 --- a/unit/test/mocks/mockProjectNameDynamicParam.ps1 +++ /dev/null @@ -1,53 +0,0 @@ -Mock _buildProjectNameDynamicParam { - param( - # Set the dynamic parameters' name - $ParameterName = 'ProjectName', - $ParameterSetName, - $AliasName, - $Mandatory = $true - ) - - # Create the dictionary - $RuntimeParameterDictionary = New-Object System.Management.Automation.RuntimeDefinedParameterDictionary - # Create the collection of attributes - $AttributeCollection = New-Object System.Collections.ObjectModel.Collection[System.Attribute] - # Create and set the parameters' attributes - $ParameterAttribute = New-Object System.Management.Automation.ParameterAttribute - $ParameterAttribute.Mandatory = $Mandatory - $ParameterAttribute.Position = 0 - $ParameterAttribute.ParameterSetName = $ParameterSetName - $ParameterAttribute.ValueFromPipelineByPropertyName = $true - - if ($AliasName) { - $AliasAttribute = New-Object System.Management.Automation.AliasAttribute(@($AliasName)) - $AttributeCollection.Add($AliasAttribute) - } - - # Add the attributes to the attributes collection - $AttributeCollection.Add($ParameterAttribute) - # Create and return the dynamic parameter - $RuntimeParameter = New-Object System.Management.Automation.RuntimeDefinedParameter($ParameterName, [string], $AttributeCollection) - $RuntimeParameterDictionary.Add($ParameterName, $RuntimeParameter) - return $RuntimeParameterDictionary -} - -Mock _buildDynamicParam { - param( - # Set the dynamic parameters' name - $ParameterName - ) - - # Create the dictionary - $RuntimeParameterDictionary = New-Object System.Management.Automation.RuntimeDefinedParameterDictionary - # Create the collection of attributes - $AttributeCollection = New-Object System.Collections.ObjectModel.Collection[System.Attribute] - # Create and set the parameters' attributes - $ParameterAttribute = New-Object System.Management.Automation.ParameterAttribute - $ParameterAttribute.Mandatory = $false - $ParameterAttribute.Position = 1 - $ParameterAttribute.ValueFromPipelineByPropertyName = $true - # Add the attributes to the attributes collection - $AttributeCollection.Add($ParameterAttribute) - # Create and return the dynamic parameter - return New-Object System.Management.Automation.RuntimeDefinedParameter($ParameterName, [string], $AttributeCollection) -} \ No newline at end of file diff --git a/unit/test/mocks/mockProjectNameDynamicParamNoPSet.ps1 b/unit/test/mocks/mockProjectNameDynamicParamNoPSet.ps1 deleted file mode 100644 index 77e93a220..000000000 --- a/unit/test/mocks/mockProjectNameDynamicParamNoPSet.ps1 +++ /dev/null @@ -1,41 +0,0 @@ -Mock _buildProjectNameDynamicParam { - param( - $Mandatory = $true - ) - # Set the dynamic parameters' name - $ParameterName = 'ProjectName' - # Create the dictionary - $RuntimeParameterDictionary = New-Object System.Management.Automation.RuntimeDefinedParameterDictionary - # Create the collection of attributes - $AttributeCollection = New-Object System.Collections.ObjectModel.Collection[System.Attribute] - # Create and set the parameters' attributes - $ParameterAttribute = New-Object System.Management.Automation.ParameterAttribute - $ParameterAttribute.Mandatory = $Mandatory - $ParameterAttribute.Position = 0 - $ParameterAttribute.ValueFromPipelineByPropertyName = $true - # Add the attributes to the attributes collection - $AttributeCollection.Add($ParameterAttribute) - # Create and return the dynamic parameter - $RuntimeParameter = New-Object System.Management.Automation.RuntimeDefinedParameter($ParameterName, [string], $AttributeCollection) - $RuntimeParameterDictionary.Add($ParameterName, $RuntimeParameter) - return $RuntimeParameterDictionary -} - -Mock _buildDynamicParam { - param( - # Set the dynamic parameters' name - $ParameterName - ) - - # Create the collection of attributes - $AttributeCollection = New-Object System.Collections.ObjectModel.Collection[System.Attribute] - # Create and set the parameters' attributes - $ParameterAttribute = New-Object System.Management.Automation.ParameterAttribute - $ParameterAttribute.Mandatory = $false - $ParameterAttribute.Position = 1 - $ParameterAttribute.ValueFromPipelineByPropertyName = $true - # Add the attributes to the attributes collection - $AttributeCollection.Add($ParameterAttribute) - # Create and return the dynamic parameter - return New-Object System.Management.Automation.RuntimeDefinedParameter($ParameterName, [string], $AttributeCollection) -} \ No newline at end of file diff --git a/unit/test/sampleFiles/accessControlEntryResult.json b/unit/test/sampleFiles/accessControlEntryResult.json index d774be4a5..577be22f2 100644 --- a/unit/test/sampleFiles/accessControlEntryResult.json +++ b/unit/test/sampleFiles/accessControlEntryResult.json @@ -5,7 +5,9 @@ "descriptor": "Microsoft.TeamFoundation.Identity;S-1-9-1551374245-1204400969-2402986413-2179408616-0-0-0-0-1", "allow": 8, "deny": 0, - "extendedInfo": {} + "extendedInfo": { + "message": "Hello World" + } } ] } \ No newline at end of file diff --git a/unit/test/sampleFiles/get-vsteam.json b/unit/test/sampleFiles/get-vsteam.json new file mode 100644 index 000000000..bd7757b6a --- /dev/null +++ b/unit/test/sampleFiles/get-vsteam.json @@ -0,0 +1,9 @@ +{ + "id": "00000000-0000-0000-0000-000000000000", + "name": "Project Team", + "url": "https://dev.azure.com/Project/_apis/projects/00000000-0000-0000-0000-000000000000/teams/00000000-0000-0000-0000-000000000000", + "description": "The default project team.", + "identityUrl": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "projectName": "Project", + "projectId": "00000000-0000-0000-0000-000000000000" +} diff --git a/unit/test/sampleFiles/get-vsteambuild.json b/unit/test/sampleFiles/get-vsteambuild.json new file mode 100644 index 000000000..090b390a6 --- /dev/null +++ b/unit/test/sampleFiles/get-vsteambuild.json @@ -0,0 +1,2069 @@ +{ + "count": 15, + "value": [ + { + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/568" + }, + "web": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/results?buildId=568" + }, + "sourceVersionDisplayUri": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/sources" + }, + "timeline": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/Timeline" + }, + "badge": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/23" + } + }, + "properties": {}, + "tags": [], + "validationResults": [], + "plans": [ + { + "planId": "00000000-0000-0000-0000-000000000000" + } + ], + "triggerInfo": {}, + "id": 568, + "buildNumber": "568", + "status": "completed", + "result": "succeeded", + "queueTime": "2019-11-14T00:49:33.4869922Z", + "startTime": "2019-11-14T00:49:37.916511Z", + "finishTime": "2019-11-14T00:56:02.1824107Z", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/568", + "definition": { + "drafts": [], + "id": 23, + "name": "PTracker-CI", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/23?revision=163", + "uri": "vstfs:///Build/Definition/23", + "path": "\\", + "type": "build", + "queueStatus": "enabled", + "revision": 163, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + } + }, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + }, + "uri": "vstfs:///Build/Build/568", + "sourceBranch": "refs/heads/master", + "sourceVersion": "4aed57b05fb1840a916ed7aca0d2b81784b916be", + "queue": { + "id": 81, + "name": "Default", + "pool": { + "id": 1, + "name": "Default" + } + }, + "priority": "normal", + "reason": "manual", + "requestedFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@fakedomain.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "requestedBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@fakedomain.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "lastChangedDate": "2019-11-14T00:56:14.133Z", + "lastChangedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted", + "descriptor": "s2s.redacted" + }, + "parameters": "{\"subscriptionId\":\"00000000-0000-0000-0000-000000000000\",\"system.debug\":\"false\"}", + "orchestrationPlan": { + "planId": "00000000-0000-0000-0000-000000000000" + }, + "logs": { + "id": 0, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs" + }, + "repository": { + "id": "00000000-0000-0000-0000-000000000000", + "type": "TfsGit", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", + "clean": null, + "checkoutSubmodules": false + }, + "keepForever": true, + "retainedByRelease": true, + "triggeredByBuild": null + }, + { + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/567" + }, + "web": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/results?buildId=567" + }, + "sourceVersionDisplayUri": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/567/sources" + }, + "timeline": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/567/Timeline" + }, + "badge": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/35" + } + }, + "properties": {}, + "tags": [], + "validationResults": [], + "plans": [ + { + "planId": "00000000-0000-0000-0000-000000000000" + } + ], + "triggerInfo": {}, + "id": 567, + "buildNumber": "567", + "status": "completed", + "result": "succeeded", + "queueTime": "2019-11-13T22:57:31.1366485Z", + "startTime": "2019-11-13T22:57:35.3378265Z", + "finishTime": "2019-11-13T23:01:48.4753281Z", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/567", + "definition": { + "drafts": [], + "id": 35, + "name": "PTracker-CI-NoMobile", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/35?revision=7", + "uri": "vstfs:///Build/Definition/35", + "path": "\\", + "type": "build", + "queueStatus": "enabled", + "revision": 7, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + } + }, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + }, + "uri": "vstfs:///Build/Build/567", + "sourceBranch": "refs/heads/master", + "sourceVersion": "4aed57b05fb1840a916ed7aca0d2b81784b916be", + "queue": { + "id": 81, + "name": "Default", + "pool": { + "id": 1, + "name": "Default" + } + }, + "priority": "normal", + "reason": "manual", + "requestedFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@fakedomain.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "requestedBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@fakedomain.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "lastChangedDate": "2019-11-13T23:02:00.413Z", + "lastChangedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted", + "descriptor": "s2s.redacted" + }, + "parameters": "{\"subscriptionId\":\"00000000-0000-0000-0000-000000000000\",\"system.debug\":\"false\"}", + "orchestrationPlan": { + "planId": "00000000-0000-0000-0000-000000000000" + }, + "logs": { + "id": 0, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/567/logs" + }, + "repository": { + "id": "00000000-0000-0000-0000-000000000000", + "type": "TfsGit", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", + "clean": null, + "checkoutSubmodules": false + }, + "keepForever": true, + "retainedByRelease": true, + "triggeredByBuild": null + }, + { + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/561" + }, + "web": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/results?buildId=561" + }, + "sourceVersionDisplayUri": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/561/sources" + }, + "timeline": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/561/Timeline" + }, + "badge": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/23" + } + }, + "properties": {}, + "tags": [], + "validationResults": [], + "plans": [ + { + "planId": "00000000-0000-0000-0000-000000000000" + } + ], + "triggerInfo": {}, + "id": 561, + "buildNumber": "561", + "status": "completed", + "result": "succeeded", + "queueTime": "2019-09-24T09:47:50.3503432Z", + "startTime": "2019-09-24T09:47:55.8261537Z", + "finishTime": "2019-09-24T09:54:09.609426Z", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/561", + "definition": { + "drafts": [], + "id": 23, + "name": "PTracker-CI", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/23?revision=163", + "uri": "vstfs:///Build/Definition/23", + "path": "\\", + "type": "build", + "queueStatus": "enabled", + "revision": 163, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + } + }, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + }, + "uri": "vstfs:///Build/Build/561", + "sourceBranch": "refs/heads/master", + "sourceVersion": "4aed57b05fb1840a916ed7aca0d2b81784b916be", + "queue": { + "id": 81, + "name": "Default", + "pool": { + "id": 1, + "name": "Default" + } + }, + "priority": "normal", + "reason": "manual", + "requestedFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@fakedomain.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "requestedBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@fakedomain.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "lastChangedDate": "2019-09-24T09:54:22.31Z", + "lastChangedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted", + "descriptor": "s2s.redacted" + }, + "parameters": "{\"subscriptionId\":\"00000000-0000-0000-0000-000000000000\",\"system.debug\":\"false\"}", + "orchestrationPlan": { + "planId": "00000000-0000-0000-0000-000000000000" + }, + "logs": { + "id": 0, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/561/logs" + }, + "repository": { + "id": "00000000-0000-0000-0000-000000000000", + "type": "TfsGit", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", + "clean": null, + "checkoutSubmodules": false + }, + "keepForever": false, + "retainedByRelease": true, + "triggeredByBuild": null + }, + { + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/560" + }, + "web": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/results?buildId=560" + }, + "sourceVersionDisplayUri": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/560/sources" + }, + "timeline": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/560/Timeline" + }, + "badge": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/23" + } + }, + "properties": {}, + "tags": [], + "validationResults": [], + "plans": [ + { + "planId": "00000000-0000-0000-0000-000000000000" + } + ], + "triggerInfo": {}, + "id": 560, + "buildNumber": "560", + "status": "completed", + "result": "succeeded", + "queueTime": "2019-09-16T14:07:31.5444889Z", + "startTime": "2019-09-16T14:07:36.8564926Z", + "finishTime": "2019-09-16T14:13:54.1086977Z", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/560", + "definition": { + "drafts": [], + "id": 23, + "name": "PTracker-CI", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/23?revision=163", + "uri": "vstfs:///Build/Definition/23", + "path": "\\", + "type": "build", + "queueStatus": "enabled", + "revision": 163, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + } + }, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + }, + "uri": "vstfs:///Build/Build/560", + "sourceBranch": "refs/heads/master", + "sourceVersion": "4aed57b05fb1840a916ed7aca0d2b81784b916be", + "queue": { + "id": 81, + "name": "Default", + "pool": { + "id": 1, + "name": "Default" + } + }, + "priority": "normal", + "reason": "individualCI", + "requestedFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@fakedomain.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "requestedBy": { + "displayName": "Microsoft.VisualStudio.Services.TFS", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted", + "descriptor": "s2s.redacted" + }, + "lastChangedDate": "2019-09-16T14:14:07.007Z", + "lastChangedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted", + "descriptor": "s2s.redacted" + }, + "orchestrationPlan": { + "planId": "00000000-0000-0000-0000-000000000000" + }, + "logs": { + "id": 0, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/560/logs" + }, + "repository": { + "id": "00000000-0000-0000-0000-000000000000", + "type": "TfsGit", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", + "clean": null, + "checkoutSubmodules": false + }, + "keepForever": false, + "retainedByRelease": true, + "triggeredByBuild": null + }, + { + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/559" + }, + "web": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/results?buildId=559" + }, + "sourceVersionDisplayUri": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/559/sources" + }, + "timeline": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/559/Timeline" + }, + "badge": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/23" + } + }, + "properties": {}, + "tags": [], + "validationResults": [], + "plans": [ + { + "planId": "00000000-0000-0000-0000-000000000000" + } + ], + "triggerInfo": {}, + "id": 559, + "buildNumber": "559", + "status": "completed", + "result": "succeeded", + "queueTime": "2019-09-16T13:34:59.7905462Z", + "startTime": "2019-09-16T13:35:06.5445281Z", + "finishTime": "2019-09-16T13:41:24.5546558Z", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/559", + "definition": { + "drafts": [], + "id": 23, + "name": "PTracker-CI", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/23?revision=163", + "uri": "vstfs:///Build/Definition/23", + "path": "\\", + "type": "build", + "queueStatus": "enabled", + "revision": 163, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + } + }, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + }, + "uri": "vstfs:///Build/Build/559", + "sourceBranch": "refs/heads/master", + "sourceVersion": "b3ffb9a7c9c4a3d78da50c581aaaf3fc708d1b6c", + "queue": { + "id": 81, + "name": "Default", + "pool": { + "id": 1, + "name": "Default" + } + }, + "priority": "normal", + "reason": "individualCI", + "requestedFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@fakedomain.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "requestedBy": { + "displayName": "Microsoft.VisualStudio.Services.TFS", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted", + "descriptor": "s2s.redacted" + }, + "lastChangedDate": "2019-09-16T13:41:36.677Z", + "lastChangedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted", + "descriptor": "s2s.redacted" + }, + "orchestrationPlan": { + "planId": "00000000-0000-0000-0000-000000000000" + }, + "logs": { + "id": 0, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/559/logs" + }, + "repository": { + "id": "00000000-0000-0000-0000-000000000000", + "type": "TfsGit", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", + "clean": null, + "checkoutSubmodules": false + }, + "keepForever": false, + "retainedByRelease": true, + "triggeredByBuild": null + }, + { + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/439" + }, + "web": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/results?buildId=439" + }, + "sourceVersionDisplayUri": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/439/sources" + }, + "timeline": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/439/Timeline" + }, + "badge": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/23" + } + }, + "properties": {}, + "tags": [], + "validationResults": [], + "plans": [ + { + "planId": "00000000-0000-0000-0000-000000000000" + } + ], + "triggerInfo": {}, + "id": 439, + "buildNumber": "439", + "status": "completed", + "result": "succeeded", + "queueTime": "2019-08-11T01:39:00.0335414Z", + "startTime": "2019-08-11T01:39:04.0259789Z", + "finishTime": "2019-08-11T01:45:15.9902888Z", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/439", + "definition": { + "drafts": [], + "id": 23, + "name": "PTracker-CI", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/23?revision=160", + "uri": "vstfs:///Build/Definition/23", + "path": "\\", + "type": "build", + "queueStatus": "enabled", + "revision": 160, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + } + }, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + }, + "uri": "vstfs:///Build/Build/439", + "sourceBranch": "refs/heads/master", + "sourceVersion": "3675df748e52db693ee212753e55f1c7dbf8d5cb", + "queue": { + "id": 81, + "name": "Default", + "pool": { + "id": 1, + "name": "Default" + } + }, + "priority": "normal", + "reason": "manual", + "requestedFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@fakedomain.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "requestedBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@fakedomain.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "lastChangedDate": "2019-08-11T01:45:27.513Z", + "lastChangedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted", + "descriptor": "s2s.redacted" + }, + "parameters": "{\"subscriptionId\":\"00000000-0000-0000-0000-000000000000\",\"system.debug\":\"false\"}", + "orchestrationPlan": { + "planId": "00000000-0000-0000-0000-000000000000" + }, + "logs": { + "id": 0, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/439/logs" + }, + "repository": { + "id": "00000000-0000-0000-0000-000000000000", + "type": "TfsGit", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", + "clean": null, + "checkoutSubmodules": false + }, + "keepForever": false, + "retainedByRelease": true, + "triggeredByBuild": null + }, + { + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/437" + }, + "web": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/results?buildId=437" + }, + "sourceVersionDisplayUri": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/437/sources" + }, + "timeline": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/437/Timeline" + }, + "badge": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/35" + } + }, + "properties": {}, + "tags": [], + "validationResults": [], + "plans": [ + { + "planId": "00000000-0000-0000-0000-000000000000" + } + ], + "triggerInfo": {}, + "id": 437, + "buildNumber": "437", + "status": "completed", + "result": "succeeded", + "queueTime": "2019-08-10T21:17:06.5166358Z", + "startTime": "2019-08-10T21:17:10.7955997Z", + "finishTime": "2019-08-10T21:20:46.9614646Z", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/437", + "definition": { + "drafts": [], + "id": 35, + "name": "PTracker-CI-NoMobile", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/35?revision=3", + "uri": "vstfs:///Build/Definition/35", + "path": "\\", + "type": "build", + "queueStatus": "enabled", + "revision": 3, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + } + }, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + }, + "uri": "vstfs:///Build/Build/437", + "sourceBranch": "refs/heads/master", + "sourceVersion": "3675df748e52db693ee212753e55f1c7dbf8d5cb", + "queue": { + "id": 81, + "name": "Default", + "pool": { + "id": 1, + "name": "Default" + } + }, + "priority": "normal", + "reason": "individualCI", + "requestedFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@fakedomain.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "requestedBy": { + "displayName": "Microsoft.VisualStudio.Services.TFS", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted", + "descriptor": "s2s.redacted" + }, + "lastChangedDate": "2019-08-10T21:20:57.987Z", + "lastChangedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted", + "descriptor": "s2s.redacted" + }, + "orchestrationPlan": { + "planId": "00000000-0000-0000-0000-000000000000" + }, + "logs": { + "id": 0, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/437/logs" + }, + "repository": { + "id": "00000000-0000-0000-0000-000000000000", + "type": "TfsGit", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", + "clean": null, + "checkoutSubmodules": false + }, + "keepForever": false, + "retainedByRelease": true, + "triggeredByBuild": null + }, + { + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/436" + }, + "web": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/results?buildId=436" + }, + "sourceVersionDisplayUri": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/436/sources" + }, + "timeline": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/436/Timeline" + }, + "badge": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/35" + } + }, + "properties": {}, + "tags": [], + "validationResults": [], + "plans": [ + { + "planId": "00000000-0000-0000-0000-000000000000" + } + ], + "triggerInfo": {}, + "id": 436, + "buildNumber": "436", + "status": "completed", + "result": "succeeded", + "queueTime": "2019-08-10T20:24:49.2169814Z", + "startTime": "2019-08-10T20:24:53.4360947Z", + "finishTime": "2019-08-10T20:28:23.7547621Z", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/436", + "definition": { + "drafts": [], + "id": 35, + "name": "PTracker-CI-NoMobile", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/35?revision=3", + "uri": "vstfs:///Build/Definition/35", + "path": "\\", + "type": "build", + "queueStatus": "enabled", + "revision": 3, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + } + }, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + }, + "uri": "vstfs:///Build/Build/436", + "sourceBranch": "refs/heads/master", + "sourceVersion": "704daae62cc0b089d766e252b4b1b6d5df5e8cc7", + "queue": { + "id": 81, + "name": "Default", + "pool": { + "id": 1, + "name": "Default" + } + }, + "priority": "normal", + "reason": "individualCI", + "requestedFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@fakedomain.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "requestedBy": { + "displayName": "Microsoft.VisualStudio.Services.TFS", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted", + "descriptor": "s2s.redacted" + }, + "lastChangedDate": "2019-08-10T20:28:35.323Z", + "lastChangedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted", + "descriptor": "s2s.redacted" + }, + "orchestrationPlan": { + "planId": "00000000-0000-0000-0000-000000000000" + }, + "logs": { + "id": 0, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/436/logs" + }, + "repository": { + "id": "00000000-0000-0000-0000-000000000000", + "type": "TfsGit", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", + "clean": null, + "checkoutSubmodules": false + }, + "keepForever": false, + "retainedByRelease": true, + "triggeredByBuild": null + }, + { + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/435" + }, + "web": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/results?buildId=435" + }, + "sourceVersionDisplayUri": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/435/sources" + }, + "timeline": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/435/Timeline" + }, + "badge": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/35" + } + }, + "properties": {}, + "tags": [], + "validationResults": [], + "plans": [ + { + "planId": "00000000-0000-0000-0000-000000000000" + } + ], + "triggerInfo": {}, + "id": 435, + "buildNumber": "435", + "status": "completed", + "result": "succeeded", + "queueTime": "2019-08-10T19:43:50.8088667Z", + "startTime": "2019-08-10T19:43:54.8276414Z", + "finishTime": "2019-08-10T19:47:46.4447025Z", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/435", + "definition": { + "drafts": [], + "id": 35, + "name": "PTracker-CI-NoMobile", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/35?revision=3", + "uri": "vstfs:///Build/Definition/35", + "path": "\\", + "type": "build", + "queueStatus": "enabled", + "revision": 3, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + } + }, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + }, + "uri": "vstfs:///Build/Build/435", + "sourceBranch": "refs/heads/master", + "sourceVersion": "ad4c7ac13f391de1b3578c626b552cf0c989362b", + "queue": { + "id": 81, + "name": "Default", + "pool": { + "id": 1, + "name": "Default" + } + }, + "priority": "normal", + "reason": "individualCI", + "requestedFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@fakedomain.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "requestedBy": { + "displayName": "Microsoft.VisualStudio.Services.TFS", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted", + "descriptor": "s2s.redacted" + }, + "lastChangedDate": "2019-08-10T19:47:57.407Z", + "lastChangedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted", + "descriptor": "s2s.redacted" + }, + "orchestrationPlan": { + "planId": "00000000-0000-0000-0000-000000000000" + }, + "logs": { + "id": 0, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/435/logs" + }, + "repository": { + "id": "00000000-0000-0000-0000-000000000000", + "type": "TfsGit", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", + "clean": null, + "checkoutSubmodules": false + }, + "keepForever": false, + "retainedByRelease": true, + "triggeredByBuild": null + }, + { + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/434" + }, + "web": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/results?buildId=434" + }, + "sourceVersionDisplayUri": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/434/sources" + }, + "timeline": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/434/Timeline" + }, + "badge": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/35" + } + }, + "properties": {}, + "tags": [], + "validationResults": [], + "plans": [ + { + "planId": "00000000-0000-0000-0000-000000000000" + } + ], + "triggerInfo": {}, + "id": 434, + "buildNumber": "434", + "status": "completed", + "result": "succeeded", + "queueTime": "2019-08-10T18:22:36.8537588Z", + "startTime": "2019-08-10T18:22:40.7924134Z", + "finishTime": "2019-08-10T18:26:11.4338339Z", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/434", + "definition": { + "drafts": [], + "id": 35, + "name": "PTracker-CI-NoMobile", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/35?revision=3", + "uri": "vstfs:///Build/Definition/35", + "path": "\\", + "type": "build", + "queueStatus": "enabled", + "revision": 3, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + } + }, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + }, + "uri": "vstfs:///Build/Build/434", + "sourceBranch": "refs/heads/master", + "sourceVersion": "d053f177ccb502742f59fa82a83fd62c03049ab2", + "queue": { + "id": 81, + "name": "Default", + "pool": { + "id": 1, + "name": "Default" + } + }, + "priority": "normal", + "reason": "individualCI", + "requestedFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@fakedomain.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "requestedBy": { + "displayName": "Microsoft.VisualStudio.Services.TFS", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted", + "descriptor": "s2s.redacted" + }, + "lastChangedDate": "2019-08-10T18:26:21.677Z", + "lastChangedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted", + "descriptor": "s2s.redacted" + }, + "orchestrationPlan": { + "planId": "00000000-0000-0000-0000-000000000000" + }, + "logs": { + "id": 0, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/434/logs" + }, + "repository": { + "id": "00000000-0000-0000-0000-000000000000", + "type": "TfsGit", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", + "clean": null, + "checkoutSubmodules": false + }, + "keepForever": false, + "retainedByRelease": true, + "triggeredByBuild": null + }, + { + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/378" + }, + "web": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/results?buildId=378" + }, + "sourceVersionDisplayUri": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/378/sources" + }, + "timeline": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/378/Timeline" + }, + "badge": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/23" + } + }, + "properties": {}, + "tags": [], + "validationResults": [], + "plans": [ + { + "planId": "00000000-0000-0000-0000-000000000000" + } + ], + "triggerInfo": {}, + "id": 378, + "buildNumber": "378", + "status": "completed", + "result": "succeeded", + "queueTime": "2019-07-21T11:13:16.3812613Z", + "startTime": "2019-07-21T11:13:20.271675Z", + "finishTime": "2019-07-21T11:19:35.6806252Z", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/378", + "definition": { + "drafts": [], + "id": 23, + "name": "PTracker-CI", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/23?revision=139", + "uri": "vstfs:///Build/Definition/23", + "path": "\\", + "type": "build", + "queueStatus": "enabled", + "revision": 139, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + } + }, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + }, + "uri": "vstfs:///Build/Build/378", + "sourceBranch": "refs/heads/ai", + "sourceVersion": "dcfa73e5ba9902d9418d8e95f1b6109866288bca", + "queue": { + "id": 81, + "name": "Default", + "pool": { + "id": 1, + "name": "Default" + } + }, + "priority": "normal", + "reason": "manual", + "requestedFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@fakedomain.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "requestedBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@fakedomain.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "lastChangedDate": "2019-07-21T11:19:46.37Z", + "lastChangedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted", + "descriptor": "s2s.redacted" + }, + "parameters": "{\"subscriptionId\":\"00000000-0000-0000-0000-000000000000\",\"system.debug\":\"false\"}", + "orchestrationPlan": { + "planId": "00000000-0000-0000-0000-000000000000" + }, + "logs": { + "id": 0, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/378/logs" + }, + "repository": { + "id": "00000000-0000-0000-0000-000000000000", + "type": "TfsGit", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", + "clean": null, + "checkoutSubmodules": false + }, + "keepForever": false, + "retainedByRelease": true, + "triggeredByBuild": null + }, + { + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/375" + }, + "web": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/results?buildId=375" + }, + "sourceVersionDisplayUri": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/375/sources" + }, + "timeline": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/375/Timeline" + }, + "badge": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/23" + } + }, + "properties": {}, + "tags": [], + "validationResults": [], + "plans": [ + { + "planId": "00000000-0000-0000-0000-000000000000" + } + ], + "triggerInfo": {}, + "id": 375, + "buildNumber": "375", + "status": "completed", + "result": "succeeded", + "queueTime": "2019-07-20T06:07:42.8970532Z", + "startTime": "2019-07-20T06:07:46.2556853Z", + "finishTime": "2019-07-20T06:13:45.7807549Z", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/375", + "definition": { + "drafts": [], + "id": 23, + "name": "PTracker-CI", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/23?revision=139", + "uri": "vstfs:///Build/Definition/23", + "path": "\\", + "type": "build", + "queueStatus": "enabled", + "revision": 139, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + } + }, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + }, + "uri": "vstfs:///Build/Build/375", + "sourceBranch": "refs/heads/ai", + "sourceVersion": "3fd0eda7ed7a9b07d67059cf2b1a41f97b28342d", + "queue": { + "id": 81, + "name": "Default", + "pool": { + "id": 1, + "name": "Default" + } + }, + "priority": "normal", + "reason": "manual", + "requestedFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@fakedomain.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "requestedBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@fakedomain.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "lastChangedDate": "2019-07-20T06:13:55.08Z", + "lastChangedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted", + "descriptor": "s2s.redacted" + }, + "parameters": "{\"subscriptionId\":\"00000000-0000-0000-0000-000000000000\",\"system.debug\":\"false\"}", + "orchestrationPlan": { + "planId": "00000000-0000-0000-0000-000000000000" + }, + "logs": { + "id": 0, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/375/logs" + }, + "repository": { + "id": "00000000-0000-0000-0000-000000000000", + "type": "TfsGit", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", + "clean": null, + "checkoutSubmodules": false + }, + "keepForever": false, + "retainedByRelease": true, + "triggeredByBuild": null + }, + { + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/374" + }, + "web": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/results?buildId=374" + }, + "sourceVersionDisplayUri": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/374/sources" + }, + "timeline": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/374/Timeline" + }, + "badge": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/23" + } + }, + "properties": {}, + "tags": [], + "validationResults": [], + "plans": [ + { + "planId": "00000000-0000-0000-0000-000000000000" + } + ], + "triggerInfo": {}, + "id": 374, + "buildNumber": "374", + "status": "completed", + "result": "succeeded", + "queueTime": "2019-07-20T05:44:18.9264275Z", + "startTime": "2019-07-20T05:44:22.0483519Z", + "finishTime": "2019-07-20T05:50:26.895186Z", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/374", + "definition": { + "drafts": [], + "id": 23, + "name": "PTracker-CI", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/23?revision=139", + "uri": "vstfs:///Build/Definition/23", + "path": "\\", + "type": "build", + "queueStatus": "enabled", + "revision": 139, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + } + }, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + }, + "uri": "vstfs:///Build/Build/374", + "sourceBranch": "refs/heads/ai", + "sourceVersion": "ea7e90eb93a52b638d8e36035f42bf3779df8572", + "queue": { + "id": 81, + "name": "Default", + "pool": { + "id": 1, + "name": "Default" + } + }, + "priority": "normal", + "reason": "manual", + "requestedFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@fakedomain.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "requestedBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@fakedomain.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "lastChangedDate": "2019-07-20T05:50:36.777Z", + "lastChangedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted", + "descriptor": "s2s.redacted" + }, + "parameters": "{\"subscriptionId\":\"00000000-0000-0000-0000-000000000000\",\"system.debug\":\"false\"}", + "orchestrationPlan": { + "planId": "00000000-0000-0000-0000-000000000000" + }, + "logs": { + "id": 0, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/374/logs" + }, + "repository": { + "id": "00000000-0000-0000-0000-000000000000", + "type": "TfsGit", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", + "clean": null, + "checkoutSubmodules": false + }, + "keepForever": false, + "retainedByRelease": true, + "triggeredByBuild": null + }, + { + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/360" + }, + "web": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/results?buildId=360" + }, + "sourceVersionDisplayUri": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/360/sources" + }, + "timeline": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/360/Timeline" + }, + "badge": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/23" + } + }, + "properties": {}, + "tags": [], + "validationResults": [], + "plans": [ + { + "planId": "00000000-0000-0000-0000-000000000000" + } + ], + "triggerInfo": {}, + "id": 360, + "buildNumber": "360", + "status": "completed", + "result": "succeeded", + "queueTime": "2019-07-18T12:56:22.3506669Z", + "startTime": "2019-07-18T12:56:25.8594256Z", + "finishTime": "2019-07-18T13:05:08.4010842Z", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/360", + "definition": { + "drafts": [], + "id": 23, + "name": "PTracker-CI", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/23?revision=138", + "uri": "vstfs:///Build/Definition/23", + "path": "\\", + "type": "build", + "queueStatus": "enabled", + "revision": 138, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + } + }, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + }, + "uri": "vstfs:///Build/Build/360", + "sourceBranch": "refs/heads/ai", + "sourceVersion": "cada3319a0970da5028d37adf65bb226db53724f", + "queue": { + "id": 81, + "name": "Default", + "pool": { + "id": 1, + "name": "Default" + } + }, + "priority": "normal", + "reason": "manual", + "requestedFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@fakedomain.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "requestedBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@fakedomain.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "lastChangedDate": "2019-07-18T13:05:20.217Z", + "lastChangedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted", + "descriptor": "s2s.redacted" + }, + "parameters": "{\"subscriptionId\":\"00000000-0000-0000-0000-000000000000\",\"system.debug\":\"false\"}", + "orchestrationPlan": { + "planId": "00000000-0000-0000-0000-000000000000" + }, + "logs": { + "id": 0, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/360/logs" + }, + "repository": { + "id": "00000000-0000-0000-0000-000000000000", + "type": "TfsGit", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", + "clean": null, + "checkoutSubmodules": false + }, + "keepForever": false, + "retainedByRelease": true, + "triggeredByBuild": null + }, + { + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/358" + }, + "web": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/results?buildId=358" + }, + "sourceVersionDisplayUri": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/358/sources" + }, + "timeline": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/358/Timeline" + }, + "badge": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/23" + } + }, + "properties": {}, + "tags": [], + "validationResults": [], + "plans": [ + { + "planId": "00000000-0000-0000-0000-000000000000" + } + ], + "triggerInfo": {}, + "id": 358, + "buildNumber": "358", + "status": "completed", + "result": "succeeded", + "queueTime": "2019-07-13T15:43:12.8662868Z", + "startTime": "2019-07-13T15:43:17.087519Z", + "finishTime": "2019-07-13T15:49:25.7371406Z", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/358", + "definition": { + "drafts": [], + "id": 23, + "name": "PTracker-CI", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/23?revision=138", + "uri": "vstfs:///Build/Definition/23", + "path": "\\", + "type": "build", + "queueStatus": "enabled", + "revision": 138, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + } + }, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + }, + "uri": "vstfs:///Build/Build/358", + "sourceBranch": "refs/heads/ai", + "sourceVersion": "cada3319a0970da5028d37adf65bb226db53724f", + "queue": { + "id": 81, + "name": "Default", + "pool": { + "id": 1, + "name": "Default" + } + }, + "priority": "normal", + "reason": "manual", + "requestedFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@fakedomain.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "requestedBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@fakedomain.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "lastChangedDate": "2019-07-13T15:49:36.66Z", + "lastChangedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted", + "descriptor": "s2s.redacted" + }, + "parameters": "{\"subscriptionId\":\"00000000-0000-0000-0000-000000000000\",\"system.debug\":\"false\"}", + "orchestrationPlan": { + "planId": "00000000-0000-0000-0000-000000000000" + }, + "logs": { + "id": 0, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/358/logs" + }, + "repository": { + "id": "00000000-0000-0000-0000-000000000000", + "type": "TfsGit", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", + "clean": null, + "checkoutSubmodules": false + }, + "keepForever": false, + "retainedByRelease": true, + "triggeredByBuild": null + } + ] +} \ No newline at end of file diff --git a/unit/test/sampleFiles/get-vsteamworkitemtype.json b/unit/test/sampleFiles/get-vsteamworkitemtype.json new file mode 100644 index 000000000..dff6689f2 --- /dev/null +++ b/unit/test/sampleFiles/get-vsteamworkitemtype.json @@ -0,0 +1,14107 @@ +{ + "count": 15, + "value": [ + { + "name": "Bug", + "referenceName": "Microsoft.VSTS.WorkItemTypes.Bug", + "description": "Describes a divergence between required and actual behavior, and tracks the work done to correct the defect and verify the correction.", + "color": "CC293D", + "icon": { + "id": "icon_insect", + "url": "https://tfsprodcus3.visualstudio.com/_apis/wit/workItemIcons/icon_insect?color=CC293D&v=2" + }, + "isDisabled": false, + "xmlForm": "
", + "fields": [ + { + "defaultValue": null, + "helpText": "The iteration within which this bug will be fixed", + "alwaysRequired": false, + "referenceName": "System.IterationPath", + "name": "Iteration Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationPath" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.IterationId", + "name": "Iteration ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ExternalLinkCount", + "name": "External Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ExternalLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel7", + "name": "Iteration Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel6", + "name": "Iteration Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel5", + "name": "Iteration Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel4", + "name": "Iteration Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel3", + "name": "Iteration Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel2", + "name": "Iteration Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel1", + "name": "Iteration Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel7", + "name": "Area Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel6", + "name": "Area Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel5", + "name": "Area Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel4", + "name": "Area Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel3", + "name": "Area Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel2", + "name": "Area Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel1", + "name": "Area Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.TeamProject", + "name": "Team Project", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.TeamProject" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Parent", + "name": "Parent", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Parent" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RemoteLinkCount", + "name": "Remote Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RemoteLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CommentCount", + "name": "Comment Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CommentCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.HyperLinkCount", + "name": "Hyperlink Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.HyperLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AttachedFileCount", + "name": "Attached File Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AttachedFileCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.NodeName", + "name": "Node Name", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.NodeName" + }, + { + "defaultValue": null, + "helpText": "The area of the product with which this bug is associated", + "alwaysRequired": false, + "referenceName": "System.AreaPath", + "name": "Area Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaPath" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RevisedDate", + "name": "Revised Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RevisedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedDate", + "name": "Changed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Id", + "name": "ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Id" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.AreaId", + "name": "Area ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedAs", + "name": "Authorized As", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedAs" + }, + { + "defaultValue": null, + "helpText": "Stories affected and how", + "alwaysRequired": true, + "referenceName": "System.Title", + "name": "Title", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Title" + }, + { + "defaultValue": "New", + "helpText": "New = for triage; Active = not yet fixed; Resolved = fixed not yet verified; Closed = fix verified.", + "alwaysRequired": true, + "referenceName": "System.State", + "name": "State", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.State" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedDate", + "name": "Authorized Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Watermark", + "name": "Watermark", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Watermark" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Rev", + "name": "Rev", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Rev" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedBy", + "name": "Changed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedBy" + }, + { + "defaultValue": null, + "helpText": "The reason why the bug is in the current state", + "alwaysRequired": false, + "referenceName": "System.Reason", + "name": "Reason", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Reason" + }, + { + "defaultValue": null, + "helpText": "The person currently working on this bug", + "alwaysRequired": false, + "referenceName": "System.AssignedTo", + "name": "Assigned To", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AssignedTo" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.WorkItemType", + "name": "Work Item Type", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.WorkItemType" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedDate", + "name": "Created Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedBy", + "name": "Created By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Description", + "name": "Description", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Description" + }, + { + "defaultValue": null, + "helpText": "Discussion thread plus automatic record of changes", + "alwaysRequired": false, + "referenceName": "System.History", + "name": "History", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.History" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RelatedLinkCount", + "name": "Related Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RelatedLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Tags", + "name": "Tags", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Tags" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumn", + "name": "Board Column", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumn" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumnDone", + "name": "Board Column Done", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumnDone" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardLane", + "name": "Board Lane", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardLane" + }, + { + "defaultValue": null, + "helpText": "The size of work estimated for fixing the bug", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.StoryPoints", + "name": "Story Points", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.StoryPoints" + }, + { + "defaultValue": null, + "helpText": "An estimate of the number of units of work remaining to complete this bug", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.RemainingWork", + "name": "Remaining Work", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.RemainingWork" + }, + { + "defaultValue": null, + "helpText": "Initial value for Remaining Work - set once, when work begins", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.OriginalEstimate", + "name": "Original Estimate", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.OriginalEstimate" + }, + { + "defaultValue": null, + "helpText": "The number of units of work that have been spent on this bug", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.CompletedWork", + "name": "Completed Work", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.CompletedWork" + }, + { + "defaultValue": null, + "helpText": "Type of work involved", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.Activity", + "name": "Activity", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.Activity" + }, + { + "defaultValue": null, + "helpText": "Test context, provided automatically by test infrastructure", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.TCM.SystemInfo", + "name": "System Info", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.TCM.SystemInfo" + }, + { + "defaultValue": null, + "helpText": "How to see the bug. End by contrasting expected with actual behavior.", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.TCM.ReproSteps", + "name": "Repro Steps", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.TCM.ReproSteps" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.StateChangeDate", + "name": "State Change Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.StateChangeDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ActivatedDate", + "name": "Activated Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ActivatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ActivatedBy", + "name": "Activated By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ActivatedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ResolvedDate", + "name": "Resolved Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ResolvedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ResolvedBy", + "name": "Resolved By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ResolvedBy" + }, + { + "defaultValue": null, + "helpText": "The reason why the bug was resolved", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ResolvedReason", + "name": "Resolved Reason", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ResolvedReason" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedDate", + "name": "Closed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedBy", + "name": "Closed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedBy" + }, + { + "defaultValue": "2", + "helpText": "Business importance. 1=must fix; 4=unimportant.", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.Priority", + "name": "Priority", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.Priority" + }, + { + "defaultValue": "3 - Medium", + "helpText": "Assessment of the effect of the bug on the project.", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.Severity", + "name": "Severity", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.Severity" + }, + { + "defaultValue": null, + "helpText": "Work first on items with lower-valued stack rank. Set in triage.", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.StackRank", + "name": "Stack Rank", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.StackRank" + }, + { + "defaultValue": "Business", + "helpText": "The type should be set to Business primarily to represent customer-facing issues. Work to change the architecture should be added as a Requirement", + "alwaysRequired": true, + "referenceName": "Microsoft.VSTS.Common.ValueArea", + "name": "Value Area", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ValueArea" + }, + { + "defaultValue": null, + "helpText": "The build in which the bug was fixed", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Build.IntegrationBuild", + "name": "Integration Build", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Build.IntegrationBuild" + }, + { + "defaultValue": null, + "helpText": "The build in which the bug was found", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Build.FoundIn", + "name": "Found In", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Build.FoundIn" + } + ], + "fieldInstances": [ + { + "defaultValue": null, + "helpText": "The iteration within which this bug will be fixed", + "alwaysRequired": false, + "referenceName": "System.IterationPath", + "name": "Iteration Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationPath" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.IterationId", + "name": "Iteration ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ExternalLinkCount", + "name": "External Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ExternalLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel7", + "name": "Iteration Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel6", + "name": "Iteration Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel5", + "name": "Iteration Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel4", + "name": "Iteration Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel3", + "name": "Iteration Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel2", + "name": "Iteration Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel1", + "name": "Iteration Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel7", + "name": "Area Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel6", + "name": "Area Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel5", + "name": "Area Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel4", + "name": "Area Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel3", + "name": "Area Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel2", + "name": "Area Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel1", + "name": "Area Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.TeamProject", + "name": "Team Project", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.TeamProject" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Parent", + "name": "Parent", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Parent" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RemoteLinkCount", + "name": "Remote Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RemoteLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CommentCount", + "name": "Comment Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CommentCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.HyperLinkCount", + "name": "Hyperlink Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.HyperLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AttachedFileCount", + "name": "Attached File Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AttachedFileCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.NodeName", + "name": "Node Name", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.NodeName" + }, + { + "defaultValue": null, + "helpText": "The area of the product with which this bug is associated", + "alwaysRequired": false, + "referenceName": "System.AreaPath", + "name": "Area Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaPath" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RevisedDate", + "name": "Revised Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RevisedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedDate", + "name": "Changed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Id", + "name": "ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Id" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.AreaId", + "name": "Area ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedAs", + "name": "Authorized As", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedAs" + }, + { + "defaultValue": null, + "helpText": "Stories affected and how", + "alwaysRequired": true, + "referenceName": "System.Title", + "name": "Title", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Title" + }, + { + "defaultValue": "New", + "helpText": "New = for triage; Active = not yet fixed; Resolved = fixed not yet verified; Closed = fix verified.", + "alwaysRequired": true, + "referenceName": "System.State", + "name": "State", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.State" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedDate", + "name": "Authorized Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Watermark", + "name": "Watermark", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Watermark" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Rev", + "name": "Rev", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Rev" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedBy", + "name": "Changed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedBy" + }, + { + "defaultValue": null, + "helpText": "The reason why the bug is in the current state", + "alwaysRequired": false, + "referenceName": "System.Reason", + "name": "Reason", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Reason" + }, + { + "defaultValue": null, + "helpText": "The person currently working on this bug", + "alwaysRequired": false, + "referenceName": "System.AssignedTo", + "name": "Assigned To", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AssignedTo" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.WorkItemType", + "name": "Work Item Type", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.WorkItemType" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedDate", + "name": "Created Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedBy", + "name": "Created By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Description", + "name": "Description", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Description" + }, + { + "defaultValue": null, + "helpText": "Discussion thread plus automatic record of changes", + "alwaysRequired": false, + "referenceName": "System.History", + "name": "History", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.History" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RelatedLinkCount", + "name": "Related Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RelatedLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Tags", + "name": "Tags", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Tags" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumn", + "name": "Board Column", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumn" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumnDone", + "name": "Board Column Done", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumnDone" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardLane", + "name": "Board Lane", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardLane" + }, + { + "defaultValue": null, + "helpText": "The size of work estimated for fixing the bug", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.StoryPoints", + "name": "Story Points", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.StoryPoints" + }, + { + "defaultValue": null, + "helpText": "An estimate of the number of units of work remaining to complete this bug", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.RemainingWork", + "name": "Remaining Work", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.RemainingWork" + }, + { + "defaultValue": null, + "helpText": "Initial value for Remaining Work - set once, when work begins", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.OriginalEstimate", + "name": "Original Estimate", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.OriginalEstimate" + }, + { + "defaultValue": null, + "helpText": "The number of units of work that have been spent on this bug", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.CompletedWork", + "name": "Completed Work", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.CompletedWork" + }, + { + "defaultValue": null, + "helpText": "Type of work involved", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.Activity", + "name": "Activity", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.Activity" + }, + { + "defaultValue": null, + "helpText": "Test context, provided automatically by test infrastructure", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.TCM.SystemInfo", + "name": "System Info", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.TCM.SystemInfo" + }, + { + "defaultValue": null, + "helpText": "How to see the bug. End by contrasting expected with actual behavior.", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.TCM.ReproSteps", + "name": "Repro Steps", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.TCM.ReproSteps" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.StateChangeDate", + "name": "State Change Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.StateChangeDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ActivatedDate", + "name": "Activated Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ActivatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ActivatedBy", + "name": "Activated By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ActivatedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ResolvedDate", + "name": "Resolved Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ResolvedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ResolvedBy", + "name": "Resolved By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ResolvedBy" + }, + { + "defaultValue": null, + "helpText": "The reason why the bug was resolved", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ResolvedReason", + "name": "Resolved Reason", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ResolvedReason" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedDate", + "name": "Closed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedBy", + "name": "Closed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedBy" + }, + { + "defaultValue": "2", + "helpText": "Business importance. 1=must fix; 4=unimportant.", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.Priority", + "name": "Priority", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.Priority" + }, + { + "defaultValue": "3 - Medium", + "helpText": "Assessment of the effect of the bug on the project.", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.Severity", + "name": "Severity", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.Severity" + }, + { + "defaultValue": null, + "helpText": "Work first on items with lower-valued stack rank. Set in triage.", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.StackRank", + "name": "Stack Rank", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.StackRank" + }, + { + "defaultValue": "Business", + "helpText": "The type should be set to Business primarily to represent customer-facing issues. Work to change the architecture should be added as a Requirement", + "alwaysRequired": true, + "referenceName": "Microsoft.VSTS.Common.ValueArea", + "name": "Value Area", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ValueArea" + }, + { + "defaultValue": null, + "helpText": "The build in which the bug was fixed", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Build.IntegrationBuild", + "name": "Integration Build", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Build.IntegrationBuild" + }, + { + "defaultValue": null, + "helpText": "The build in which the bug was found", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Build.FoundIn", + "name": "Found In", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Build.FoundIn" + } + ], + "transitions": { + "Active": [ + { + "to": "Active", + "actions": null + }, + { + "to": "Closed", + "actions": null + }, + { + "to": "Resolved", + "actions": [ + "Microsoft.VSTS.Actions.Checkin" + ] + }, + { + "to": "New", + "actions": [ + "Microsoft.VSTS.Actions.StopWork" + ] + } + ], + "Closed": [ + { + "to": "Closed", + "actions": null + }, + { + "to": "Resolved", + "actions": null + }, + { + "to": "Active", + "actions": null + }, + { + "to": "New", + "actions": null + } + ], + "New": [ + { + "to": "New", + "actions": null + }, + { + "to": "Closed", + "actions": null + }, + { + "to": "Resolved", + "actions": [ + "Microsoft.VSTS.Actions.Checkin" + ] + }, + { + "to": "Active", + "actions": [ + "Microsoft.VSTS.Actions.StartWork" + ] + } + ], + "Resolved": [ + { + "to": "Resolved", + "actions": null + }, + { + "to": "Closed", + "actions": null + }, + { + "to": "Active", + "actions": null + }, + { + "to": "New", + "actions": null + } + ], + "": [ + { + "to": "New", + "actions": null + } + ] + }, + "states": [ + { + "name": "New", + "color": "b2b2b2", + "category": "Proposed" + }, + { + "name": "Active", + "color": "007acc", + "category": "InProgress" + }, + { + "name": "Resolved", + "color": "ff9d00", + "category": "Resolved" + }, + { + "name": "Closed", + "color": "339933", + "category": "Completed" + } + ], + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/workItemTypes/Bug" + }, + { + "name": "Code Review Request", + "referenceName": "Microsoft.VSTS.WorkItemTypes.CodeReviewRequest", + "description": "Represents the master work item for a code review. Child work items should be created of the type Code Review Response.", + "color": "B4009E", + "icon": { + "id": "icon_code_review", + "url": "https://tfsprodcus3.visualstudio.com/_apis/wit/workItemIcons/icon_code_review?color=B4009E&v=2" + }, + "isDisabled": false, + "xmlForm": "
", + "fields": [ + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationPath", + "name": "Iteration Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationPath" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.IterationId", + "name": "Iteration ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ExternalLinkCount", + "name": "External Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ExternalLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel7", + "name": "Iteration Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel6", + "name": "Iteration Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel5", + "name": "Iteration Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel4", + "name": "Iteration Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel3", + "name": "Iteration Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel2", + "name": "Iteration Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel1", + "name": "Iteration Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel7", + "name": "Area Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel6", + "name": "Area Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel5", + "name": "Area Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel4", + "name": "Area Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel3", + "name": "Area Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel2", + "name": "Area Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel1", + "name": "Area Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.TeamProject", + "name": "Team Project", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.TeamProject" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Parent", + "name": "Parent", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Parent" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RemoteLinkCount", + "name": "Remote Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RemoteLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CommentCount", + "name": "Comment Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CommentCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.HyperLinkCount", + "name": "Hyperlink Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.HyperLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AttachedFileCount", + "name": "Attached File Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AttachedFileCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.NodeName", + "name": "Node Name", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.NodeName" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaPath", + "name": "Area Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaPath" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RevisedDate", + "name": "Revised Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RevisedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedDate", + "name": "Changed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Id", + "name": "ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Id" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.AreaId", + "name": "Area ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedAs", + "name": "Authorized As", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedAs" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.Title", + "name": "Title", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Title" + }, + { + "defaultValue": "Requested", + "alwaysRequired": true, + "referenceName": "System.State", + "name": "State", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.State" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedDate", + "name": "Authorized Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Watermark", + "name": "Watermark", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Watermark" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Rev", + "name": "Rev", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Rev" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedBy", + "name": "Changed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Reason", + "name": "Reason", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Reason" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AssignedTo", + "name": "Assigned To", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AssignedTo" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.WorkItemType", + "name": "Work Item Type", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.WorkItemType" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedDate", + "name": "Created Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedBy", + "name": "Created By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Description", + "name": "Description", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Description" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.History", + "name": "History", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.History" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RelatedLinkCount", + "name": "Related Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RelatedLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Tags", + "name": "Tags", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Tags" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumn", + "name": "Board Column", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumn" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumnDone", + "name": "Board Column Done", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumnDone" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardLane", + "name": "Board Lane", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardLane" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedDate", + "name": "Closed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedBy", + "name": "Closed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.CodeReview.ClosingComment", + "name": "Closing Comment", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.CodeReview.ClosingComment" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.CodeReview.ContextCode", + "name": "Associated Context Code", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.CodeReview.ContextCode" + }, + { + "defaultValue": "Shelveset", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.CodeReview.ContextType", + "name": "Associated Context Type", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.CodeReview.ContextType" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "Microsoft.VSTS.CodeReview.Context", + "name": "Associated Context", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.CodeReview.Context" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.CodeReview.ContextOwner", + "name": "Associated Context Owner", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.CodeReview.ContextOwner" + }, + { + "defaultValue": "0", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.CodeReview.ClosedStatusCode", + "name": "Closed Status Code", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.CodeReview.ClosedStatusCode" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.CodeReview.ClosedStatus", + "name": "Closed Status", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.CodeReview.ClosedStatus" + }, + { + "defaultValue": null, + "helpText": "The build in which the bug was fixed", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Build.IntegrationBuild", + "name": "Integration Build", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Build.IntegrationBuild" + }, + { + "defaultValue": "0", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.StateCode", + "name": "State Code", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.StateCode" + } + ], + "fieldInstances": [ + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationPath", + "name": "Iteration Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationPath" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.IterationId", + "name": "Iteration ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ExternalLinkCount", + "name": "External Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ExternalLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel7", + "name": "Iteration Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel6", + "name": "Iteration Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel5", + "name": "Iteration Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel4", + "name": "Iteration Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel3", + "name": "Iteration Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel2", + "name": "Iteration Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel1", + "name": "Iteration Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel7", + "name": "Area Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel6", + "name": "Area Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel5", + "name": "Area Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel4", + "name": "Area Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel3", + "name": "Area Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel2", + "name": "Area Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel1", + "name": "Area Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.TeamProject", + "name": "Team Project", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.TeamProject" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Parent", + "name": "Parent", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Parent" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RemoteLinkCount", + "name": "Remote Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RemoteLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CommentCount", + "name": "Comment Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CommentCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.HyperLinkCount", + "name": "Hyperlink Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.HyperLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AttachedFileCount", + "name": "Attached File Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AttachedFileCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.NodeName", + "name": "Node Name", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.NodeName" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaPath", + "name": "Area Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaPath" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RevisedDate", + "name": "Revised Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RevisedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedDate", + "name": "Changed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Id", + "name": "ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Id" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.AreaId", + "name": "Area ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedAs", + "name": "Authorized As", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedAs" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.Title", + "name": "Title", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Title" + }, + { + "defaultValue": "Requested", + "alwaysRequired": true, + "referenceName": "System.State", + "name": "State", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.State" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedDate", + "name": "Authorized Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Watermark", + "name": "Watermark", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Watermark" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Rev", + "name": "Rev", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Rev" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedBy", + "name": "Changed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Reason", + "name": "Reason", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Reason" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AssignedTo", + "name": "Assigned To", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AssignedTo" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.WorkItemType", + "name": "Work Item Type", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.WorkItemType" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedDate", + "name": "Created Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedBy", + "name": "Created By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Description", + "name": "Description", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Description" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.History", + "name": "History", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.History" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RelatedLinkCount", + "name": "Related Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RelatedLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Tags", + "name": "Tags", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Tags" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumn", + "name": "Board Column", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumn" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumnDone", + "name": "Board Column Done", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumnDone" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardLane", + "name": "Board Lane", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardLane" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedDate", + "name": "Closed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedBy", + "name": "Closed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.CodeReview.ClosingComment", + "name": "Closing Comment", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.CodeReview.ClosingComment" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.CodeReview.ContextCode", + "name": "Associated Context Code", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.CodeReview.ContextCode" + }, + { + "defaultValue": "Shelveset", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.CodeReview.ContextType", + "name": "Associated Context Type", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.CodeReview.ContextType" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "Microsoft.VSTS.CodeReview.Context", + "name": "Associated Context", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.CodeReview.Context" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.CodeReview.ContextOwner", + "name": "Associated Context Owner", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.CodeReview.ContextOwner" + }, + { + "defaultValue": "0", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.CodeReview.ClosedStatusCode", + "name": "Closed Status Code", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.CodeReview.ClosedStatusCode" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.CodeReview.ClosedStatus", + "name": "Closed Status", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.CodeReview.ClosedStatus" + }, + { + "defaultValue": null, + "helpText": "The build in which the bug was fixed", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Build.IntegrationBuild", + "name": "Integration Build", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Build.IntegrationBuild" + }, + { + "defaultValue": "0", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.StateCode", + "name": "State Code", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.StateCode" + } + ], + "transitions": { + "Closed": [ + { + "to": "Closed", + "actions": null + } + ], + "Requested": [ + { + "to": "Requested", + "actions": null + }, + { + "to": "Closed", + "actions": [ + "Microsoft.VSTS.Actions.Checkin", + "Microsoft.VSTS.CodeReview.Abandon" + ] + } + ], + "": [ + { + "to": "Requested", + "actions": null + } + ] + }, + "states": [ + { + "name": "Requested", + "color": "b2b2b2", + "category": "Proposed" + }, + { + "name": "Closed", + "color": "339933", + "category": "Completed" + } + ], + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/workItemTypes/Code%20Review%20Request" + }, + { + "name": "Code Review Response", + "referenceName": "Microsoft.VSTS.WorkItemTypes.CodeReviewResponse", + "description": "This is a child work item that should be parented to a Code Review Request work item. It is assigned to the reviewer and contains the current state of the review for this reviewer.", + "color": "B4009E", + "icon": { + "id": "icon_code_response", + "url": "https://tfsprodcus3.visualstudio.com/_apis/wit/workItemIcons/icon_code_response?color=B4009E&v=2" + }, + "isDisabled": false, + "xmlForm": "
", + "fields": [ + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationPath", + "name": "Iteration Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationPath" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.IterationId", + "name": "Iteration ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ExternalLinkCount", + "name": "External Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ExternalLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel7", + "name": "Iteration Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel6", + "name": "Iteration Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel5", + "name": "Iteration Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel4", + "name": "Iteration Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel3", + "name": "Iteration Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel2", + "name": "Iteration Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel1", + "name": "Iteration Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel7", + "name": "Area Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel6", + "name": "Area Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel5", + "name": "Area Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel4", + "name": "Area Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel3", + "name": "Area Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel2", + "name": "Area Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel1", + "name": "Area Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.TeamProject", + "name": "Team Project", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.TeamProject" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Parent", + "name": "Parent", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Parent" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RemoteLinkCount", + "name": "Remote Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RemoteLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CommentCount", + "name": "Comment Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CommentCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.HyperLinkCount", + "name": "Hyperlink Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.HyperLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AttachedFileCount", + "name": "Attached File Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AttachedFileCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.NodeName", + "name": "Node Name", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.NodeName" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaPath", + "name": "Area Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaPath" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RevisedDate", + "name": "Revised Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RevisedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedDate", + "name": "Changed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Id", + "name": "ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Id" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.AreaId", + "name": "Area ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedAs", + "name": "Authorized As", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedAs" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.Title", + "name": "Title", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Title" + }, + { + "defaultValue": "Requested", + "alwaysRequired": true, + "referenceName": "System.State", + "name": "State", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.State" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedDate", + "name": "Authorized Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Watermark", + "name": "Watermark", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Watermark" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Rev", + "name": "Rev", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Rev" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedBy", + "name": "Changed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Reason", + "name": "Reason", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Reason" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AssignedTo", + "name": "Assigned To", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AssignedTo" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.WorkItemType", + "name": "Work Item Type", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.WorkItemType" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedDate", + "name": "Created Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedBy", + "name": "Created By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Description", + "name": "Description", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Description" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.History", + "name": "History", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.History" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RelatedLinkCount", + "name": "Related Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RelatedLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Tags", + "name": "Tags", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Tags" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumn", + "name": "Board Column", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumn" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumnDone", + "name": "Board Column Done", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumnDone" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardLane", + "name": "Board Lane", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardLane" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.CodeReview.AcceptedDate", + "name": "Accepted Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.CodeReview.AcceptedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.CodeReview.AcceptedBy", + "name": "Accepted By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.CodeReview.AcceptedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedDate", + "name": "Closed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedBy", + "name": "Closed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ReviewedBy", + "name": "Reviewed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ReviewedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.CodeReview.ClosingComment", + "name": "Closing Comment", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.CodeReview.ClosingComment" + }, + { + "defaultValue": "0", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.CodeReview.ClosedStatusCode", + "name": "Closed Status Code", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.CodeReview.ClosedStatusCode" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.CodeReview.ClosedStatus", + "name": "Closed Status", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.CodeReview.ClosedStatus" + }, + { + "defaultValue": null, + "helpText": "The build in which the bug was fixed", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Build.IntegrationBuild", + "name": "Integration Build", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Build.IntegrationBuild" + }, + { + "defaultValue": "0", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.StateCode", + "name": "State Code", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.StateCode" + } + ], + "fieldInstances": [ + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationPath", + "name": "Iteration Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationPath" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.IterationId", + "name": "Iteration ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ExternalLinkCount", + "name": "External Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ExternalLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel7", + "name": "Iteration Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel6", + "name": "Iteration Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel5", + "name": "Iteration Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel4", + "name": "Iteration Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel3", + "name": "Iteration Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel2", + "name": "Iteration Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel1", + "name": "Iteration Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel7", + "name": "Area Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel6", + "name": "Area Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel5", + "name": "Area Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel4", + "name": "Area Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel3", + "name": "Area Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel2", + "name": "Area Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel1", + "name": "Area Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.TeamProject", + "name": "Team Project", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.TeamProject" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Parent", + "name": "Parent", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Parent" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RemoteLinkCount", + "name": "Remote Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RemoteLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CommentCount", + "name": "Comment Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CommentCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.HyperLinkCount", + "name": "Hyperlink Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.HyperLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AttachedFileCount", + "name": "Attached File Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AttachedFileCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.NodeName", + "name": "Node Name", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.NodeName" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaPath", + "name": "Area Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaPath" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RevisedDate", + "name": "Revised Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RevisedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedDate", + "name": "Changed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Id", + "name": "ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Id" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.AreaId", + "name": "Area ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedAs", + "name": "Authorized As", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedAs" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.Title", + "name": "Title", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Title" + }, + { + "defaultValue": "Requested", + "alwaysRequired": true, + "referenceName": "System.State", + "name": "State", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.State" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedDate", + "name": "Authorized Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Watermark", + "name": "Watermark", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Watermark" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Rev", + "name": "Rev", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Rev" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedBy", + "name": "Changed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Reason", + "name": "Reason", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Reason" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AssignedTo", + "name": "Assigned To", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AssignedTo" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.WorkItemType", + "name": "Work Item Type", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.WorkItemType" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedDate", + "name": "Created Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedBy", + "name": "Created By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Description", + "name": "Description", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Description" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.History", + "name": "History", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.History" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RelatedLinkCount", + "name": "Related Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RelatedLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Tags", + "name": "Tags", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Tags" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumn", + "name": "Board Column", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumn" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumnDone", + "name": "Board Column Done", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumnDone" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardLane", + "name": "Board Lane", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardLane" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.CodeReview.AcceptedDate", + "name": "Accepted Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.CodeReview.AcceptedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.CodeReview.AcceptedBy", + "name": "Accepted By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.CodeReview.AcceptedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedDate", + "name": "Closed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedBy", + "name": "Closed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ReviewedBy", + "name": "Reviewed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ReviewedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.CodeReview.ClosingComment", + "name": "Closing Comment", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.CodeReview.ClosingComment" + }, + { + "defaultValue": "0", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.CodeReview.ClosedStatusCode", + "name": "Closed Status Code", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.CodeReview.ClosedStatusCode" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.CodeReview.ClosedStatus", + "name": "Closed Status", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.CodeReview.ClosedStatus" + }, + { + "defaultValue": null, + "helpText": "The build in which the bug was fixed", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Build.IntegrationBuild", + "name": "Integration Build", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Build.IntegrationBuild" + }, + { + "defaultValue": "0", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.StateCode", + "name": "State Code", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.StateCode" + } + ], + "transitions": { + "Accepted": [ + { + "to": "Accepted", + "actions": null + }, + { + "to": "Closed", + "actions": [ + "Microsoft.VSTS.CodeReview.Complete", + "Microsoft.VSTS.CodeReview.Decline", + "Microsoft.VSTS.CodeReview.Remove" + ] + } + ], + "Closed": [ + { + "to": "Closed", + "actions": null + }, + { + "to": "Requested", + "actions": [ + "Microsoft.VSTS.CodeReview.Reassign" + ] + } + ], + "Requested": [ + { + "to": "Requested", + "actions": null + }, + { + "to": "Accepted", + "actions": [ + "Microsoft.VSTS.CodeReview.Accept" + ] + }, + { + "to": "Closed", + "actions": [ + "Microsoft.VSTS.CodeReview.Decline", + "Microsoft.VSTS.CodeReview.Remove" + ] + } + ], + "": [ + { + "to": "Requested", + "actions": null + } + ] + }, + "states": [ + { + "name": "Requested", + "color": "b2b2b2", + "category": "Proposed" + }, + { + "name": "Accepted", + "color": "007acc", + "category": "InProgress" + }, + { + "name": "Closed", + "color": "339933", + "category": "Completed" + } + ], + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/workItemTypes/Code%20Review%20Response" + }, + { + "name": "Epic", + "referenceName": "Microsoft.VSTS.WorkItemTypes.Epic", + "description": "Epics help teams effectively manage and groom their product backlog", + "color": "FF7B00", + "icon": { + "id": "icon_crown", + "url": "https://tfsprodcus3.visualstudio.com/_apis/wit/workItemIcons/icon_crown?color=FF7B00&v=2" + }, + "isDisabled": false, + "xmlForm": "
", + "fields": [ + { + "defaultValue": null, + "helpText": "The iteration within which this epic will be implemented", + "alwaysRequired": false, + "referenceName": "System.IterationPath", + "name": "Iteration Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationPath" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.IterationId", + "name": "Iteration ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ExternalLinkCount", + "name": "External Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ExternalLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel7", + "name": "Iteration Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel6", + "name": "Iteration Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel5", + "name": "Iteration Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel4", + "name": "Iteration Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel3", + "name": "Iteration Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel2", + "name": "Iteration Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel1", + "name": "Iteration Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel7", + "name": "Area Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel6", + "name": "Area Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel5", + "name": "Area Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel4", + "name": "Area Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel3", + "name": "Area Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel2", + "name": "Area Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel1", + "name": "Area Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.TeamProject", + "name": "Team Project", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.TeamProject" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Parent", + "name": "Parent", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Parent" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RemoteLinkCount", + "name": "Remote Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RemoteLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CommentCount", + "name": "Comment Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CommentCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.HyperLinkCount", + "name": "Hyperlink Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.HyperLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AttachedFileCount", + "name": "Attached File Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AttachedFileCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.NodeName", + "name": "Node Name", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.NodeName" + }, + { + "defaultValue": null, + "helpText": "The area of the product with which this epic is associated", + "alwaysRequired": false, + "referenceName": "System.AreaPath", + "name": "Area Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaPath" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RevisedDate", + "name": "Revised Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RevisedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedDate", + "name": "Changed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Id", + "name": "ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Id" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.AreaId", + "name": "Area ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedAs", + "name": "Authorized As", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedAs" + }, + { + "defaultValue": null, + "helpText": "What the user will be able to do when this is implemented", + "alwaysRequired": true, + "referenceName": "System.Title", + "name": "Title", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Title" + }, + { + "defaultValue": "New", + "helpText": "New = Not started yet; Active = work remains to be done; Resolved = awaiting acceptance tests; Closed = acceptance tests passed", + "alwaysRequired": true, + "referenceName": "System.State", + "name": "State", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.State" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedDate", + "name": "Authorized Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Watermark", + "name": "Watermark", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Watermark" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Rev", + "name": "Rev", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Rev" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedBy", + "name": "Changed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedBy" + }, + { + "defaultValue": null, + "helpText": "The reason why the epic is in its current state", + "alwaysRequired": false, + "referenceName": "System.Reason", + "name": "Reason", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Reason" + }, + { + "defaultValue": null, + "helpText": "The person currently owning the epic", + "alwaysRequired": false, + "referenceName": "System.AssignedTo", + "name": "Assigned To", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AssignedTo" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.WorkItemType", + "name": "Work Item Type", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.WorkItemType" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedDate", + "name": "Created Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedBy", + "name": "Created By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedBy" + }, + { + "defaultValue": null, + "helpText": "Description or acceptance criteria for this epic to be considered complete", + "alwaysRequired": false, + "referenceName": "System.Description", + "name": "Description", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Description" + }, + { + "defaultValue": null, + "helpText": "Discussion thread plus automatic record of changes", + "alwaysRequired": false, + "referenceName": "System.History", + "name": "History", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.History" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RelatedLinkCount", + "name": "Related Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RelatedLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Tags", + "name": "Tags", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Tags" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumn", + "name": "Board Column", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumn" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumnDone", + "name": "Board Column Done", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumnDone" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardLane", + "name": "Board Lane", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardLane" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.StateChangeDate", + "name": "State Change Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.StateChangeDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ActivatedDate", + "name": "Activated Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ActivatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ActivatedBy", + "name": "Activated By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ActivatedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ResolvedDate", + "name": "Resolved Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ResolvedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ResolvedBy", + "name": "Resolved By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ResolvedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ResolvedReason", + "name": "Resolved Reason", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ResolvedReason" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedDate", + "name": "Closed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedBy", + "name": "Closed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedBy" + }, + { + "defaultValue": "2", + "helpText": "\"Priority for completing the epic, based on business goals", + "alwaysRequired": true, + "referenceName": "Microsoft.VSTS.Common.Priority", + "name": "Priority", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.Priority" + }, + { + "defaultValue": null, + "helpText": "Uncertainty in epic", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.Risk", + "name": "Risk", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.Risk" + }, + { + "defaultValue": null, + "helpText": "Work first on items with lower-valued stack rank. Set in triage.", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.StackRank", + "name": "Stack Rank", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.StackRank" + }, + { + "defaultValue": null, + "helpText": "The target date for completing the epic", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.TargetDate", + "name": "Target Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.TargetDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.StartDate", + "name": "Start Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.StartDate" + }, + { + "defaultValue": null, + "helpText": "The business value for the customer when the epic is released", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.BusinessValue", + "name": "Business Value", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.BusinessValue" + }, + { + "defaultValue": null, + "helpText": "How does the business value decay over time. Higher values make the epic more time critical", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.TimeCriticality", + "name": "Time Criticality", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.TimeCriticality" + }, + { + "defaultValue": null, + "helpText": "The estimated effort to implemented the epic", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.Effort", + "name": "Effort", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.Effort" + }, + { + "defaultValue": "Business", + "helpText": "Business = Customer-facing epics; Architectural = Technology initiatives to support current and future business needs", + "alwaysRequired": true, + "referenceName": "Microsoft.VSTS.Common.ValueArea", + "name": "Value Area", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ValueArea" + }, + { + "defaultValue": null, + "helpText": "The build in which the epic was fixed", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Build.IntegrationBuild", + "name": "Integration Build", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Build.IntegrationBuild" + } + ], + "fieldInstances": [ + { + "defaultValue": null, + "helpText": "The iteration within which this epic will be implemented", + "alwaysRequired": false, + "referenceName": "System.IterationPath", + "name": "Iteration Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationPath" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.IterationId", + "name": "Iteration ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ExternalLinkCount", + "name": "External Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ExternalLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel7", + "name": "Iteration Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel6", + "name": "Iteration Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel5", + "name": "Iteration Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel4", + "name": "Iteration Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel3", + "name": "Iteration Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel2", + "name": "Iteration Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel1", + "name": "Iteration Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel7", + "name": "Area Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel6", + "name": "Area Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel5", + "name": "Area Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel4", + "name": "Area Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel3", + "name": "Area Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel2", + "name": "Area Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel1", + "name": "Area Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.TeamProject", + "name": "Team Project", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.TeamProject" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Parent", + "name": "Parent", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Parent" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RemoteLinkCount", + "name": "Remote Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RemoteLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CommentCount", + "name": "Comment Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CommentCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.HyperLinkCount", + "name": "Hyperlink Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.HyperLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AttachedFileCount", + "name": "Attached File Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AttachedFileCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.NodeName", + "name": "Node Name", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.NodeName" + }, + { + "defaultValue": null, + "helpText": "The area of the product with which this epic is associated", + "alwaysRequired": false, + "referenceName": "System.AreaPath", + "name": "Area Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaPath" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RevisedDate", + "name": "Revised Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RevisedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedDate", + "name": "Changed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Id", + "name": "ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Id" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.AreaId", + "name": "Area ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedAs", + "name": "Authorized As", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedAs" + }, + { + "defaultValue": null, + "helpText": "What the user will be able to do when this is implemented", + "alwaysRequired": true, + "referenceName": "System.Title", + "name": "Title", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Title" + }, + { + "defaultValue": "New", + "helpText": "New = Not started yet; Active = work remains to be done; Resolved = awaiting acceptance tests; Closed = acceptance tests passed", + "alwaysRequired": true, + "referenceName": "System.State", + "name": "State", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.State" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedDate", + "name": "Authorized Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Watermark", + "name": "Watermark", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Watermark" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Rev", + "name": "Rev", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Rev" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedBy", + "name": "Changed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedBy" + }, + { + "defaultValue": null, + "helpText": "The reason why the epic is in its current state", + "alwaysRequired": false, + "referenceName": "System.Reason", + "name": "Reason", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Reason" + }, + { + "defaultValue": null, + "helpText": "The person currently owning the epic", + "alwaysRequired": false, + "referenceName": "System.AssignedTo", + "name": "Assigned To", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AssignedTo" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.WorkItemType", + "name": "Work Item Type", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.WorkItemType" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedDate", + "name": "Created Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedBy", + "name": "Created By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedBy" + }, + { + "defaultValue": null, + "helpText": "Description or acceptance criteria for this epic to be considered complete", + "alwaysRequired": false, + "referenceName": "System.Description", + "name": "Description", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Description" + }, + { + "defaultValue": null, + "helpText": "Discussion thread plus automatic record of changes", + "alwaysRequired": false, + "referenceName": "System.History", + "name": "History", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.History" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RelatedLinkCount", + "name": "Related Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RelatedLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Tags", + "name": "Tags", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Tags" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumn", + "name": "Board Column", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumn" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumnDone", + "name": "Board Column Done", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumnDone" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardLane", + "name": "Board Lane", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardLane" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.StateChangeDate", + "name": "State Change Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.StateChangeDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ActivatedDate", + "name": "Activated Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ActivatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ActivatedBy", + "name": "Activated By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ActivatedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ResolvedDate", + "name": "Resolved Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ResolvedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ResolvedBy", + "name": "Resolved By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ResolvedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ResolvedReason", + "name": "Resolved Reason", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ResolvedReason" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedDate", + "name": "Closed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedBy", + "name": "Closed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedBy" + }, + { + "defaultValue": "2", + "helpText": "\"Priority for completing the epic, based on business goals", + "alwaysRequired": true, + "referenceName": "Microsoft.VSTS.Common.Priority", + "name": "Priority", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.Priority" + }, + { + "defaultValue": null, + "helpText": "Uncertainty in epic", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.Risk", + "name": "Risk", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.Risk" + }, + { + "defaultValue": null, + "helpText": "Work first on items with lower-valued stack rank. Set in triage.", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.StackRank", + "name": "Stack Rank", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.StackRank" + }, + { + "defaultValue": null, + "helpText": "The target date for completing the epic", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.TargetDate", + "name": "Target Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.TargetDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.StartDate", + "name": "Start Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.StartDate" + }, + { + "defaultValue": null, + "helpText": "The business value for the customer when the epic is released", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.BusinessValue", + "name": "Business Value", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.BusinessValue" + }, + { + "defaultValue": null, + "helpText": "How does the business value decay over time. Higher values make the epic more time critical", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.TimeCriticality", + "name": "Time Criticality", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.TimeCriticality" + }, + { + "defaultValue": null, + "helpText": "The estimated effort to implemented the epic", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.Effort", + "name": "Effort", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.Effort" + }, + { + "defaultValue": "Business", + "helpText": "Business = Customer-facing epics; Architectural = Technology initiatives to support current and future business needs", + "alwaysRequired": true, + "referenceName": "Microsoft.VSTS.Common.ValueArea", + "name": "Value Area", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ValueArea" + }, + { + "defaultValue": null, + "helpText": "The build in which the epic was fixed", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Build.IntegrationBuild", + "name": "Integration Build", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Build.IntegrationBuild" + } + ], + "transitions": { + "Active": [ + { + "to": "Active", + "actions": null + }, + { + "to": "Removed", + "actions": null + }, + { + "to": "Closed", + "actions": null + }, + { + "to": "Resolved", + "actions": null + }, + { + "to": "New", + "actions": null + } + ], + "Closed": [ + { + "to": "Closed", + "actions": null + }, + { + "to": "Resolved", + "actions": null + }, + { + "to": "Active", + "actions": null + }, + { + "to": "New", + "actions": null + } + ], + "New": [ + { + "to": "New", + "actions": null + }, + { + "to": "Removed", + "actions": null + }, + { + "to": "Closed", + "actions": null + }, + { + "to": "Resolved", + "actions": null + }, + { + "to": "Active", + "actions": null + } + ], + "Removed": [ + { + "to": "Removed", + "actions": null + }, + { + "to": "New", + "actions": null + } + ], + "Resolved": [ + { + "to": "Resolved", + "actions": null + }, + { + "to": "Removed", + "actions": null + }, + { + "to": "Closed", + "actions": null + }, + { + "to": "Active", + "actions": null + }, + { + "to": "New", + "actions": null + } + ], + "": [ + { + "to": "New", + "actions": null + } + ] + }, + "states": [ + { + "name": "New", + "color": "b2b2b2", + "category": "Proposed" + }, + { + "name": "Active", + "color": "007acc", + "category": "InProgress" + }, + { + "name": "Resolved", + "color": "007acc", + "category": "InProgress" + }, + { + "name": "Closed", + "color": "339933", + "category": "Completed" + }, + { + "name": "Removed", + "color": "ffffff", + "category": "Removed" + } + ], + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/workItemTypes/Epic" + }, + { + "name": "Feature", + "referenceName": "Microsoft.VSTS.WorkItemTypes.Feature", + "description": "Tracks a feature that will be released with the product", + "color": "773B93", + "icon": { + "id": "icon_trophy", + "url": "https://tfsprodcus3.visualstudio.com/_apis/wit/workItemIcons/icon_trophy?color=773B93&v=2" + }, + "isDisabled": false, + "xmlForm": "
", + "fields": [ + { + "defaultValue": null, + "helpText": "The iteration within which this feature will be implemented", + "alwaysRequired": false, + "referenceName": "System.IterationPath", + "name": "Iteration Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationPath" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.IterationId", + "name": "Iteration ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ExternalLinkCount", + "name": "External Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ExternalLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel7", + "name": "Iteration Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel6", + "name": "Iteration Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel5", + "name": "Iteration Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel4", + "name": "Iteration Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel3", + "name": "Iteration Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel2", + "name": "Iteration Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel1", + "name": "Iteration Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel7", + "name": "Area Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel6", + "name": "Area Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel5", + "name": "Area Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel4", + "name": "Area Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel3", + "name": "Area Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel2", + "name": "Area Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel1", + "name": "Area Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.TeamProject", + "name": "Team Project", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.TeamProject" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Parent", + "name": "Parent", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Parent" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RemoteLinkCount", + "name": "Remote Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RemoteLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CommentCount", + "name": "Comment Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CommentCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.HyperLinkCount", + "name": "Hyperlink Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.HyperLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AttachedFileCount", + "name": "Attached File Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AttachedFileCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.NodeName", + "name": "Node Name", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.NodeName" + }, + { + "defaultValue": null, + "helpText": "The area of the product with which this feature is associated", + "alwaysRequired": false, + "referenceName": "System.AreaPath", + "name": "Area Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaPath" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RevisedDate", + "name": "Revised Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RevisedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedDate", + "name": "Changed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Id", + "name": "ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Id" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.AreaId", + "name": "Area ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedAs", + "name": "Authorized As", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedAs" + }, + { + "defaultValue": null, + "helpText": "What the user will be able to do when this is implemented", + "alwaysRequired": true, + "referenceName": "System.Title", + "name": "Title", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Title" + }, + { + "defaultValue": "New", + "helpText": "New = Not started yet; Active = work remains to be done; Resolved = awaiting acceptance tests; Closed = acceptance tests passed", + "alwaysRequired": true, + "referenceName": "System.State", + "name": "State", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.State" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedDate", + "name": "Authorized Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Watermark", + "name": "Watermark", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Watermark" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Rev", + "name": "Rev", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Rev" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedBy", + "name": "Changed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedBy" + }, + { + "defaultValue": null, + "helpText": "The reason why the feature is in its current state", + "alwaysRequired": false, + "referenceName": "System.Reason", + "name": "Reason", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Reason" + }, + { + "defaultValue": null, + "helpText": "The person currently owning the feature", + "alwaysRequired": false, + "referenceName": "System.AssignedTo", + "name": "Assigned To", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AssignedTo" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.WorkItemType", + "name": "Work Item Type", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.WorkItemType" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedDate", + "name": "Created Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedBy", + "name": "Created By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedBy" + }, + { + "defaultValue": null, + "helpText": "Description or acceptance criteria for this feature to be considered complete", + "alwaysRequired": false, + "referenceName": "System.Description", + "name": "Description", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Description" + }, + { + "defaultValue": null, + "helpText": "Discussion thread plus automatic record of changes", + "alwaysRequired": false, + "referenceName": "System.History", + "name": "History", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.History" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RelatedLinkCount", + "name": "Related Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RelatedLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Tags", + "name": "Tags", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Tags" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumn", + "name": "Board Column", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumn" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumnDone", + "name": "Board Column Done", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumnDone" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardLane", + "name": "Board Lane", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardLane" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.StateChangeDate", + "name": "State Change Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.StateChangeDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ActivatedDate", + "name": "Activated Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ActivatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ActivatedBy", + "name": "Activated By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ActivatedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ResolvedDate", + "name": "Resolved Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ResolvedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ResolvedBy", + "name": "Resolved By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ResolvedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ResolvedReason", + "name": "Resolved Reason", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ResolvedReason" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedDate", + "name": "Closed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedBy", + "name": "Closed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedBy" + }, + { + "defaultValue": "2", + "helpText": "Priority for completing the feature, based on business goals", + "alwaysRequired": true, + "referenceName": "Microsoft.VSTS.Common.Priority", + "name": "Priority", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.Priority" + }, + { + "defaultValue": null, + "helpText": "Uncertainty in feature", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.Risk", + "name": "Risk", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.Risk" + }, + { + "defaultValue": null, + "helpText": "Work first on items with lower-valued stack rank. Set in triage.", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.StackRank", + "name": "Stack Rank", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.StackRank" + }, + { + "defaultValue": null, + "helpText": "The target date for completing the feature", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.TargetDate", + "name": "Target Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.TargetDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.StartDate", + "name": "Start Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.StartDate" + }, + { + "defaultValue": null, + "helpText": "The business value for the customer when the feature is released", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.BusinessValue", + "name": "Business Value", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.BusinessValue" + }, + { + "defaultValue": null, + "helpText": "How does the business value decay over time. Higher values make the feature more time critical", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.TimeCriticality", + "name": "Time Criticality", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.TimeCriticality" + }, + { + "defaultValue": null, + "helpText": "The estimated effort to implement the feature", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.Effort", + "name": "Effort", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.Effort" + }, + { + "defaultValue": "Business", + "helpText": "Business = Services provided by the system to fulfill stakeholder needs; Architectural = Technical system services to implement business features that deliver solution value", + "alwaysRequired": true, + "referenceName": "Microsoft.VSTS.Common.ValueArea", + "name": "Value Area", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ValueArea" + }, + { + "defaultValue": null, + "helpText": "The build in which the feature was fixed", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Build.IntegrationBuild", + "name": "Integration Build", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Build.IntegrationBuild" + } + ], + "fieldInstances": [ + { + "defaultValue": null, + "helpText": "The iteration within which this feature will be implemented", + "alwaysRequired": false, + "referenceName": "System.IterationPath", + "name": "Iteration Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationPath" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.IterationId", + "name": "Iteration ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ExternalLinkCount", + "name": "External Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ExternalLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel7", + "name": "Iteration Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel6", + "name": "Iteration Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel5", + "name": "Iteration Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel4", + "name": "Iteration Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel3", + "name": "Iteration Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel2", + "name": "Iteration Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel1", + "name": "Iteration Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel7", + "name": "Area Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel6", + "name": "Area Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel5", + "name": "Area Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel4", + "name": "Area Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel3", + "name": "Area Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel2", + "name": "Area Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel1", + "name": "Area Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.TeamProject", + "name": "Team Project", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.TeamProject" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Parent", + "name": "Parent", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Parent" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RemoteLinkCount", + "name": "Remote Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RemoteLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CommentCount", + "name": "Comment Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CommentCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.HyperLinkCount", + "name": "Hyperlink Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.HyperLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AttachedFileCount", + "name": "Attached File Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AttachedFileCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.NodeName", + "name": "Node Name", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.NodeName" + }, + { + "defaultValue": null, + "helpText": "The area of the product with which this feature is associated", + "alwaysRequired": false, + "referenceName": "System.AreaPath", + "name": "Area Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaPath" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RevisedDate", + "name": "Revised Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RevisedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedDate", + "name": "Changed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Id", + "name": "ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Id" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.AreaId", + "name": "Area ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedAs", + "name": "Authorized As", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedAs" + }, + { + "defaultValue": null, + "helpText": "What the user will be able to do when this is implemented", + "alwaysRequired": true, + "referenceName": "System.Title", + "name": "Title", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Title" + }, + { + "defaultValue": "New", + "helpText": "New = Not started yet; Active = work remains to be done; Resolved = awaiting acceptance tests; Closed = acceptance tests passed", + "alwaysRequired": true, + "referenceName": "System.State", + "name": "State", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.State" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedDate", + "name": "Authorized Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Watermark", + "name": "Watermark", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Watermark" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Rev", + "name": "Rev", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Rev" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedBy", + "name": "Changed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedBy" + }, + { + "defaultValue": null, + "helpText": "The reason why the feature is in its current state", + "alwaysRequired": false, + "referenceName": "System.Reason", + "name": "Reason", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Reason" + }, + { + "defaultValue": null, + "helpText": "The person currently owning the feature", + "alwaysRequired": false, + "referenceName": "System.AssignedTo", + "name": "Assigned To", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AssignedTo" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.WorkItemType", + "name": "Work Item Type", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.WorkItemType" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedDate", + "name": "Created Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedBy", + "name": "Created By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedBy" + }, + { + "defaultValue": null, + "helpText": "Description or acceptance criteria for this feature to be considered complete", + "alwaysRequired": false, + "referenceName": "System.Description", + "name": "Description", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Description" + }, + { + "defaultValue": null, + "helpText": "Discussion thread plus automatic record of changes", + "alwaysRequired": false, + "referenceName": "System.History", + "name": "History", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.History" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RelatedLinkCount", + "name": "Related Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RelatedLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Tags", + "name": "Tags", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Tags" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumn", + "name": "Board Column", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumn" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumnDone", + "name": "Board Column Done", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumnDone" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardLane", + "name": "Board Lane", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardLane" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.StateChangeDate", + "name": "State Change Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.StateChangeDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ActivatedDate", + "name": "Activated Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ActivatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ActivatedBy", + "name": "Activated By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ActivatedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ResolvedDate", + "name": "Resolved Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ResolvedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ResolvedBy", + "name": "Resolved By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ResolvedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ResolvedReason", + "name": "Resolved Reason", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ResolvedReason" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedDate", + "name": "Closed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedBy", + "name": "Closed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedBy" + }, + { + "defaultValue": "2", + "helpText": "Priority for completing the feature, based on business goals", + "alwaysRequired": true, + "referenceName": "Microsoft.VSTS.Common.Priority", + "name": "Priority", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.Priority" + }, + { + "defaultValue": null, + "helpText": "Uncertainty in feature", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.Risk", + "name": "Risk", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.Risk" + }, + { + "defaultValue": null, + "helpText": "Work first on items with lower-valued stack rank. Set in triage.", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.StackRank", + "name": "Stack Rank", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.StackRank" + }, + { + "defaultValue": null, + "helpText": "The target date for completing the feature", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.TargetDate", + "name": "Target Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.TargetDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.StartDate", + "name": "Start Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.StartDate" + }, + { + "defaultValue": null, + "helpText": "The business value for the customer when the feature is released", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.BusinessValue", + "name": "Business Value", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.BusinessValue" + }, + { + "defaultValue": null, + "helpText": "How does the business value decay over time. Higher values make the feature more time critical", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.TimeCriticality", + "name": "Time Criticality", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.TimeCriticality" + }, + { + "defaultValue": null, + "helpText": "The estimated effort to implement the feature", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.Effort", + "name": "Effort", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.Effort" + }, + { + "defaultValue": "Business", + "helpText": "Business = Services provided by the system to fulfill stakeholder needs; Architectural = Technical system services to implement business features that deliver solution value", + "alwaysRequired": true, + "referenceName": "Microsoft.VSTS.Common.ValueArea", + "name": "Value Area", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ValueArea" + }, + { + "defaultValue": null, + "helpText": "The build in which the feature was fixed", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Build.IntegrationBuild", + "name": "Integration Build", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Build.IntegrationBuild" + } + ], + "transitions": { + "Active": [ + { + "to": "Active", + "actions": null + }, + { + "to": "Removed", + "actions": null + }, + { + "to": "Closed", + "actions": null + }, + { + "to": "Resolved", + "actions": null + }, + { + "to": "New", + "actions": null + } + ], + "Closed": [ + { + "to": "Closed", + "actions": null + }, + { + "to": "Resolved", + "actions": null + }, + { + "to": "Active", + "actions": null + }, + { + "to": "New", + "actions": null + } + ], + "New": [ + { + "to": "New", + "actions": null + }, + { + "to": "Removed", + "actions": null + }, + { + "to": "Closed", + "actions": null + }, + { + "to": "Resolved", + "actions": null + }, + { + "to": "Active", + "actions": null + } + ], + "Removed": [ + { + "to": "Removed", + "actions": null + }, + { + "to": "New", + "actions": null + } + ], + "Resolved": [ + { + "to": "Resolved", + "actions": null + }, + { + "to": "Removed", + "actions": null + }, + { + "to": "Closed", + "actions": null + }, + { + "to": "Active", + "actions": null + }, + { + "to": "New", + "actions": null + } + ], + "": [ + { + "to": "New", + "actions": null + } + ] + }, + "states": [ + { + "name": "New", + "color": "b2b2b2", + "category": "Proposed" + }, + { + "name": "Active", + "color": "007acc", + "category": "InProgress" + }, + { + "name": "Resolved", + "color": "007acc", + "category": "InProgress" + }, + { + "name": "Closed", + "color": "339933", + "category": "Completed" + }, + { + "name": "Removed", + "color": "ffffff", + "category": "Removed" + } + ], + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/workItemTypes/Feature" + }, + { + "name": "Feedback Request", + "referenceName": "Microsoft.VSTS.WorkItemTypes.FeedbackRequest", + "description": "Represents the master work item for a feedback session. Child work items should be created of the type Feedback Response.", + "color": "004B50", + "icon": { + "id": "icon_review", + "url": "https://tfsprodcus3.visualstudio.com/_apis/wit/workItemIcons/icon_review?color=004B50&v=2" + }, + "isDisabled": false, + "xmlForm": "
", + "fields": [ + { + "defaultValue": null, + "helpText": "The iteration within which this feedback was requested", + "alwaysRequired": false, + "referenceName": "System.IterationPath", + "name": "Iteration Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationPath" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.IterationId", + "name": "Iteration ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ExternalLinkCount", + "name": "External Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ExternalLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel7", + "name": "Iteration Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel6", + "name": "Iteration Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel5", + "name": "Iteration Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel4", + "name": "Iteration Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel3", + "name": "Iteration Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel2", + "name": "Iteration Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel1", + "name": "Iteration Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel7", + "name": "Area Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel6", + "name": "Area Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel5", + "name": "Area Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel4", + "name": "Area Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel3", + "name": "Area Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel2", + "name": "Area Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel1", + "name": "Area Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.TeamProject", + "name": "Team Project", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.TeamProject" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Parent", + "name": "Parent", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Parent" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RemoteLinkCount", + "name": "Remote Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RemoteLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CommentCount", + "name": "Comment Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CommentCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.HyperLinkCount", + "name": "Hyperlink Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.HyperLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AttachedFileCount", + "name": "Attached File Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AttachedFileCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.NodeName", + "name": "Node Name", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.NodeName" + }, + { + "defaultValue": null, + "helpText": "The area of the product with which this feedback request is associated", + "alwaysRequired": false, + "referenceName": "System.AreaPath", + "name": "Area Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaPath" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RevisedDate", + "name": "Revised Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RevisedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedDate", + "name": "Changed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Id", + "name": "ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Id" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.AreaId", + "name": "Area ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedAs", + "name": "Authorized As", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedAs" + }, + { + "defaultValue": null, + "helpText": "One line summary of the feedback being requested", + "alwaysRequired": true, + "referenceName": "System.Title", + "name": "Title", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Title" + }, + { + "defaultValue": "Active", + "helpText": "Current status of the feedback request", + "alwaysRequired": true, + "referenceName": "System.State", + "name": "State", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.State" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedDate", + "name": "Authorized Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Watermark", + "name": "Watermark", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Watermark" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Rev", + "name": "Rev", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Rev" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedBy", + "name": "Changed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedBy" + }, + { + "defaultValue": null, + "helpText": "The reason why the feedback request is in its current state", + "alwaysRequired": false, + "referenceName": "System.Reason", + "name": "Reason", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Reason" + }, + { + "defaultValue": null, + "helpText": "The person requesting feedback", + "alwaysRequired": false, + "referenceName": "System.AssignedTo", + "name": "Assigned To", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AssignedTo" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.WorkItemType", + "name": "Work Item Type", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.WorkItemType" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedDate", + "name": "Created Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedBy", + "name": "Created By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedBy" + }, + { + "defaultValue": null, + "helpText": "Guidance on what areas of the product that feedback should be scoped to", + "alwaysRequired": false, + "referenceName": "System.Description", + "name": "Description", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Description" + }, + { + "defaultValue": null, + "helpText": "Discussion thread plus automatic record of changes", + "alwaysRequired": false, + "referenceName": "System.History", + "name": "History", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.History" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RelatedLinkCount", + "name": "Related Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RelatedLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Tags", + "name": "Tags", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Tags" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumn", + "name": "Board Column", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumn" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumnDone", + "name": "Board Column Done", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumnDone" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardLane", + "name": "Board Lane", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardLane" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedDate", + "name": "Closed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedBy", + "name": "Closed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedBy" + }, + { + "defaultValue": null, + "helpText": "The type of application on which to give feedback", + "alwaysRequired": true, + "referenceName": "Microsoft.VSTS.Feedback.ApplicationType", + "name": "Application Type", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Feedback.ApplicationType" + }, + { + "defaultValue": null, + "helpText": "The path to execute the application", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Feedback.ApplicationStartInformation", + "name": "Application Start Information", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Feedback.ApplicationStartInformation" + }, + { + "defaultValue": null, + "helpText": "Instructions to launch the specified application", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Feedback.ApplicationLaunchInstructions", + "name": "Application Launch Instructions", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Feedback.ApplicationLaunchInstructions" + }, + { + "defaultValue": null, + "helpText": "The build in which the bug was fixed", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Build.IntegrationBuild", + "name": "Integration Build", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Build.IntegrationBuild" + } + ], + "fieldInstances": [ + { + "defaultValue": null, + "helpText": "The iteration within which this feedback was requested", + "alwaysRequired": false, + "referenceName": "System.IterationPath", + "name": "Iteration Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationPath" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.IterationId", + "name": "Iteration ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ExternalLinkCount", + "name": "External Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ExternalLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel7", + "name": "Iteration Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel6", + "name": "Iteration Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel5", + "name": "Iteration Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel4", + "name": "Iteration Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel3", + "name": "Iteration Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel2", + "name": "Iteration Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel1", + "name": "Iteration Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel7", + "name": "Area Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel6", + "name": "Area Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel5", + "name": "Area Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel4", + "name": "Area Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel3", + "name": "Area Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel2", + "name": "Area Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel1", + "name": "Area Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.TeamProject", + "name": "Team Project", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.TeamProject" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Parent", + "name": "Parent", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Parent" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RemoteLinkCount", + "name": "Remote Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RemoteLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CommentCount", + "name": "Comment Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CommentCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.HyperLinkCount", + "name": "Hyperlink Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.HyperLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AttachedFileCount", + "name": "Attached File Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AttachedFileCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.NodeName", + "name": "Node Name", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.NodeName" + }, + { + "defaultValue": null, + "helpText": "The area of the product with which this feedback request is associated", + "alwaysRequired": false, + "referenceName": "System.AreaPath", + "name": "Area Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaPath" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RevisedDate", + "name": "Revised Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RevisedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedDate", + "name": "Changed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Id", + "name": "ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Id" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.AreaId", + "name": "Area ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedAs", + "name": "Authorized As", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedAs" + }, + { + "defaultValue": null, + "helpText": "One line summary of the feedback being requested", + "alwaysRequired": true, + "referenceName": "System.Title", + "name": "Title", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Title" + }, + { + "defaultValue": "Active", + "helpText": "Current status of the feedback request", + "alwaysRequired": true, + "referenceName": "System.State", + "name": "State", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.State" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedDate", + "name": "Authorized Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Watermark", + "name": "Watermark", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Watermark" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Rev", + "name": "Rev", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Rev" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedBy", + "name": "Changed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedBy" + }, + { + "defaultValue": null, + "helpText": "The reason why the feedback request is in its current state", + "alwaysRequired": false, + "referenceName": "System.Reason", + "name": "Reason", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Reason" + }, + { + "defaultValue": null, + "helpText": "The person requesting feedback", + "alwaysRequired": false, + "referenceName": "System.AssignedTo", + "name": "Assigned To", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AssignedTo" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.WorkItemType", + "name": "Work Item Type", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.WorkItemType" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedDate", + "name": "Created Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedBy", + "name": "Created By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedBy" + }, + { + "defaultValue": null, + "helpText": "Guidance on what areas of the product that feedback should be scoped to", + "alwaysRequired": false, + "referenceName": "System.Description", + "name": "Description", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Description" + }, + { + "defaultValue": null, + "helpText": "Discussion thread plus automatic record of changes", + "alwaysRequired": false, + "referenceName": "System.History", + "name": "History", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.History" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RelatedLinkCount", + "name": "Related Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RelatedLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Tags", + "name": "Tags", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Tags" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumn", + "name": "Board Column", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumn" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumnDone", + "name": "Board Column Done", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumnDone" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardLane", + "name": "Board Lane", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardLane" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedDate", + "name": "Closed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedBy", + "name": "Closed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedBy" + }, + { + "defaultValue": null, + "helpText": "The type of application on which to give feedback", + "alwaysRequired": true, + "referenceName": "Microsoft.VSTS.Feedback.ApplicationType", + "name": "Application Type", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Feedback.ApplicationType" + }, + { + "defaultValue": null, + "helpText": "The path to execute the application", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Feedback.ApplicationStartInformation", + "name": "Application Start Information", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Feedback.ApplicationStartInformation" + }, + { + "defaultValue": null, + "helpText": "Instructions to launch the specified application", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Feedback.ApplicationLaunchInstructions", + "name": "Application Launch Instructions", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Feedback.ApplicationLaunchInstructions" + }, + { + "defaultValue": null, + "helpText": "The build in which the bug was fixed", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Build.IntegrationBuild", + "name": "Integration Build", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Build.IntegrationBuild" + } + ], + "transitions": { + "Active": [ + { + "to": "Active", + "actions": null + }, + { + "to": "Removed", + "actions": null + }, + { + "to": "Closed", + "actions": null + } + ], + "Closed": [ + { + "to": "Closed", + "actions": null + }, + { + "to": "Active", + "actions": null + } + ], + "Removed": [ + { + "to": "Removed", + "actions": null + } + ], + "": [ + { + "to": "Active", + "actions": null + } + ] + }, + "states": [ + { + "name": "Active", + "color": "007acc", + "category": "InProgress" + }, + { + "name": "Closed", + "color": "339933", + "category": "Completed" + }, + { + "name": "Removed", + "color": "ffffff", + "category": "Removed" + } + ], + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/workItemTypes/Feedback%20Request" + }, + { + "name": "Feedback Response", + "referenceName": "Microsoft.VSTS.WorkItemTypes.FeedbackResponse", + "description": "This is a child work item that should be parented to a Feedback Request work item. It is assigned to the reviewer and contains the current state of the review for this reviewer.", + "color": "004B50", + "icon": { + "id": "icon_response", + "url": "https://tfsprodcus3.visualstudio.com/_apis/wit/workItemIcons/icon_response?color=004B50&v=2" + }, + "isDisabled": false, + "xmlForm": "
", + "fields": [ + { + "defaultValue": null, + "helpText": "The iteration within which this feedback response was requested", + "alwaysRequired": false, + "referenceName": "System.IterationPath", + "name": "Iteration Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationPath" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.IterationId", + "name": "Iteration ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ExternalLinkCount", + "name": "External Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ExternalLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel7", + "name": "Iteration Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel6", + "name": "Iteration Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel5", + "name": "Iteration Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel4", + "name": "Iteration Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel3", + "name": "Iteration Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel2", + "name": "Iteration Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel1", + "name": "Iteration Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel7", + "name": "Area Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel6", + "name": "Area Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel5", + "name": "Area Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel4", + "name": "Area Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel3", + "name": "Area Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel2", + "name": "Area Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel1", + "name": "Area Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.TeamProject", + "name": "Team Project", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.TeamProject" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Parent", + "name": "Parent", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Parent" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RemoteLinkCount", + "name": "Remote Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RemoteLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CommentCount", + "name": "Comment Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CommentCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.HyperLinkCount", + "name": "Hyperlink Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.HyperLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AttachedFileCount", + "name": "Attached File Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AttachedFileCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.NodeName", + "name": "Node Name", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.NodeName" + }, + { + "defaultValue": null, + "helpText": "The area of the product with which this feedback response is associated", + "alwaysRequired": false, + "referenceName": "System.AreaPath", + "name": "Area Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaPath" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RevisedDate", + "name": "Revised Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RevisedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedDate", + "name": "Changed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Id", + "name": "ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Id" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.AreaId", + "name": "Area ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedAs", + "name": "Authorized As", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedAs" + }, + { + "defaultValue": null, + "helpText": "One line summary of the feedback response", + "alwaysRequired": true, + "referenceName": "System.Title", + "name": "Title", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Title" + }, + { + "defaultValue": "Active", + "helpText": "Current status of the feedback response", + "alwaysRequired": true, + "referenceName": "System.State", + "name": "State", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.State" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedDate", + "name": "Authorized Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Watermark", + "name": "Watermark", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Watermark" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Rev", + "name": "Rev", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Rev" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedBy", + "name": "Changed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedBy" + }, + { + "defaultValue": null, + "helpText": "The reason why the feedback response is in its current state", + "alwaysRequired": false, + "referenceName": "System.Reason", + "name": "Reason", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Reason" + }, + { + "defaultValue": null, + "helpText": "Person responsible for next set of actions on the feedback", + "alwaysRequired": false, + "referenceName": "System.AssignedTo", + "name": "Assigned To", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AssignedTo" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.WorkItemType", + "name": "Work Item Type", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.WorkItemType" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedDate", + "name": "Created Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedBy", + "name": "Created By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedBy" + }, + { + "defaultValue": null, + "helpText": "Feedback response from the stakeholder", + "alwaysRequired": false, + "referenceName": "System.Description", + "name": "Description", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Description" + }, + { + "defaultValue": null, + "helpText": "Discussion thread plus automatic record of changes", + "alwaysRequired": false, + "referenceName": "System.History", + "name": "History", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.History" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RelatedLinkCount", + "name": "Related Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RelatedLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Tags", + "name": "Tags", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Tags" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumn", + "name": "Board Column", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumn" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumnDone", + "name": "Board Column Done", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumnDone" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardLane", + "name": "Board Lane", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardLane" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedDate", + "name": "Closed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedBy", + "name": "Closed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedBy" + }, + { + "defaultValue": "0 - Not Rated", + "helpText": "Overall rating provided as part of feedback response", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.Rating", + "name": "Rating", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.Rating" + }, + { + "defaultValue": null, + "helpText": "Test context, provided automatically by test infrastructure", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.TCM.SystemInfo", + "name": "System Info", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.TCM.SystemInfo" + }, + { + "defaultValue": null, + "helpText": "The build in which the bug was fixed", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Build.IntegrationBuild", + "name": "Integration Build", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Build.IntegrationBuild" + } + ], + "fieldInstances": [ + { + "defaultValue": null, + "helpText": "The iteration within which this feedback response was requested", + "alwaysRequired": false, + "referenceName": "System.IterationPath", + "name": "Iteration Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationPath" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.IterationId", + "name": "Iteration ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ExternalLinkCount", + "name": "External Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ExternalLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel7", + "name": "Iteration Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel6", + "name": "Iteration Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel5", + "name": "Iteration Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel4", + "name": "Iteration Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel3", + "name": "Iteration Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel2", + "name": "Iteration Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel1", + "name": "Iteration Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel7", + "name": "Area Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel6", + "name": "Area Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel5", + "name": "Area Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel4", + "name": "Area Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel3", + "name": "Area Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel2", + "name": "Area Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel1", + "name": "Area Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.TeamProject", + "name": "Team Project", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.TeamProject" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Parent", + "name": "Parent", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Parent" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RemoteLinkCount", + "name": "Remote Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RemoteLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CommentCount", + "name": "Comment Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CommentCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.HyperLinkCount", + "name": "Hyperlink Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.HyperLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AttachedFileCount", + "name": "Attached File Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AttachedFileCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.NodeName", + "name": "Node Name", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.NodeName" + }, + { + "defaultValue": null, + "helpText": "The area of the product with which this feedback response is associated", + "alwaysRequired": false, + "referenceName": "System.AreaPath", + "name": "Area Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaPath" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RevisedDate", + "name": "Revised Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RevisedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedDate", + "name": "Changed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Id", + "name": "ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Id" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.AreaId", + "name": "Area ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedAs", + "name": "Authorized As", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedAs" + }, + { + "defaultValue": null, + "helpText": "One line summary of the feedback response", + "alwaysRequired": true, + "referenceName": "System.Title", + "name": "Title", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Title" + }, + { + "defaultValue": "Active", + "helpText": "Current status of the feedback response", + "alwaysRequired": true, + "referenceName": "System.State", + "name": "State", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.State" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedDate", + "name": "Authorized Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Watermark", + "name": "Watermark", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Watermark" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Rev", + "name": "Rev", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Rev" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedBy", + "name": "Changed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedBy" + }, + { + "defaultValue": null, + "helpText": "The reason why the feedback response is in its current state", + "alwaysRequired": false, + "referenceName": "System.Reason", + "name": "Reason", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Reason" + }, + { + "defaultValue": null, + "helpText": "Person responsible for next set of actions on the feedback", + "alwaysRequired": false, + "referenceName": "System.AssignedTo", + "name": "Assigned To", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AssignedTo" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.WorkItemType", + "name": "Work Item Type", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.WorkItemType" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedDate", + "name": "Created Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedBy", + "name": "Created By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedBy" + }, + { + "defaultValue": null, + "helpText": "Feedback response from the stakeholder", + "alwaysRequired": false, + "referenceName": "System.Description", + "name": "Description", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Description" + }, + { + "defaultValue": null, + "helpText": "Discussion thread plus automatic record of changes", + "alwaysRequired": false, + "referenceName": "System.History", + "name": "History", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.History" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RelatedLinkCount", + "name": "Related Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RelatedLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Tags", + "name": "Tags", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Tags" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumn", + "name": "Board Column", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumn" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumnDone", + "name": "Board Column Done", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumnDone" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardLane", + "name": "Board Lane", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardLane" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedDate", + "name": "Closed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedBy", + "name": "Closed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedBy" + }, + { + "defaultValue": "0 - Not Rated", + "helpText": "Overall rating provided as part of feedback response", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.Rating", + "name": "Rating", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.Rating" + }, + { + "defaultValue": null, + "helpText": "Test context, provided automatically by test infrastructure", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.TCM.SystemInfo", + "name": "System Info", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.TCM.SystemInfo" + }, + { + "defaultValue": null, + "helpText": "The build in which the bug was fixed", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Build.IntegrationBuild", + "name": "Integration Build", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Build.IntegrationBuild" + } + ], + "transitions": { + "Active": [ + { + "to": "Active", + "actions": null + }, + { + "to": "Closed", + "actions": null + } + ], + "Closed": [ + { + "to": "Closed", + "actions": null + } + ], + "": [ + { + "to": "Active", + "actions": null + } + ] + }, + "states": [ + { + "name": "Active", + "color": "007acc", + "category": "InProgress" + }, + { + "name": "Closed", + "color": "339933", + "category": "Completed" + } + ], + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/workItemTypes/Feedback%20Response" + }, + { + "name": "Shared Steps", + "referenceName": "Microsoft.VSTS.WorkItemTypes.SharedStep", + "description": "Server-side data for reusable set of test steps.", + "color": "004B50", + "icon": { + "id": "icon_test_step", + "url": "https://tfsprodcus3.visualstudio.com/_apis/wit/workItemIcons/icon_test_step?color=004B50&v=2" + }, + "isDisabled": false, + "xmlForm": "
", + "fields": [ + { + "defaultValue": null, + "helpText": "The iteration of the product with which this shared step is associated", + "alwaysRequired": false, + "referenceName": "System.IterationPath", + "name": "Iteration Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationPath" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.IterationId", + "name": "Iteration ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ExternalLinkCount", + "name": "External Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ExternalLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel7", + "name": "Iteration Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel6", + "name": "Iteration Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel5", + "name": "Iteration Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel4", + "name": "Iteration Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel3", + "name": "Iteration Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel2", + "name": "Iteration Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel1", + "name": "Iteration Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel7", + "name": "Area Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel6", + "name": "Area Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel5", + "name": "Area Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel4", + "name": "Area Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel3", + "name": "Area Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel2", + "name": "Area Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel1", + "name": "Area Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.TeamProject", + "name": "Team Project", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.TeamProject" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Parent", + "name": "Parent", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Parent" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RemoteLinkCount", + "name": "Remote Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RemoteLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CommentCount", + "name": "Comment Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CommentCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.HyperLinkCount", + "name": "Hyperlink Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.HyperLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AttachedFileCount", + "name": "Attached File Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AttachedFileCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.NodeName", + "name": "Node Name", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.NodeName" + }, + { + "defaultValue": null, + "helpText": "The area of the product with which this shared step is associated", + "alwaysRequired": false, + "referenceName": "System.AreaPath", + "name": "Area Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaPath" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RevisedDate", + "name": "Revised Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RevisedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedDate", + "name": "Changed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Id", + "name": "ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Id" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.AreaId", + "name": "Area ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedAs", + "name": "Authorized As", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedAs" + }, + { + "defaultValue": null, + "helpText": "Short description of the shared step used to differentiate it in a list or report", + "alwaysRequired": true, + "referenceName": "System.Title", + "name": "Title", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Title" + }, + { + "defaultValue": "Active", + "helpText": "The workflow state of the shared step", + "alwaysRequired": true, + "referenceName": "System.State", + "name": "State", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.State" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedDate", + "name": "Authorized Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Watermark", + "name": "Watermark", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Watermark" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Rev", + "name": "Rev", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Rev" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedBy", + "name": "Changed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedBy" + }, + { + "defaultValue": null, + "helpText": "The reason why the shared step is in the current state", + "alwaysRequired": false, + "referenceName": "System.Reason", + "name": "Reason", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Reason" + }, + { + "defaultValue": null, + "helpText": "The person currently working on these shared steps", + "alwaysRequired": false, + "referenceName": "System.AssignedTo", + "name": "Assigned To", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AssignedTo" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.WorkItemType", + "name": "Work Item Type", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.WorkItemType" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedDate", + "name": "Created Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedBy", + "name": "Created By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Description", + "name": "Description", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Description" + }, + { + "defaultValue": null, + "helpText": "Discussion thread and other historical information", + "alwaysRequired": false, + "referenceName": "System.History", + "name": "History", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.History" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RelatedLinkCount", + "name": "Related Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RelatedLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Tags", + "name": "Tags", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Tags" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumn", + "name": "Board Column", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumn" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumnDone", + "name": "Board Column Done", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumnDone" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardLane", + "name": "Board Lane", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardLane" + }, + { + "defaultValue": "No", + "helpText": "Used to highlight the shared step, e.g., to mark it as an issue.", + "alwaysRequired": true, + "referenceName": "Microsoft.VSTS.Common.Issue", + "name": "Issue", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.Issue" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.StateChangeDate", + "name": "State Change Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.StateChangeDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ActivatedDate", + "name": "Activated Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ActivatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ActivatedBy", + "name": "Activated By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ActivatedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedDate", + "name": "Closed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedBy", + "name": "Closed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedBy" + }, + { + "defaultValue": "2", + "helpText": "Priority to the business", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.Priority", + "name": "Priority", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.Priority" + }, + { + "defaultValue": null, + "helpText": "Steps required to perform the test", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.TCM.Steps", + "name": "Steps", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.TCM.Steps" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.TCM.Parameters", + "name": "Parameters", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.TCM.Parameters" + }, + { + "defaultValue": null, + "helpText": "The build in which the bug was fixed", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Build.IntegrationBuild", + "name": "Integration Build", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Build.IntegrationBuild" + } + ], + "fieldInstances": [ + { + "defaultValue": null, + "helpText": "The iteration of the product with which this shared step is associated", + "alwaysRequired": false, + "referenceName": "System.IterationPath", + "name": "Iteration Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationPath" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.IterationId", + "name": "Iteration ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ExternalLinkCount", + "name": "External Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ExternalLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel7", + "name": "Iteration Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel6", + "name": "Iteration Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel5", + "name": "Iteration Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel4", + "name": "Iteration Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel3", + "name": "Iteration Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel2", + "name": "Iteration Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel1", + "name": "Iteration Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel7", + "name": "Area Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel6", + "name": "Area Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel5", + "name": "Area Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel4", + "name": "Area Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel3", + "name": "Area Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel2", + "name": "Area Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel1", + "name": "Area Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.TeamProject", + "name": "Team Project", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.TeamProject" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Parent", + "name": "Parent", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Parent" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RemoteLinkCount", + "name": "Remote Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RemoteLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CommentCount", + "name": "Comment Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CommentCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.HyperLinkCount", + "name": "Hyperlink Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.HyperLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AttachedFileCount", + "name": "Attached File Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AttachedFileCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.NodeName", + "name": "Node Name", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.NodeName" + }, + { + "defaultValue": null, + "helpText": "The area of the product with which this shared step is associated", + "alwaysRequired": false, + "referenceName": "System.AreaPath", + "name": "Area Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaPath" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RevisedDate", + "name": "Revised Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RevisedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedDate", + "name": "Changed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Id", + "name": "ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Id" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.AreaId", + "name": "Area ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedAs", + "name": "Authorized As", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedAs" + }, + { + "defaultValue": null, + "helpText": "Short description of the shared step used to differentiate it in a list or report", + "alwaysRequired": true, + "referenceName": "System.Title", + "name": "Title", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Title" + }, + { + "defaultValue": "Active", + "helpText": "The workflow state of the shared step", + "alwaysRequired": true, + "referenceName": "System.State", + "name": "State", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.State" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedDate", + "name": "Authorized Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Watermark", + "name": "Watermark", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Watermark" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Rev", + "name": "Rev", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Rev" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedBy", + "name": "Changed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedBy" + }, + { + "defaultValue": null, + "helpText": "The reason why the shared step is in the current state", + "alwaysRequired": false, + "referenceName": "System.Reason", + "name": "Reason", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Reason" + }, + { + "defaultValue": null, + "helpText": "The person currently working on these shared steps", + "alwaysRequired": false, + "referenceName": "System.AssignedTo", + "name": "Assigned To", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AssignedTo" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.WorkItemType", + "name": "Work Item Type", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.WorkItemType" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedDate", + "name": "Created Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedBy", + "name": "Created By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Description", + "name": "Description", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Description" + }, + { + "defaultValue": null, + "helpText": "Discussion thread and other historical information", + "alwaysRequired": false, + "referenceName": "System.History", + "name": "History", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.History" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RelatedLinkCount", + "name": "Related Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RelatedLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Tags", + "name": "Tags", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Tags" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumn", + "name": "Board Column", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumn" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumnDone", + "name": "Board Column Done", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumnDone" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardLane", + "name": "Board Lane", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardLane" + }, + { + "defaultValue": "No", + "helpText": "Used to highlight the shared step, e.g., to mark it as an issue.", + "alwaysRequired": true, + "referenceName": "Microsoft.VSTS.Common.Issue", + "name": "Issue", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.Issue" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.StateChangeDate", + "name": "State Change Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.StateChangeDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ActivatedDate", + "name": "Activated Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ActivatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ActivatedBy", + "name": "Activated By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ActivatedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedDate", + "name": "Closed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedBy", + "name": "Closed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedBy" + }, + { + "defaultValue": "2", + "helpText": "Priority to the business", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.Priority", + "name": "Priority", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.Priority" + }, + { + "defaultValue": null, + "helpText": "Steps required to perform the test", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.TCM.Steps", + "name": "Steps", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.TCM.Steps" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.TCM.Parameters", + "name": "Parameters", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.TCM.Parameters" + }, + { + "defaultValue": null, + "helpText": "The build in which the bug was fixed", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Build.IntegrationBuild", + "name": "Integration Build", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Build.IntegrationBuild" + } + ], + "transitions": { + "Active": [ + { + "to": "Active", + "actions": null + }, + { + "to": "Closed", + "actions": null + } + ], + "Closed": [ + { + "to": "Closed", + "actions": null + }, + { + "to": "Active", + "actions": null + } + ], + "": [ + { + "to": "Active", + "actions": null + } + ] + }, + "states": [ + { + "name": "Active", + "color": "007acc", + "category": "InProgress" + }, + { + "name": "Closed", + "color": "339933", + "category": "Completed" + } + ], + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/workItemTypes/Shared%20Steps" + }, + { + "name": "Task", + "referenceName": "Microsoft.VSTS.WorkItemTypes.Task", + "description": "Tracks work that needs to be done.", + "color": "F2CB1D", + "icon": { + "id": "icon_clipboard", + "url": "https://tfsprodcus3.visualstudio.com/_apis/wit/workItemIcons/icon_clipboard?color=F2CB1D&v=2" + }, + "isDisabled": false, + "xmlForm": "
", + "fields": [ + { + "defaultValue": null, + "helpText": "The iteration within which this task will be completed", + "alwaysRequired": false, + "referenceName": "System.IterationPath", + "name": "Iteration Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationPath" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.IterationId", + "name": "Iteration ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ExternalLinkCount", + "name": "External Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ExternalLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel7", + "name": "Iteration Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel6", + "name": "Iteration Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel5", + "name": "Iteration Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel4", + "name": "Iteration Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel3", + "name": "Iteration Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel2", + "name": "Iteration Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel1", + "name": "Iteration Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel7", + "name": "Area Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel6", + "name": "Area Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel5", + "name": "Area Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel4", + "name": "Area Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel3", + "name": "Area Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel2", + "name": "Area Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel1", + "name": "Area Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.TeamProject", + "name": "Team Project", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.TeamProject" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Parent", + "name": "Parent", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Parent" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RemoteLinkCount", + "name": "Remote Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RemoteLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CommentCount", + "name": "Comment Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CommentCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.HyperLinkCount", + "name": "Hyperlink Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.HyperLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AttachedFileCount", + "name": "Attached File Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AttachedFileCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.NodeName", + "name": "Node Name", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.NodeName" + }, + { + "defaultValue": null, + "helpText": "The area of the product to which this task contributes", + "alwaysRequired": false, + "referenceName": "System.AreaPath", + "name": "Area Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaPath" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RevisedDate", + "name": "Revised Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RevisedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedDate", + "name": "Changed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Id", + "name": "ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Id" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.AreaId", + "name": "Area ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedAs", + "name": "Authorized As", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedAs" + }, + { + "defaultValue": null, + "helpText": "Work required and how this will implement a User Story", + "alwaysRequired": true, + "referenceName": "System.Title", + "name": "Title", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Title" + }, + { + "defaultValue": "New", + "helpText": "New = New work not yet activated; Active = work remains to be done; Closed = tested and checked in.", + "alwaysRequired": true, + "referenceName": "System.State", + "name": "State", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.State" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedDate", + "name": "Authorized Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Watermark", + "name": "Watermark", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Watermark" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Rev", + "name": "Rev", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Rev" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedBy", + "name": "Changed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedBy" + }, + { + "defaultValue": null, + "helpText": "The reason why the task is in its current state", + "alwaysRequired": false, + "referenceName": "System.Reason", + "name": "Reason", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Reason" + }, + { + "defaultValue": null, + "helpText": "The person currently working on this task", + "alwaysRequired": false, + "referenceName": "System.AssignedTo", + "name": "Assigned To", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AssignedTo" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.WorkItemType", + "name": "Work Item Type", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.WorkItemType" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedDate", + "name": "Created Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedBy", + "name": "Created By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedBy" + }, + { + "defaultValue": null, + "helpText": "What to do, pointers to resources and inputs, design notes, exit criteria", + "alwaysRequired": false, + "referenceName": "System.Description", + "name": "Description", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Description" + }, + { + "defaultValue": null, + "helpText": "Discussion thread plus automatic record of changes", + "alwaysRequired": false, + "referenceName": "System.History", + "name": "History", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.History" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RelatedLinkCount", + "name": "Related Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RelatedLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Tags", + "name": "Tags", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Tags" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumn", + "name": "Board Column", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumn" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumnDone", + "name": "Board Column Done", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumnDone" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardLane", + "name": "Board Lane", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardLane" + }, + { + "defaultValue": null, + "helpText": "Type of work involved", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.Activity", + "name": "Activity", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.Activity" + }, + { + "defaultValue": null, + "helpText": "An estimate of the number of units of work remaining to complete this task", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.RemainingWork", + "name": "Remaining Work", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.RemainingWork" + }, + { + "defaultValue": null, + "helpText": "Initial value for Remaining Work - set once, when work begins", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.OriginalEstimate", + "name": "Original Estimate", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.OriginalEstimate" + }, + { + "defaultValue": null, + "helpText": "The number of units of work that have been spent on this task", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.CompletedWork", + "name": "Completed Work", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.CompletedWork" + }, + { + "defaultValue": "2", + "helpText": "Importance to business", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.Priority", + "name": "Priority", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.Priority" + }, + { + "defaultValue": null, + "helpText": "Work first on items with lower-valued stack rank. Set in triage.", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.StackRank", + "name": "Stack Rank", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.StackRank" + }, + { + "defaultValue": null, + "helpText": "The date to start the task", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.StartDate", + "name": "Start Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.StartDate" + }, + { + "defaultValue": null, + "helpText": "The date to finish the task", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.FinishDate", + "name": "Finish Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.FinishDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.StateChangeDate", + "name": "State Change Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.StateChangeDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ActivatedDate", + "name": "Activated Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ActivatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ActivatedBy", + "name": "Activated By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ActivatedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedDate", + "name": "Closed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedBy", + "name": "Closed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedBy" + }, + { + "defaultValue": null, + "helpText": "The build in which the bug was fixed", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Build.IntegrationBuild", + "name": "Integration Build", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Build.IntegrationBuild" + } + ], + "fieldInstances": [ + { + "defaultValue": null, + "helpText": "The iteration within which this task will be completed", + "alwaysRequired": false, + "referenceName": "System.IterationPath", + "name": "Iteration Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationPath" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.IterationId", + "name": "Iteration ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ExternalLinkCount", + "name": "External Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ExternalLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel7", + "name": "Iteration Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel6", + "name": "Iteration Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel5", + "name": "Iteration Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel4", + "name": "Iteration Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel3", + "name": "Iteration Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel2", + "name": "Iteration Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel1", + "name": "Iteration Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel7", + "name": "Area Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel6", + "name": "Area Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel5", + "name": "Area Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel4", + "name": "Area Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel3", + "name": "Area Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel2", + "name": "Area Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel1", + "name": "Area Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.TeamProject", + "name": "Team Project", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.TeamProject" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Parent", + "name": "Parent", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Parent" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RemoteLinkCount", + "name": "Remote Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RemoteLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CommentCount", + "name": "Comment Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CommentCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.HyperLinkCount", + "name": "Hyperlink Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.HyperLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AttachedFileCount", + "name": "Attached File Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AttachedFileCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.NodeName", + "name": "Node Name", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.NodeName" + }, + { + "defaultValue": null, + "helpText": "The area of the product to which this task contributes", + "alwaysRequired": false, + "referenceName": "System.AreaPath", + "name": "Area Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaPath" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RevisedDate", + "name": "Revised Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RevisedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedDate", + "name": "Changed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Id", + "name": "ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Id" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.AreaId", + "name": "Area ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedAs", + "name": "Authorized As", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedAs" + }, + { + "defaultValue": null, + "helpText": "Work required and how this will implement a User Story", + "alwaysRequired": true, + "referenceName": "System.Title", + "name": "Title", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Title" + }, + { + "defaultValue": "New", + "helpText": "New = New work not yet activated; Active = work remains to be done; Closed = tested and checked in.", + "alwaysRequired": true, + "referenceName": "System.State", + "name": "State", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.State" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedDate", + "name": "Authorized Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Watermark", + "name": "Watermark", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Watermark" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Rev", + "name": "Rev", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Rev" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedBy", + "name": "Changed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedBy" + }, + { + "defaultValue": null, + "helpText": "The reason why the task is in its current state", + "alwaysRequired": false, + "referenceName": "System.Reason", + "name": "Reason", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Reason" + }, + { + "defaultValue": null, + "helpText": "The person currently working on this task", + "alwaysRequired": false, + "referenceName": "System.AssignedTo", + "name": "Assigned To", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AssignedTo" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.WorkItemType", + "name": "Work Item Type", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.WorkItemType" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedDate", + "name": "Created Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedBy", + "name": "Created By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedBy" + }, + { + "defaultValue": null, + "helpText": "What to do, pointers to resources and inputs, design notes, exit criteria", + "alwaysRequired": false, + "referenceName": "System.Description", + "name": "Description", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Description" + }, + { + "defaultValue": null, + "helpText": "Discussion thread plus automatic record of changes", + "alwaysRequired": false, + "referenceName": "System.History", + "name": "History", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.History" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RelatedLinkCount", + "name": "Related Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RelatedLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Tags", + "name": "Tags", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Tags" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumn", + "name": "Board Column", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumn" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumnDone", + "name": "Board Column Done", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumnDone" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardLane", + "name": "Board Lane", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardLane" + }, + { + "defaultValue": null, + "helpText": "Type of work involved", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.Activity", + "name": "Activity", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.Activity" + }, + { + "defaultValue": null, + "helpText": "An estimate of the number of units of work remaining to complete this task", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.RemainingWork", + "name": "Remaining Work", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.RemainingWork" + }, + { + "defaultValue": null, + "helpText": "Initial value for Remaining Work - set once, when work begins", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.OriginalEstimate", + "name": "Original Estimate", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.OriginalEstimate" + }, + { + "defaultValue": null, + "helpText": "The number of units of work that have been spent on this task", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.CompletedWork", + "name": "Completed Work", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.CompletedWork" + }, + { + "defaultValue": "2", + "helpText": "Importance to business", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.Priority", + "name": "Priority", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.Priority" + }, + { + "defaultValue": null, + "helpText": "Work first on items with lower-valued stack rank. Set in triage.", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.StackRank", + "name": "Stack Rank", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.StackRank" + }, + { + "defaultValue": null, + "helpText": "The date to start the task", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.StartDate", + "name": "Start Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.StartDate" + }, + { + "defaultValue": null, + "helpText": "The date to finish the task", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.FinishDate", + "name": "Finish Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.FinishDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.StateChangeDate", + "name": "State Change Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.StateChangeDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ActivatedDate", + "name": "Activated Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ActivatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ActivatedBy", + "name": "Activated By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ActivatedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedDate", + "name": "Closed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedBy", + "name": "Closed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedBy" + }, + { + "defaultValue": null, + "helpText": "The build in which the bug was fixed", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Build.IntegrationBuild", + "name": "Integration Build", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Build.IntegrationBuild" + } + ], + "transitions": { + "Active": [ + { + "to": "Active", + "actions": null + }, + { + "to": "Removed", + "actions": null + }, + { + "to": "Closed", + "actions": [ + "Microsoft.VSTS.Actions.Checkin" + ] + }, + { + "to": "New", + "actions": [ + "Microsoft.VSTS.Actions.StopWork" + ] + } + ], + "Closed": [ + { + "to": "Closed", + "actions": null + }, + { + "to": "Active", + "actions": null + }, + { + "to": "New", + "actions": null + } + ], + "New": [ + { + "to": "New", + "actions": null + }, + { + "to": "Removed", + "actions": null + }, + { + "to": "Closed", + "actions": [ + "Microsoft.VSTS.Actions.Checkin" + ] + }, + { + "to": "Active", + "actions": [ + "Microsoft.VSTS.Actions.StartWork" + ] + } + ], + "Removed": [ + { + "to": "Removed", + "actions": null + }, + { + "to": "New", + "actions": null + } + ], + "": [ + { + "to": "New", + "actions": null + } + ] + }, + "states": [ + { + "name": "New", + "color": "b2b2b2", + "category": "Proposed" + }, + { + "name": "Active", + "color": "007acc", + "category": "InProgress" + }, + { + "name": "Closed", + "color": "339933", + "category": "Completed" + }, + { + "name": "Removed", + "color": "ffffff", + "category": "Removed" + } + ], + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/workItemTypes/Task" + }, + { + "name": "Test Case", + "referenceName": "Microsoft.VSTS.WorkItemTypes.TestCase", + "description": "Server-side data for a set of steps to be tested.", + "color": "004B50", + "icon": { + "id": "icon_test_case", + "url": "https://tfsprodcus3.visualstudio.com/_apis/wit/workItemIcons/icon_test_case?color=004B50&v=2" + }, + "isDisabled": false, + "xmlForm": "
", + "fields": [ + { + "defaultValue": null, + "helpText": "The iteration within which this bug will be fixed", + "alwaysRequired": false, + "referenceName": "System.IterationPath", + "name": "Iteration Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationPath" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.IterationId", + "name": "Iteration ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ExternalLinkCount", + "name": "External Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ExternalLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel7", + "name": "Iteration Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel6", + "name": "Iteration Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel5", + "name": "Iteration Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel4", + "name": "Iteration Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel3", + "name": "Iteration Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel2", + "name": "Iteration Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel1", + "name": "Iteration Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel7", + "name": "Area Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel6", + "name": "Area Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel5", + "name": "Area Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel4", + "name": "Area Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel3", + "name": "Area Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel2", + "name": "Area Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel1", + "name": "Area Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.TeamProject", + "name": "Team Project", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.TeamProject" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Parent", + "name": "Parent", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Parent" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RemoteLinkCount", + "name": "Remote Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RemoteLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CommentCount", + "name": "Comment Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CommentCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.HyperLinkCount", + "name": "Hyperlink Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.HyperLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AttachedFileCount", + "name": "Attached File Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AttachedFileCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.NodeName", + "name": "Node Name", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.NodeName" + }, + { + "defaultValue": null, + "helpText": "The area of the product with which this test case is associated", + "alwaysRequired": false, + "referenceName": "System.AreaPath", + "name": "Area Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaPath" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RevisedDate", + "name": "Revised Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RevisedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedDate", + "name": "Changed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Id", + "name": "ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Id" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.AreaId", + "name": "Area ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedAs", + "name": "Authorized As", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedAs" + }, + { + "defaultValue": null, + "helpText": "Short description of the test case used to differentiate it in a list or report", + "alwaysRequired": true, + "referenceName": "System.Title", + "name": "Title", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Title" + }, + { + "defaultValue": "Design", + "helpText": "The workflow state of the test case", + "alwaysRequired": true, + "referenceName": "System.State", + "name": "State", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.State" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedDate", + "name": "Authorized Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Watermark", + "name": "Watermark", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Watermark" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Rev", + "name": "Rev", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Rev" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedBy", + "name": "Changed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedBy" + }, + { + "defaultValue": null, + "helpText": "The reason why the test case is in the current state", + "alwaysRequired": false, + "referenceName": "System.Reason", + "name": "Reason", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Reason" + }, + { + "defaultValue": null, + "helpText": "The person currently working on this test case", + "alwaysRequired": false, + "referenceName": "System.AssignedTo", + "name": "Assigned To", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AssignedTo" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.WorkItemType", + "name": "Work Item Type", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.WorkItemType" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedDate", + "name": "Created Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedBy", + "name": "Created By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedBy" + }, + { + "defaultValue": null, + "helpText": "Purpose of this test; requirement tested", + "alwaysRequired": false, + "referenceName": "System.Description", + "name": "Description", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Description" + }, + { + "defaultValue": null, + "helpText": "Discussion thread plus automatic record of changes", + "alwaysRequired": false, + "referenceName": "System.History", + "name": "History", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.History" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RelatedLinkCount", + "name": "Related Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RelatedLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Tags", + "name": "Tags", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Tags" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumn", + "name": "Board Column", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumn" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumnDone", + "name": "Board Column Done", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumnDone" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardLane", + "name": "Board Lane", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardLane" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.StateChangeDate", + "name": "State Change Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.StateChangeDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ActivatedDate", + "name": "Activated Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ActivatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ActivatedBy", + "name": "Activated By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ActivatedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedDate", + "name": "Closed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedBy", + "name": "Closed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedBy" + }, + { + "defaultValue": "2", + "helpText": "Importance of this test case to the business goals of the product. 1=Most important.", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.Priority", + "name": "Priority", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.Priority" + }, + { + "defaultValue": null, + "helpText": "Steps required to perform the test", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.TCM.Steps", + "name": "Steps", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.TCM.Steps" + }, + { + "defaultValue": null, + "helpText": "The name of the test that automates this test case", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.TCM.AutomatedTestName", + "name": "Automated Test Name", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.TCM.AutomatedTestName" + }, + { + "defaultValue": null, + "helpText": "The assembly containing the test that automates this test case", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.TCM.AutomatedTestStorage", + "name": "Automated Test Storage", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.TCM.AutomatedTestStorage" + }, + { + "defaultValue": null, + "helpText": "The ID of the test that automates this test case", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.TCM.AutomatedTestId", + "name": "Automated Test Id", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.TCM.AutomatedTestId" + }, + { + "defaultValue": null, + "helpText": "The type of the test that automates this test case", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.TCM.AutomatedTestType", + "name": "Automated Test Type", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.TCM.AutomatedTestType" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.TCM.Parameters", + "name": "Parameters", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.TCM.Parameters" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.TCM.LocalDataSource", + "name": "Local Data Source", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.TCM.LocalDataSource" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.TCM.AutomationStatus", + "name": "Automation status", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.TCM.AutomationStatus" + }, + { + "defaultValue": null, + "helpText": "The build in which the bug was fixed", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Build.IntegrationBuild", + "name": "Integration Build", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Build.IntegrationBuild" + } + ], + "fieldInstances": [ + { + "defaultValue": null, + "helpText": "The iteration within which this bug will be fixed", + "alwaysRequired": false, + "referenceName": "System.IterationPath", + "name": "Iteration Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationPath" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.IterationId", + "name": "Iteration ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ExternalLinkCount", + "name": "External Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ExternalLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel7", + "name": "Iteration Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel6", + "name": "Iteration Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel5", + "name": "Iteration Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel4", + "name": "Iteration Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel3", + "name": "Iteration Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel2", + "name": "Iteration Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel1", + "name": "Iteration Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel7", + "name": "Area Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel6", + "name": "Area Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel5", + "name": "Area Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel4", + "name": "Area Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel3", + "name": "Area Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel2", + "name": "Area Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel1", + "name": "Area Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.TeamProject", + "name": "Team Project", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.TeamProject" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Parent", + "name": "Parent", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Parent" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RemoteLinkCount", + "name": "Remote Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RemoteLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CommentCount", + "name": "Comment Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CommentCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.HyperLinkCount", + "name": "Hyperlink Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.HyperLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AttachedFileCount", + "name": "Attached File Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AttachedFileCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.NodeName", + "name": "Node Name", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.NodeName" + }, + { + "defaultValue": null, + "helpText": "The area of the product with which this test case is associated", + "alwaysRequired": false, + "referenceName": "System.AreaPath", + "name": "Area Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaPath" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RevisedDate", + "name": "Revised Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RevisedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedDate", + "name": "Changed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Id", + "name": "ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Id" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.AreaId", + "name": "Area ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedAs", + "name": "Authorized As", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedAs" + }, + { + "defaultValue": null, + "helpText": "Short description of the test case used to differentiate it in a list or report", + "alwaysRequired": true, + "referenceName": "System.Title", + "name": "Title", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Title" + }, + { + "defaultValue": "Design", + "helpText": "The workflow state of the test case", + "alwaysRequired": true, + "referenceName": "System.State", + "name": "State", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.State" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedDate", + "name": "Authorized Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Watermark", + "name": "Watermark", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Watermark" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Rev", + "name": "Rev", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Rev" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedBy", + "name": "Changed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedBy" + }, + { + "defaultValue": null, + "helpText": "The reason why the test case is in the current state", + "alwaysRequired": false, + "referenceName": "System.Reason", + "name": "Reason", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Reason" + }, + { + "defaultValue": null, + "helpText": "The person currently working on this test case", + "alwaysRequired": false, + "referenceName": "System.AssignedTo", + "name": "Assigned To", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AssignedTo" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.WorkItemType", + "name": "Work Item Type", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.WorkItemType" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedDate", + "name": "Created Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedBy", + "name": "Created By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedBy" + }, + { + "defaultValue": null, + "helpText": "Purpose of this test; requirement tested", + "alwaysRequired": false, + "referenceName": "System.Description", + "name": "Description", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Description" + }, + { + "defaultValue": null, + "helpText": "Discussion thread plus automatic record of changes", + "alwaysRequired": false, + "referenceName": "System.History", + "name": "History", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.History" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RelatedLinkCount", + "name": "Related Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RelatedLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Tags", + "name": "Tags", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Tags" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumn", + "name": "Board Column", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumn" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumnDone", + "name": "Board Column Done", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumnDone" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardLane", + "name": "Board Lane", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardLane" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.StateChangeDate", + "name": "State Change Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.StateChangeDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ActivatedDate", + "name": "Activated Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ActivatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ActivatedBy", + "name": "Activated By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ActivatedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedDate", + "name": "Closed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedBy", + "name": "Closed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedBy" + }, + { + "defaultValue": "2", + "helpText": "Importance of this test case to the business goals of the product. 1=Most important.", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.Priority", + "name": "Priority", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.Priority" + }, + { + "defaultValue": null, + "helpText": "Steps required to perform the test", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.TCM.Steps", + "name": "Steps", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.TCM.Steps" + }, + { + "defaultValue": null, + "helpText": "The name of the test that automates this test case", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.TCM.AutomatedTestName", + "name": "Automated Test Name", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.TCM.AutomatedTestName" + }, + { + "defaultValue": null, + "helpText": "The assembly containing the test that automates this test case", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.TCM.AutomatedTestStorage", + "name": "Automated Test Storage", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.TCM.AutomatedTestStorage" + }, + { + "defaultValue": null, + "helpText": "The ID of the test that automates this test case", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.TCM.AutomatedTestId", + "name": "Automated Test Id", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.TCM.AutomatedTestId" + }, + { + "defaultValue": null, + "helpText": "The type of the test that automates this test case", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.TCM.AutomatedTestType", + "name": "Automated Test Type", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.TCM.AutomatedTestType" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.TCM.Parameters", + "name": "Parameters", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.TCM.Parameters" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.TCM.LocalDataSource", + "name": "Local Data Source", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.TCM.LocalDataSource" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.TCM.AutomationStatus", + "name": "Automation status", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.TCM.AutomationStatus" + }, + { + "defaultValue": null, + "helpText": "The build in which the bug was fixed", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Build.IntegrationBuild", + "name": "Integration Build", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Build.IntegrationBuild" + } + ], + "transitions": { + "Closed": [ + { + "to": "Closed", + "actions": null + }, + { + "to": "Ready", + "actions": null + }, + { + "to": "Design", + "actions": null + } + ], + "Design": [ + { + "to": "Design", + "actions": null + }, + { + "to": "Ready", + "actions": null + }, + { + "to": "Closed", + "actions": null + } + ], + "Ready": [ + { + "to": "Ready", + "actions": null + }, + { + "to": "Closed", + "actions": null + }, + { + "to": "Design", + "actions": null + } + ], + "": [ + { + "to": "Design", + "actions": null + } + ] + }, + "states": [ + { + "name": "Design", + "color": "b2b2b2", + "category": "Proposed" + }, + { + "name": "Ready", + "color": "007acc", + "category": "InProgress" + }, + { + "name": "Closed", + "color": "339933", + "category": "Completed" + } + ], + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/workItemTypes/Test%20Case" + }, + { + "name": "Test Plan", + "referenceName": "Microsoft.VSTS.WorkItemTypes.TestPlan", + "description": "Tracks test activities for a specific milestone or release.", + "color": "004B50", + "icon": { + "id": "icon_test_plan", + "url": "https://tfsprodcus3.visualstudio.com/_apis/wit/workItemIcons/icon_test_plan?color=004B50&v=2" + }, + "isDisabled": false, + "xmlForm": "
", + "fields": [ + { + "defaultValue": null, + "helpText": "The iteration within which this test plan will execute.", + "alwaysRequired": false, + "referenceName": "System.IterationPath", + "name": "Iteration Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationPath" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.IterationId", + "name": "Iteration ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ExternalLinkCount", + "name": "External Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ExternalLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel7", + "name": "Iteration Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel6", + "name": "Iteration Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel5", + "name": "Iteration Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel4", + "name": "Iteration Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel3", + "name": "Iteration Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel2", + "name": "Iteration Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel1", + "name": "Iteration Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel7", + "name": "Area Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel6", + "name": "Area Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel5", + "name": "Area Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel4", + "name": "Area Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel3", + "name": "Area Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel2", + "name": "Area Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel1", + "name": "Area Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.TeamProject", + "name": "Team Project", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.TeamProject" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Parent", + "name": "Parent", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Parent" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RemoteLinkCount", + "name": "Remote Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RemoteLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CommentCount", + "name": "Comment Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CommentCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.HyperLinkCount", + "name": "Hyperlink Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.HyperLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AttachedFileCount", + "name": "Attached File Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AttachedFileCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.NodeName", + "name": "Node Name", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.NodeName" + }, + { + "defaultValue": null, + "helpText": "The area of the product associated with this test plan.", + "alwaysRequired": false, + "referenceName": "System.AreaPath", + "name": "Area Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaPath" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RevisedDate", + "name": "Revised Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RevisedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedDate", + "name": "Changed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Id", + "name": "ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Id" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.AreaId", + "name": "Area ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedAs", + "name": "Authorized As", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedAs" + }, + { + "defaultValue": null, + "helpText": "Short description of the test plan.", + "alwaysRequired": true, + "referenceName": "System.Title", + "name": "Title", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Title" + }, + { + "defaultValue": "Active", + "helpText": "Workflow status. Active = tests in this test plan must be run; Inactive = tests in this test plan no longer need to be run", + "alwaysRequired": true, + "referenceName": "System.State", + "name": "State", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.State" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedDate", + "name": "Authorized Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Watermark", + "name": "Watermark", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Watermark" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Rev", + "name": "Rev", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Rev" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedBy", + "name": "Changed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedBy" + }, + { + "defaultValue": null, + "helpText": "Reason for the current test plan state.", + "alwaysRequired": false, + "referenceName": "System.Reason", + "name": "Reason", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Reason" + }, + { + "defaultValue": null, + "helpText": "The person currently owning this test plan.", + "alwaysRequired": false, + "referenceName": "System.AssignedTo", + "name": "Assigned To", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AssignedTo" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.WorkItemType", + "name": "Work Item Type", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.WorkItemType" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedDate", + "name": "Created Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedBy", + "name": "Created By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedBy" + }, + { + "defaultValue": null, + "helpText": "Purpose of this test plan", + "alwaysRequired": false, + "referenceName": "System.Description", + "name": "Description", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Description" + }, + { + "defaultValue": null, + "helpText": "Discussion thread plus automatic record of changes", + "alwaysRequired": false, + "referenceName": "System.History", + "name": "History", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.History" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RelatedLinkCount", + "name": "Related Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RelatedLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Tags", + "name": "Tags", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Tags" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumn", + "name": "Board Column", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumn" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumnDone", + "name": "Board Column Done", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumnDone" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardLane", + "name": "Board Lane", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardLane" + }, + { + "defaultValue": null, + "helpText": "The start date to run the tests in this test plan.", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.StartDate", + "name": "Start Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.StartDate" + }, + { + "defaultValue": null, + "helpText": "The completion date for running all the tests in this test plan.", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.FinishDate", + "name": "Finish Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.FinishDate" + }, + { + "defaultValue": null, + "helpText": "The build on which the test plan was executed\"", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Build.IntegrationBuild", + "name": "Integration Build", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Build.IntegrationBuild" + } + ], + "fieldInstances": [ + { + "defaultValue": null, + "helpText": "The iteration within which this test plan will execute.", + "alwaysRequired": false, + "referenceName": "System.IterationPath", + "name": "Iteration Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationPath" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.IterationId", + "name": "Iteration ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ExternalLinkCount", + "name": "External Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ExternalLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel7", + "name": "Iteration Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel6", + "name": "Iteration Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel5", + "name": "Iteration Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel4", + "name": "Iteration Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel3", + "name": "Iteration Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel2", + "name": "Iteration Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel1", + "name": "Iteration Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel7", + "name": "Area Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel6", + "name": "Area Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel5", + "name": "Area Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel4", + "name": "Area Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel3", + "name": "Area Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel2", + "name": "Area Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel1", + "name": "Area Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.TeamProject", + "name": "Team Project", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.TeamProject" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Parent", + "name": "Parent", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Parent" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RemoteLinkCount", + "name": "Remote Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RemoteLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CommentCount", + "name": "Comment Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CommentCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.HyperLinkCount", + "name": "Hyperlink Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.HyperLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AttachedFileCount", + "name": "Attached File Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AttachedFileCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.NodeName", + "name": "Node Name", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.NodeName" + }, + { + "defaultValue": null, + "helpText": "The area of the product associated with this test plan.", + "alwaysRequired": false, + "referenceName": "System.AreaPath", + "name": "Area Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaPath" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RevisedDate", + "name": "Revised Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RevisedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedDate", + "name": "Changed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Id", + "name": "ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Id" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.AreaId", + "name": "Area ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedAs", + "name": "Authorized As", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedAs" + }, + { + "defaultValue": null, + "helpText": "Short description of the test plan.", + "alwaysRequired": true, + "referenceName": "System.Title", + "name": "Title", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Title" + }, + { + "defaultValue": "Active", + "helpText": "Workflow status. Active = tests in this test plan must be run; Inactive = tests in this test plan no longer need to be run", + "alwaysRequired": true, + "referenceName": "System.State", + "name": "State", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.State" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedDate", + "name": "Authorized Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Watermark", + "name": "Watermark", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Watermark" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Rev", + "name": "Rev", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Rev" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedBy", + "name": "Changed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedBy" + }, + { + "defaultValue": null, + "helpText": "Reason for the current test plan state.", + "alwaysRequired": false, + "referenceName": "System.Reason", + "name": "Reason", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Reason" + }, + { + "defaultValue": null, + "helpText": "The person currently owning this test plan.", + "alwaysRequired": false, + "referenceName": "System.AssignedTo", + "name": "Assigned To", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AssignedTo" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.WorkItemType", + "name": "Work Item Type", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.WorkItemType" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedDate", + "name": "Created Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedBy", + "name": "Created By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedBy" + }, + { + "defaultValue": null, + "helpText": "Purpose of this test plan", + "alwaysRequired": false, + "referenceName": "System.Description", + "name": "Description", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Description" + }, + { + "defaultValue": null, + "helpText": "Discussion thread plus automatic record of changes", + "alwaysRequired": false, + "referenceName": "System.History", + "name": "History", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.History" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RelatedLinkCount", + "name": "Related Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RelatedLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Tags", + "name": "Tags", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Tags" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumn", + "name": "Board Column", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumn" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumnDone", + "name": "Board Column Done", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumnDone" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardLane", + "name": "Board Lane", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardLane" + }, + { + "defaultValue": null, + "helpText": "The start date to run the tests in this test plan.", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.StartDate", + "name": "Start Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.StartDate" + }, + { + "defaultValue": null, + "helpText": "The completion date for running all the tests in this test plan.", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.FinishDate", + "name": "Finish Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.FinishDate" + }, + { + "defaultValue": null, + "helpText": "The build on which the test plan was executed\"", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Build.IntegrationBuild", + "name": "Integration Build", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Build.IntegrationBuild" + } + ], + "transitions": { + "Active": [ + { + "to": "Active", + "actions": null + }, + { + "to": "Inactive", + "actions": null + } + ], + "Inactive": [ + { + "to": "Inactive", + "actions": null + }, + { + "to": "Active", + "actions": null + } + ], + "": [ + { + "to": "Active", + "actions": null + } + ] + }, + "states": [ + { + "name": "Active", + "color": "007acc", + "category": "InProgress" + }, + { + "name": "Inactive", + "color": "339933", + "category": "Completed" + } + ], + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/workItemTypes/Test%20Plan" + }, + { + "name": "Test Suite", + "referenceName": "Microsoft.VSTS.WorkItemTypes.TestSuite", + "description": "Tracks test activites for a specific feature, requirement, or user story.", + "color": "004B50", + "icon": { + "id": "icon_test_suite", + "url": "https://tfsprodcus3.visualstudio.com/_apis/wit/workItemIcons/icon_test_suite?color=004B50&v=2" + }, + "isDisabled": false, + "xmlForm": "
", + "fields": [ + { + "defaultValue": null, + "helpText": "The iteration for this test suite.", + "alwaysRequired": false, + "referenceName": "System.IterationPath", + "name": "Iteration Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationPath" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.IterationId", + "name": "Iteration ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ExternalLinkCount", + "name": "External Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ExternalLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel7", + "name": "Iteration Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel6", + "name": "Iteration Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel5", + "name": "Iteration Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel4", + "name": "Iteration Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel3", + "name": "Iteration Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel2", + "name": "Iteration Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel1", + "name": "Iteration Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel7", + "name": "Area Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel6", + "name": "Area Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel5", + "name": "Area Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel4", + "name": "Area Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel3", + "name": "Area Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel2", + "name": "Area Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel1", + "name": "Area Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.TeamProject", + "name": "Team Project", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.TeamProject" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Parent", + "name": "Parent", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Parent" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RemoteLinkCount", + "name": "Remote Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RemoteLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CommentCount", + "name": "Comment Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CommentCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.HyperLinkCount", + "name": "Hyperlink Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.HyperLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AttachedFileCount", + "name": "Attached File Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AttachedFileCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.NodeName", + "name": "Node Name", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.NodeName" + }, + { + "defaultValue": null, + "helpText": "The area of the product associated with this test suite.", + "alwaysRequired": false, + "referenceName": "System.AreaPath", + "name": "Area Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaPath" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RevisedDate", + "name": "Revised Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RevisedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedDate", + "name": "Changed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Id", + "name": "ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Id" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.AreaId", + "name": "Area ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedAs", + "name": "Authorized As", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedAs" + }, + { + "defaultValue": null, + "helpText": "Short description of the test suite.", + "alwaysRequired": true, + "referenceName": "System.Title", + "name": "Title", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Title" + }, + { + "defaultValue": "In Progress", + "helpText": "The workflow state of the test suite.", + "alwaysRequired": true, + "referenceName": "System.State", + "name": "State", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.State" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedDate", + "name": "Authorized Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Watermark", + "name": "Watermark", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Watermark" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Rev", + "name": "Rev", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Rev" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedBy", + "name": "Changed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedBy" + }, + { + "defaultValue": null, + "helpText": "The reason why the current test suite is in the current state.", + "alwaysRequired": false, + "referenceName": "System.Reason", + "name": "Reason", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Reason" + }, + { + "defaultValue": null, + "helpText": "The person currently assigned to the test suite.", + "alwaysRequired": false, + "referenceName": "System.AssignedTo", + "name": "Assigned To", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AssignedTo" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.WorkItemType", + "name": "Work Item Type", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.WorkItemType" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedDate", + "name": "Created Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedBy", + "name": "Created By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedBy" + }, + { + "defaultValue": null, + "helpText": "Purpose of this test suite", + "alwaysRequired": false, + "referenceName": "System.Description", + "name": "Description", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Description" + }, + { + "defaultValue": null, + "helpText": "Discussion thread plus automatic record of changes", + "alwaysRequired": false, + "referenceName": "System.History", + "name": "History", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.History" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RelatedLinkCount", + "name": "Related Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RelatedLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Tags", + "name": "Tags", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Tags" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumn", + "name": "Board Column", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumn" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumnDone", + "name": "Board Column Done", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumnDone" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardLane", + "name": "Board Lane", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardLane" + }, + { + "defaultValue": null, + "helpText": "The build on which the test suite was executed", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Build.IntegrationBuild", + "name": "Integration Build", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Build.IntegrationBuild" + }, + { + "defaultValue": "1", + "alwaysRequired": true, + "referenceName": "Microsoft.VSTS.TCM.TestSuiteTypeId", + "name": "Test Suite Type Id", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.TCM.TestSuiteTypeId" + }, + { + "defaultValue": null, + "helpText": "Specifies the category of the test suite.", + "alwaysRequired": true, + "referenceName": "Microsoft.VSTS.TCM.TestSuiteType", + "name": "Test Suite Type", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.TCM.TestSuiteType" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.TCM.QueryText", + "name": "Query Text", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.TCM.QueryText" + }, + { + "defaultValue": null, + "helpText": "Captures the test suite audit trail.", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.TCM.TestSuiteAudit", + "name": "Test Suite Audit", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.TCM.TestSuiteAudit" + } + ], + "fieldInstances": [ + { + "defaultValue": null, + "helpText": "The iteration for this test suite.", + "alwaysRequired": false, + "referenceName": "System.IterationPath", + "name": "Iteration Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationPath" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.IterationId", + "name": "Iteration ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ExternalLinkCount", + "name": "External Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ExternalLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel7", + "name": "Iteration Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel6", + "name": "Iteration Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel5", + "name": "Iteration Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel4", + "name": "Iteration Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel3", + "name": "Iteration Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel2", + "name": "Iteration Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel1", + "name": "Iteration Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel7", + "name": "Area Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel6", + "name": "Area Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel5", + "name": "Area Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel4", + "name": "Area Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel3", + "name": "Area Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel2", + "name": "Area Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel1", + "name": "Area Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.TeamProject", + "name": "Team Project", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.TeamProject" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Parent", + "name": "Parent", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Parent" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RemoteLinkCount", + "name": "Remote Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RemoteLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CommentCount", + "name": "Comment Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CommentCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.HyperLinkCount", + "name": "Hyperlink Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.HyperLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AttachedFileCount", + "name": "Attached File Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AttachedFileCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.NodeName", + "name": "Node Name", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.NodeName" + }, + { + "defaultValue": null, + "helpText": "The area of the product associated with this test suite.", + "alwaysRequired": false, + "referenceName": "System.AreaPath", + "name": "Area Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaPath" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RevisedDate", + "name": "Revised Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RevisedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedDate", + "name": "Changed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Id", + "name": "ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Id" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.AreaId", + "name": "Area ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedAs", + "name": "Authorized As", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedAs" + }, + { + "defaultValue": null, + "helpText": "Short description of the test suite.", + "alwaysRequired": true, + "referenceName": "System.Title", + "name": "Title", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Title" + }, + { + "defaultValue": "In Progress", + "helpText": "The workflow state of the test suite.", + "alwaysRequired": true, + "referenceName": "System.State", + "name": "State", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.State" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedDate", + "name": "Authorized Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Watermark", + "name": "Watermark", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Watermark" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Rev", + "name": "Rev", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Rev" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedBy", + "name": "Changed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedBy" + }, + { + "defaultValue": null, + "helpText": "The reason why the current test suite is in the current state.", + "alwaysRequired": false, + "referenceName": "System.Reason", + "name": "Reason", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Reason" + }, + { + "defaultValue": null, + "helpText": "The person currently assigned to the test suite.", + "alwaysRequired": false, + "referenceName": "System.AssignedTo", + "name": "Assigned To", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AssignedTo" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.WorkItemType", + "name": "Work Item Type", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.WorkItemType" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedDate", + "name": "Created Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedBy", + "name": "Created By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedBy" + }, + { + "defaultValue": null, + "helpText": "Purpose of this test suite", + "alwaysRequired": false, + "referenceName": "System.Description", + "name": "Description", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Description" + }, + { + "defaultValue": null, + "helpText": "Discussion thread plus automatic record of changes", + "alwaysRequired": false, + "referenceName": "System.History", + "name": "History", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.History" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RelatedLinkCount", + "name": "Related Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RelatedLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Tags", + "name": "Tags", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Tags" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumn", + "name": "Board Column", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumn" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumnDone", + "name": "Board Column Done", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumnDone" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardLane", + "name": "Board Lane", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardLane" + }, + { + "defaultValue": null, + "helpText": "The build on which the test suite was executed", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Build.IntegrationBuild", + "name": "Integration Build", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Build.IntegrationBuild" + }, + { + "defaultValue": "1", + "alwaysRequired": true, + "referenceName": "Microsoft.VSTS.TCM.TestSuiteTypeId", + "name": "Test Suite Type Id", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.TCM.TestSuiteTypeId" + }, + { + "defaultValue": null, + "helpText": "Specifies the category of the test suite.", + "alwaysRequired": true, + "referenceName": "Microsoft.VSTS.TCM.TestSuiteType", + "name": "Test Suite Type", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.TCM.TestSuiteType" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.TCM.QueryText", + "name": "Query Text", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.TCM.QueryText" + }, + { + "defaultValue": null, + "helpText": "Captures the test suite audit trail.", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.TCM.TestSuiteAudit", + "name": "Test Suite Audit", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.TCM.TestSuiteAudit" + } + ], + "transitions": { + "Completed": [ + { + "to": "Completed", + "actions": null + }, + { + "to": "In Progress", + "actions": null + }, + { + "to": "In Planning", + "actions": null + } + ], + "In Planning": [ + { + "to": "In Planning", + "actions": null + }, + { + "to": "In Progress", + "actions": null + }, + { + "to": "Completed", + "actions": null + } + ], + "In Progress": [ + { + "to": "In Progress", + "actions": null + }, + { + "to": "In Planning", + "actions": null + }, + { + "to": "Completed", + "actions": null + } + ], + "": [ + { + "to": "In Progress", + "actions": null + } + ] + }, + "states": [ + { + "name": "In Planning", + "color": "007acc", + "category": "InProgress" + }, + { + "name": "In Progress", + "color": "007acc", + "category": "InProgress" + }, + { + "name": "Completed", + "color": "339933", + "category": "Completed" + } + ], + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/workItemTypes/Test%20Suite" + }, + { + "name": "User Story", + "referenceName": "Microsoft.VSTS.WorkItemTypes.UserStory", + "description": "Tracks an activity the user will be able to perform with the product", + "color": "009CCC", + "icon": { + "id": "icon_book", + "url": "https://tfsprodcus3.visualstudio.com/_apis/wit/workItemIcons/icon_book?color=009CCC&v=2" + }, + "isDisabled": false, + "xmlForm": "
", + "fields": [ + { + "defaultValue": null, + "helpText": "The iteration within which this user story will be implemented", + "alwaysRequired": false, + "referenceName": "System.IterationPath", + "name": "Iteration Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationPath" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.IterationId", + "name": "Iteration ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ExternalLinkCount", + "name": "External Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ExternalLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel7", + "name": "Iteration Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel6", + "name": "Iteration Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel5", + "name": "Iteration Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel4", + "name": "Iteration Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel3", + "name": "Iteration Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel2", + "name": "Iteration Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel1", + "name": "Iteration Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel7", + "name": "Area Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel6", + "name": "Area Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel5", + "name": "Area Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel4", + "name": "Area Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel3", + "name": "Area Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel2", + "name": "Area Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel1", + "name": "Area Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.TeamProject", + "name": "Team Project", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.TeamProject" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Parent", + "name": "Parent", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Parent" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RemoteLinkCount", + "name": "Remote Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RemoteLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CommentCount", + "name": "Comment Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CommentCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.HyperLinkCount", + "name": "Hyperlink Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.HyperLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AttachedFileCount", + "name": "Attached File Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AttachedFileCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.NodeName", + "name": "Node Name", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.NodeName" + }, + { + "defaultValue": null, + "helpText": "The area of the product with which this user story is associated", + "alwaysRequired": false, + "referenceName": "System.AreaPath", + "name": "Area Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaPath" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RevisedDate", + "name": "Revised Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RevisedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedDate", + "name": "Changed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Id", + "name": "ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Id" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.AreaId", + "name": "Area ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedAs", + "name": "Authorized As", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedAs" + }, + { + "defaultValue": null, + "helpText": "What the user will be able to do when this is implemented", + "alwaysRequired": true, + "referenceName": "System.Title", + "name": "Title", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Title" + }, + { + "defaultValue": "New", + "helpText": "New = Not started yet; Active = work remains to be done; Resolved = awaiting acceptance tests; Closed = acceptance tests passed", + "alwaysRequired": true, + "referenceName": "System.State", + "name": "State", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.State" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedDate", + "name": "Authorized Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Watermark", + "name": "Watermark", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Watermark" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Rev", + "name": "Rev", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Rev" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedBy", + "name": "Changed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedBy" + }, + { + "defaultValue": null, + "helpText": "The reason why the story is in its current state", + "alwaysRequired": false, + "referenceName": "System.Reason", + "name": "Reason", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Reason" + }, + { + "defaultValue": null, + "helpText": "The person currently working on this story", + "alwaysRequired": false, + "referenceName": "System.AssignedTo", + "name": "Assigned To", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AssignedTo" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.WorkItemType", + "name": "Work Item Type", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.WorkItemType" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedDate", + "name": "Created Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedBy", + "name": "Created By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedBy" + }, + { + "defaultValue": null, + "helpText": "Description or reference to the story that must work for this work to be considered complete", + "alwaysRequired": false, + "referenceName": "System.Description", + "name": "Description", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Description" + }, + { + "defaultValue": null, + "helpText": "Discussion thread plus automatic record of changes", + "alwaysRequired": false, + "referenceName": "System.History", + "name": "History", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.History" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RelatedLinkCount", + "name": "Related Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RelatedLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Tags", + "name": "Tags", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Tags" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumn", + "name": "Board Column", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumn" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumnDone", + "name": "Board Column Done", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumnDone" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardLane", + "name": "Board Lane", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardLane" + }, + { + "defaultValue": null, + "helpText": "The size of work estimated for fixing the bug", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.StoryPoints", + "name": "Story Points", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.StoryPoints" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.StateChangeDate", + "name": "State Change Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.StateChangeDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ActivatedDate", + "name": "Activated Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ActivatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ActivatedBy", + "name": "Activated By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ActivatedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ResolvedDate", + "name": "Resolved Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ResolvedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ResolvedBy", + "name": "Resolved By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ResolvedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ResolvedReason", + "name": "Resolved Reason", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ResolvedReason" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedDate", + "name": "Closed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedBy", + "name": "Closed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.AcceptanceCriteria", + "name": "Acceptance Criteria", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.AcceptanceCriteria" + }, + { + "defaultValue": "2", + "helpText": "Business importance. 1=must fix; 4=unimportant.", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.Priority", + "name": "Priority", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.Priority" + }, + { + "defaultValue": null, + "helpText": "Uncertainty in requirement or design", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.Risk", + "name": "Risk", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.Risk" + }, + { + "defaultValue": null, + "helpText": "Work first on items with lower-valued stack rank. Set in triage.", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.StackRank", + "name": "Stack Rank", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.StackRank" + }, + { + "defaultValue": null, + "helpText": "The start date for implementation of this story", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.StartDate", + "name": "Start Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.StartDate" + }, + { + "defaultValue": null, + "helpText": "The completion date for all the tasks implementing this story", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.FinishDate", + "name": "Finish Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.FinishDate" + }, + { + "defaultValue": "Business", + "helpText": "Business = delivers value to a user or another system; Architectural = work to support other stories or components", + "alwaysRequired": true, + "referenceName": "Microsoft.VSTS.Common.ValueArea", + "name": "Value Area", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ValueArea" + }, + { + "defaultValue": null, + "helpText": "The build in which the bug was fixed", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Build.IntegrationBuild", + "name": "Integration Build", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Build.IntegrationBuild" + } + ], + "fieldInstances": [ + { + "defaultValue": null, + "helpText": "The iteration within which this user story will be implemented", + "alwaysRequired": false, + "referenceName": "System.IterationPath", + "name": "Iteration Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationPath" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.IterationId", + "name": "Iteration ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ExternalLinkCount", + "name": "External Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ExternalLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel7", + "name": "Iteration Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel6", + "name": "Iteration Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel5", + "name": "Iteration Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel4", + "name": "Iteration Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel3", + "name": "Iteration Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel2", + "name": "Iteration Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel1", + "name": "Iteration Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel7", + "name": "Area Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel6", + "name": "Area Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel5", + "name": "Area Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel4", + "name": "Area Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel3", + "name": "Area Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel2", + "name": "Area Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel1", + "name": "Area Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.TeamProject", + "name": "Team Project", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.TeamProject" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Parent", + "name": "Parent", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Parent" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RemoteLinkCount", + "name": "Remote Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RemoteLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CommentCount", + "name": "Comment Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CommentCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.HyperLinkCount", + "name": "Hyperlink Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.HyperLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AttachedFileCount", + "name": "Attached File Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AttachedFileCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.NodeName", + "name": "Node Name", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.NodeName" + }, + { + "defaultValue": null, + "helpText": "The area of the product with which this user story is associated", + "alwaysRequired": false, + "referenceName": "System.AreaPath", + "name": "Area Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaPath" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RevisedDate", + "name": "Revised Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RevisedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedDate", + "name": "Changed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Id", + "name": "ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Id" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.AreaId", + "name": "Area ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedAs", + "name": "Authorized As", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedAs" + }, + { + "defaultValue": null, + "helpText": "What the user will be able to do when this is implemented", + "alwaysRequired": true, + "referenceName": "System.Title", + "name": "Title", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Title" + }, + { + "defaultValue": "New", + "helpText": "New = Not started yet; Active = work remains to be done; Resolved = awaiting acceptance tests; Closed = acceptance tests passed", + "alwaysRequired": true, + "referenceName": "System.State", + "name": "State", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.State" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedDate", + "name": "Authorized Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Watermark", + "name": "Watermark", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Watermark" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Rev", + "name": "Rev", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Rev" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedBy", + "name": "Changed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedBy" + }, + { + "defaultValue": null, + "helpText": "The reason why the story is in its current state", + "alwaysRequired": false, + "referenceName": "System.Reason", + "name": "Reason", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Reason" + }, + { + "defaultValue": null, + "helpText": "The person currently working on this story", + "alwaysRequired": false, + "referenceName": "System.AssignedTo", + "name": "Assigned To", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AssignedTo" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.WorkItemType", + "name": "Work Item Type", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.WorkItemType" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedDate", + "name": "Created Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedBy", + "name": "Created By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedBy" + }, + { + "defaultValue": null, + "helpText": "Description or reference to the story that must work for this work to be considered complete", + "alwaysRequired": false, + "referenceName": "System.Description", + "name": "Description", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Description" + }, + { + "defaultValue": null, + "helpText": "Discussion thread plus automatic record of changes", + "alwaysRequired": false, + "referenceName": "System.History", + "name": "History", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.History" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RelatedLinkCount", + "name": "Related Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RelatedLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Tags", + "name": "Tags", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Tags" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumn", + "name": "Board Column", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumn" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumnDone", + "name": "Board Column Done", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumnDone" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardLane", + "name": "Board Lane", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardLane" + }, + { + "defaultValue": null, + "helpText": "The size of work estimated for fixing the bug", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.StoryPoints", + "name": "Story Points", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.StoryPoints" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.StateChangeDate", + "name": "State Change Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.StateChangeDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ActivatedDate", + "name": "Activated Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ActivatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ActivatedBy", + "name": "Activated By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ActivatedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ResolvedDate", + "name": "Resolved Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ResolvedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ResolvedBy", + "name": "Resolved By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ResolvedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ResolvedReason", + "name": "Resolved Reason", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ResolvedReason" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedDate", + "name": "Closed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedBy", + "name": "Closed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.AcceptanceCriteria", + "name": "Acceptance Criteria", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.AcceptanceCriteria" + }, + { + "defaultValue": "2", + "helpText": "Business importance. 1=must fix; 4=unimportant.", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.Priority", + "name": "Priority", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.Priority" + }, + { + "defaultValue": null, + "helpText": "Uncertainty in requirement or design", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.Risk", + "name": "Risk", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.Risk" + }, + { + "defaultValue": null, + "helpText": "Work first on items with lower-valued stack rank. Set in triage.", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.StackRank", + "name": "Stack Rank", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.StackRank" + }, + { + "defaultValue": null, + "helpText": "The start date for implementation of this story", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.StartDate", + "name": "Start Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.StartDate" + }, + { + "defaultValue": null, + "helpText": "The completion date for all the tasks implementing this story", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.FinishDate", + "name": "Finish Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.FinishDate" + }, + { + "defaultValue": "Business", + "helpText": "Business = delivers value to a user or another system; Architectural = work to support other stories or components", + "alwaysRequired": true, + "referenceName": "Microsoft.VSTS.Common.ValueArea", + "name": "Value Area", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ValueArea" + }, + { + "defaultValue": null, + "helpText": "The build in which the bug was fixed", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Build.IntegrationBuild", + "name": "Integration Build", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Build.IntegrationBuild" + } + ], + "transitions": { + "Active": [ + { + "to": "Active", + "actions": null + }, + { + "to": "Removed", + "actions": null + }, + { + "to": "Closed", + "actions": null + }, + { + "to": "Resolved", + "actions": [ + "Microsoft.VSTS.Actions.Checkin" + ] + }, + { + "to": "New", + "actions": null + } + ], + "Closed": [ + { + "to": "Closed", + "actions": null + }, + { + "to": "Resolved", + "actions": null + }, + { + "to": "Active", + "actions": null + }, + { + "to": "New", + "actions": null + } + ], + "New": [ + { + "to": "New", + "actions": null + }, + { + "to": "Removed", + "actions": null + }, + { + "to": "Closed", + "actions": null + }, + { + "to": "Resolved", + "actions": [ + "Microsoft.VSTS.Actions.Checkin" + ] + }, + { + "to": "Active", + "actions": null + } + ], + "Removed": [ + { + "to": "Removed", + "actions": null + }, + { + "to": "New", + "actions": null + } + ], + "Resolved": [ + { + "to": "Resolved", + "actions": null + }, + { + "to": "Removed", + "actions": null + }, + { + "to": "Closed", + "actions": null + }, + { + "to": "Active", + "actions": null + }, + { + "to": "New", + "actions": null + } + ], + "": [ + { + "to": "New", + "actions": null + } + ] + }, + "states": [ + { + "name": "New", + "color": "b2b2b2", + "category": "Proposed" + }, + { + "name": "Active", + "color": "007acc", + "category": "InProgress" + }, + { + "name": "Resolved", + "color": "007acc", + "category": "InProgress" + }, + { + "name": "Closed", + "color": "339933", + "category": "Completed" + }, + { + "name": "Removed", + "color": "ffffff", + "category": "Removed" + } + ], + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/workItemTypes/User%20Story" + }, + { + "name": "Issue", + "referenceName": "Microsoft.VSTS.WorkItemTypes.Issue", + "description": "Tracks an obstacle to progress.", + "color": "B4009E", + "icon": { + "id": "icon_traffic_cone", + "url": "https://tfsprodcus3.visualstudio.com/_apis/wit/workItemIcons/icon_traffic_cone?color=B4009E&v=2" + }, + "isDisabled": false, + "xmlForm": "
", + "fields": [ + { + "defaultValue": null, + "helpText": "The iteration within which this issue will be fixed", + "alwaysRequired": false, + "referenceName": "System.IterationPath", + "name": "Iteration Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationPath" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.IterationId", + "name": "Iteration ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ExternalLinkCount", + "name": "External Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ExternalLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel7", + "name": "Iteration Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel6", + "name": "Iteration Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel5", + "name": "Iteration Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel4", + "name": "Iteration Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel3", + "name": "Iteration Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel2", + "name": "Iteration Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel1", + "name": "Iteration Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel7", + "name": "Area Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel6", + "name": "Area Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel5", + "name": "Area Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel4", + "name": "Area Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel3", + "name": "Area Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel2", + "name": "Area Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel1", + "name": "Area Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.TeamProject", + "name": "Team Project", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.TeamProject" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Parent", + "name": "Parent", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Parent" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RemoteLinkCount", + "name": "Remote Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RemoteLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CommentCount", + "name": "Comment Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CommentCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.HyperLinkCount", + "name": "Hyperlink Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.HyperLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AttachedFileCount", + "name": "Attached File Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AttachedFileCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.NodeName", + "name": "Node Name", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.NodeName" + }, + { + "defaultValue": null, + "helpText": "The area of the product with which this issue is associated", + "alwaysRequired": false, + "referenceName": "System.AreaPath", + "name": "Area Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaPath" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RevisedDate", + "name": "Revised Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RevisedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedDate", + "name": "Changed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Id", + "name": "ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Id" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.AreaId", + "name": "Area ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedAs", + "name": "Authorized As", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedAs" + }, + { + "defaultValue": null, + "helpText": "The nature of the problem and why it is affecting or could affect the project", + "alwaysRequired": true, + "referenceName": "System.Title", + "name": "Title", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Title" + }, + { + "defaultValue": "Active", + "helpText": "Change to Closed when the issue is resolved or not relevant anymore", + "alwaysRequired": true, + "referenceName": "System.State", + "name": "State", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.State" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedDate", + "name": "Authorized Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Watermark", + "name": "Watermark", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Watermark" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Rev", + "name": "Rev", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Rev" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedBy", + "name": "Changed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedBy" + }, + { + "defaultValue": null, + "helpText": "The reason why the issue is in the current state", + "alwaysRequired": false, + "referenceName": "System.Reason", + "name": "Reason", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Reason" + }, + { + "defaultValue": null, + "helpText": "The person currently working on this issue", + "alwaysRequired": false, + "referenceName": "System.AssignedTo", + "name": "Assigned To", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AssignedTo" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.WorkItemType", + "name": "Work Item Type", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.WorkItemType" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedDate", + "name": "Created Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedBy", + "name": "Created By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedBy" + }, + { + "defaultValue": null, + "helpText": "Problem, resolution plan and status", + "alwaysRequired": false, + "referenceName": "System.Description", + "name": "Description", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Description" + }, + { + "defaultValue": null, + "helpText": "Discussion thread plus automatic record of changes", + "alwaysRequired": false, + "referenceName": "System.History", + "name": "History", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.History" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RelatedLinkCount", + "name": "Related Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RelatedLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Tags", + "name": "Tags", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Tags" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumn", + "name": "Board Column", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumn" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumnDone", + "name": "Board Column Done", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumnDone" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardLane", + "name": "Board Lane", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardLane" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.StateChangeDate", + "name": "State Change Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.StateChangeDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ActivatedDate", + "name": "Activated Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ActivatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ActivatedBy", + "name": "Activated By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ActivatedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedDate", + "name": "Closed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedBy", + "name": "Closed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedBy" + }, + { + "defaultValue": "2", + "helpText": "Business importance. 1=must fix; 4=unimportant.", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.Priority", + "name": "Priority", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.Priority" + }, + { + "defaultValue": null, + "helpText": "Work first on items with lower-valued stack rank. Set in triage.", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.StackRank", + "name": "Stack Rank", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.StackRank" + }, + { + "defaultValue": null, + "helpText": "\"The date by which this issue needs to be closed", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.DueDate", + "name": "Due Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.DueDate" + }, + { + "defaultValue": null, + "helpText": "The build in which the bug was fixed", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Build.IntegrationBuild", + "name": "Integration Build", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Build.IntegrationBuild" + } + ], + "fieldInstances": [ + { + "defaultValue": null, + "helpText": "The iteration within which this issue will be fixed", + "alwaysRequired": false, + "referenceName": "System.IterationPath", + "name": "Iteration Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationPath" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.IterationId", + "name": "Iteration ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ExternalLinkCount", + "name": "External Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ExternalLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel7", + "name": "Iteration Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel6", + "name": "Iteration Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel5", + "name": "Iteration Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel4", + "name": "Iteration Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel3", + "name": "Iteration Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel2", + "name": "Iteration Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel1", + "name": "Iteration Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel7", + "name": "Area Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel6", + "name": "Area Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel5", + "name": "Area Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel4", + "name": "Area Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel3", + "name": "Area Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel2", + "name": "Area Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel1", + "name": "Area Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.TeamProject", + "name": "Team Project", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.TeamProject" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Parent", + "name": "Parent", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Parent" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RemoteLinkCount", + "name": "Remote Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RemoteLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CommentCount", + "name": "Comment Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CommentCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.HyperLinkCount", + "name": "Hyperlink Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.HyperLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AttachedFileCount", + "name": "Attached File Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AttachedFileCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.NodeName", + "name": "Node Name", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.NodeName" + }, + { + "defaultValue": null, + "helpText": "The area of the product with which this issue is associated", + "alwaysRequired": false, + "referenceName": "System.AreaPath", + "name": "Area Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaPath" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RevisedDate", + "name": "Revised Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RevisedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedDate", + "name": "Changed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Id", + "name": "ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Id" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.AreaId", + "name": "Area ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedAs", + "name": "Authorized As", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedAs" + }, + { + "defaultValue": null, + "helpText": "The nature of the problem and why it is affecting or could affect the project", + "alwaysRequired": true, + "referenceName": "System.Title", + "name": "Title", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Title" + }, + { + "defaultValue": "Active", + "helpText": "Change to Closed when the issue is resolved or not relevant anymore", + "alwaysRequired": true, + "referenceName": "System.State", + "name": "State", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.State" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedDate", + "name": "Authorized Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Watermark", + "name": "Watermark", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Watermark" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Rev", + "name": "Rev", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Rev" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedBy", + "name": "Changed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedBy" + }, + { + "defaultValue": null, + "helpText": "The reason why the issue is in the current state", + "alwaysRequired": false, + "referenceName": "System.Reason", + "name": "Reason", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Reason" + }, + { + "defaultValue": null, + "helpText": "The person currently working on this issue", + "alwaysRequired": false, + "referenceName": "System.AssignedTo", + "name": "Assigned To", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AssignedTo" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.WorkItemType", + "name": "Work Item Type", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.WorkItemType" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedDate", + "name": "Created Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedBy", + "name": "Created By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedBy" + }, + { + "defaultValue": null, + "helpText": "Problem, resolution plan and status", + "alwaysRequired": false, + "referenceName": "System.Description", + "name": "Description", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Description" + }, + { + "defaultValue": null, + "helpText": "Discussion thread plus automatic record of changes", + "alwaysRequired": false, + "referenceName": "System.History", + "name": "History", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.History" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RelatedLinkCount", + "name": "Related Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RelatedLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Tags", + "name": "Tags", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Tags" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumn", + "name": "Board Column", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumn" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumnDone", + "name": "Board Column Done", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumnDone" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardLane", + "name": "Board Lane", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardLane" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.StateChangeDate", + "name": "State Change Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.StateChangeDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ActivatedDate", + "name": "Activated Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ActivatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ActivatedBy", + "name": "Activated By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ActivatedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedDate", + "name": "Closed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedBy", + "name": "Closed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedBy" + }, + { + "defaultValue": "2", + "helpText": "Business importance. 1=must fix; 4=unimportant.", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.Priority", + "name": "Priority", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.Priority" + }, + { + "defaultValue": null, + "helpText": "Work first on items with lower-valued stack rank. Set in triage.", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.StackRank", + "name": "Stack Rank", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.StackRank" + }, + { + "defaultValue": null, + "helpText": "\"The date by which this issue needs to be closed", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.DueDate", + "name": "Due Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.DueDate" + }, + { + "defaultValue": null, + "helpText": "The build in which the bug was fixed", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Build.IntegrationBuild", + "name": "Integration Build", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Build.IntegrationBuild" + } + ], + "transitions": { + "Active": [ + { + "to": "Active", + "actions": null + }, + { + "to": "Closed", + "actions": [ + "Microsoft.VSTS.Actions.Checkin" + ] + } + ], + "Closed": [ + { + "to": "Closed", + "actions": null + }, + { + "to": "Active", + "actions": null + } + ], + "": [ + { + "to": "Active", + "actions": null + } + ] + }, + "states": [ + { + "name": "Active", + "color": "007acc", + "category": "InProgress" + }, + { + "name": "Closed", + "color": "339933", + "category": "Completed" + } + ], + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/workItemTypes/Issue" + }, + { + "name": "Shared Parameter", + "referenceName": "Microsoft.VSTS.WorkItemTypes.SharedParameter", + "description": "Server-side data for reusable set of parameter.", + "color": "004B50", + "icon": { + "id": "icon_test_parameter", + "url": "https://tfsprodcus3.visualstudio.com/_apis/wit/workItemIcons/icon_test_parameter?color=004B50&v=2" + }, + "isDisabled": false, + "xmlForm": "
", + "fields": [ + { + "defaultValue": null, + "helpText": "The iteration of the product with which this shared parameter is associated", + "alwaysRequired": false, + "referenceName": "System.IterationPath", + "name": "Iteration Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationPath" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.IterationId", + "name": "Iteration ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ExternalLinkCount", + "name": "External Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ExternalLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel7", + "name": "Iteration Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel6", + "name": "Iteration Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel5", + "name": "Iteration Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel4", + "name": "Iteration Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel3", + "name": "Iteration Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel2", + "name": "Iteration Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel1", + "name": "Iteration Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel7", + "name": "Area Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel6", + "name": "Area Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel5", + "name": "Area Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel4", + "name": "Area Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel3", + "name": "Area Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel2", + "name": "Area Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel1", + "name": "Area Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.TeamProject", + "name": "Team Project", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.TeamProject" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Parent", + "name": "Parent", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Parent" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RemoteLinkCount", + "name": "Remote Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RemoteLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CommentCount", + "name": "Comment Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CommentCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.HyperLinkCount", + "name": "Hyperlink Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.HyperLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AttachedFileCount", + "name": "Attached File Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AttachedFileCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.NodeName", + "name": "Node Name", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.NodeName" + }, + { + "defaultValue": null, + "helpText": "The area of the product with which this shared parameter is associated", + "alwaysRequired": false, + "referenceName": "System.AreaPath", + "name": "Area Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaPath" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RevisedDate", + "name": "Revised Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RevisedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedDate", + "name": "Changed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Id", + "name": "ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Id" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.AreaId", + "name": "Area ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedAs", + "name": "Authorized As", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedAs" + }, + { + "defaultValue": null, + "helpText": "Short description of the shared parameter used to differentiate it in a list or report", + "alwaysRequired": true, + "referenceName": "System.Title", + "name": "Title", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Title" + }, + { + "defaultValue": "Active", + "helpText": "The workflow state of the shared parameter", + "alwaysRequired": true, + "referenceName": "System.State", + "name": "State", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.State" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedDate", + "name": "Authorized Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Watermark", + "name": "Watermark", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Watermark" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Rev", + "name": "Rev", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Rev" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedBy", + "name": "Changed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedBy" + }, + { + "defaultValue": null, + "helpText": "The reason why the shared parameter is in the current state", + "alwaysRequired": false, + "referenceName": "System.Reason", + "name": "Reason", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Reason" + }, + { + "defaultValue": null, + "helpText": "The person currently working on these shared parameter", + "alwaysRequired": false, + "referenceName": "System.AssignedTo", + "name": "Assigned To", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AssignedTo" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.WorkItemType", + "name": "Work Item Type", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.WorkItemType" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedDate", + "name": "Created Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedBy", + "name": "Created By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Description", + "name": "Description", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Description" + }, + { + "defaultValue": null, + "helpText": "Discussion thread plus automatic record of changes", + "alwaysRequired": false, + "referenceName": "System.History", + "name": "History", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.History" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RelatedLinkCount", + "name": "Related Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RelatedLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Tags", + "name": "Tags", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Tags" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumn", + "name": "Board Column", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumn" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumnDone", + "name": "Board Column Done", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumnDone" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardLane", + "name": "Board Lane", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardLane" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.StateChangeDate", + "name": "State Change Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.StateChangeDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.TCM.Parameters", + "name": "Parameters", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.TCM.Parameters" + }, + { + "defaultValue": null, + "helpText": "The build in which the bug was fixed", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Build.IntegrationBuild", + "name": "Integration Build", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Build.IntegrationBuild" + } + ], + "fieldInstances": [ + { + "defaultValue": null, + "helpText": "The iteration of the product with which this shared parameter is associated", + "alwaysRequired": false, + "referenceName": "System.IterationPath", + "name": "Iteration Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationPath" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.IterationId", + "name": "Iteration ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ExternalLinkCount", + "name": "External Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ExternalLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel7", + "name": "Iteration Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel6", + "name": "Iteration Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel5", + "name": "Iteration Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel4", + "name": "Iteration Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel3", + "name": "Iteration Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel2", + "name": "Iteration Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel1", + "name": "Iteration Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel7", + "name": "Area Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel6", + "name": "Area Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel5", + "name": "Area Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel4", + "name": "Area Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel3", + "name": "Area Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel2", + "name": "Area Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel1", + "name": "Area Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.TeamProject", + "name": "Team Project", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.TeamProject" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Parent", + "name": "Parent", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Parent" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RemoteLinkCount", + "name": "Remote Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RemoteLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CommentCount", + "name": "Comment Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CommentCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.HyperLinkCount", + "name": "Hyperlink Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.HyperLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AttachedFileCount", + "name": "Attached File Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AttachedFileCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.NodeName", + "name": "Node Name", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.NodeName" + }, + { + "defaultValue": null, + "helpText": "The area of the product with which this shared parameter is associated", + "alwaysRequired": false, + "referenceName": "System.AreaPath", + "name": "Area Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaPath" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RevisedDate", + "name": "Revised Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RevisedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedDate", + "name": "Changed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Id", + "name": "ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Id" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.AreaId", + "name": "Area ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedAs", + "name": "Authorized As", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedAs" + }, + { + "defaultValue": null, + "helpText": "Short description of the shared parameter used to differentiate it in a list or report", + "alwaysRequired": true, + "referenceName": "System.Title", + "name": "Title", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Title" + }, + { + "defaultValue": "Active", + "helpText": "The workflow state of the shared parameter", + "alwaysRequired": true, + "referenceName": "System.State", + "name": "State", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.State" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedDate", + "name": "Authorized Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Watermark", + "name": "Watermark", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Watermark" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Rev", + "name": "Rev", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Rev" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedBy", + "name": "Changed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedBy" + }, + { + "defaultValue": null, + "helpText": "The reason why the shared parameter is in the current state", + "alwaysRequired": false, + "referenceName": "System.Reason", + "name": "Reason", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Reason" + }, + { + "defaultValue": null, + "helpText": "The person currently working on these shared parameter", + "alwaysRequired": false, + "referenceName": "System.AssignedTo", + "name": "Assigned To", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AssignedTo" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.WorkItemType", + "name": "Work Item Type", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.WorkItemType" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedDate", + "name": "Created Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedBy", + "name": "Created By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Description", + "name": "Description", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Description" + }, + { + "defaultValue": null, + "helpText": "Discussion thread plus automatic record of changes", + "alwaysRequired": false, + "referenceName": "System.History", + "name": "History", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.History" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RelatedLinkCount", + "name": "Related Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RelatedLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Tags", + "name": "Tags", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Tags" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumn", + "name": "Board Column", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumn" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumnDone", + "name": "Board Column Done", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumnDone" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardLane", + "name": "Board Lane", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardLane" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.StateChangeDate", + "name": "State Change Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.StateChangeDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.TCM.Parameters", + "name": "Parameters", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.TCM.Parameters" + }, + { + "defaultValue": null, + "helpText": "The build in which the bug was fixed", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Build.IntegrationBuild", + "name": "Integration Build", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Build.IntegrationBuild" + } + ], + "transitions": { + "Active": [ + { + "to": "Active", + "actions": null + }, + { + "to": "Inactive", + "actions": null + } + ], + "Inactive": [ + { + "to": "Inactive", + "actions": null + }, + { + "to": "Active", + "actions": null + } + ], + "": [ + { + "to": "Active", + "actions": null + } + ] + }, + "states": [ + { + "name": "Active", + "color": "007acc", + "category": "InProgress" + }, + { + "name": "Inactive", + "color": "339933", + "category": "Completed" + } + ], + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/workItemTypes/Shared%20Parameter" + } + ] +} \ No newline at end of file