diff --git a/.docs/Get-VSTeamWorkItem.md b/.docs/Get-VSTeamWorkItem.md index 28392b8b5..95bcdec8f 100644 --- a/.docs/Get-VSTeamWorkItem.md +++ b/.docs/Get-VSTeamWorkItem.md @@ -71,12 +71,6 @@ Comma-separated list of requested fields. The acceptable values for this parame Type: String ``` -### -AsOf - -```yaml -Type: DateTime -``` - ## INPUTS ### System.String diff --git a/CHANGELOG.md b/CHANGELOG.md index 7dabcc3dc..c414eaf7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 6.5.1 + +Fixed bug [337](https://github.com/MethodsAndPractices/vsteam/issues/337) +Fixed bug [345](https://github.com/MethodsAndPractices/vsteam/issues/345) + +Merged [Pull Request](https://github.com/DarqueWarrior/vsteam/pull/335) from [Sebastian Schütze](https://github.com/SebastianSchuetze) which included the following: + +- Fixed bug [326](https://github.com/MethodsAndPractices/vsteam/issues/326) + ## 6.5.0 Added a default 60 second timeout on _callAPI. You can override the value with Set-VSTeamDefaultAPITimeout and clear with Clear-VSTeamDefaultAPITimeout. diff --git a/Source/Public/Add-VSTeamWorkItem.ps1 b/Source/Public/Add-VSTeamWorkItem.ps1 index 17320edfa..eeb417a16 100644 --- a/Source/Public/Add-VSTeamWorkItem.ps1 +++ b/Source/Public/Add-VSTeamWorkItem.ps1 @@ -32,7 +32,9 @@ function Add-VSTeamWorkItem { Process { # The type has to start with a $ - $WorkItemType = '$' + $WorkItemType + # We can't reasign to $WorkItemType because the validate attribute + # above will fire again and throw exception. + $fullWorkItemType = '$' + $WorkItemType # Constructing the contents to be send. # Empty parameters will be skipped when converting to json. @@ -99,7 +101,7 @@ function Add-VSTeamWorkItem { # Call the REST API $resp = _callAPI -ProjectName $ProjectName -Area 'wit' -Resource 'workitems' ` - -Version $(_getApiVersion Core) -id $WorkItemType -Method Post ` + -Version $(_getApiVersion Core) -id $fullWorkItemType -Method Post ` -ContentType 'application/json-patch+json' -Body $json _applyTypesToWorkItem -item $resp diff --git a/Source/VSTeam.psd1 b/Source/VSTeam.psd1 index 642b4e65b..de530b99a 100644 --- a/Source/VSTeam.psd1 +++ b/Source/VSTeam.psd1 @@ -12,7 +12,7 @@ RootModule = 'VSTeam.psm1' # Version number of this module. - ModuleVersion = '6.5.0' + ModuleVersion = '6.5.1' # Supported PSEditions CompatiblePSEditions = @('Core', 'Desktop') diff --git a/Source/formats/Team.Agent.TableView.ps1xml b/Source/formats/Team.Agent.TableView.ps1xml index 5552ad407..069a54483 100644 --- a/Source/formats/Team.Agent.TableView.ps1xml +++ b/Source/formats/Team.Agent.TableView.ps1xml @@ -42,7 +42,7 @@ os - id + agentId diff --git a/integration/test/010_projects.Tests.ps1 b/integration/test/010_projects.Tests.ps1 index 10a171901..26b53d71f 100644 --- a/integration/test/010_projects.Tests.ps1 +++ b/integration/test/010_projects.Tests.ps1 @@ -221,6 +221,38 @@ Describe 'VSTeam Integration Tests' -Tag 'integration' { } } + Context 'WorkItem full exercise' { + BeforeAll { + # Everytime you run the test a new "$newProjectName" is generated. + # This is fine if you are running all the tests but not if you just + # want to run these. So if the newProjectName can't be found in the + # target system change newProjectName to equal the name of the project + # found with the correct description. + $newProjectName = Get-ProjectName + + # It is important for these tests that this returns a value. + # This will allow the validator to run which was a source of + # a bug we needed to fix. + Set-VSTeamDefaultProject $newProjectName + } + + AfterAll { + Clear-VSTeamDefaultProject + } + + It 'Add-VSTeamWorkItem' { + $actual = Add-VSTeamWorkItem -ProjectName $newProjectName -Title "IntTestWorkItem" -WorkItemType "Product Backlog Item" + + $actual | Should -Not -Be $null + } + + It 'Remove-VSTeamWorkItem' { + $workItemId = Get-VSTeamWiql -Query "Select [System.Id] From WorkItems" -ProjectName $newProjectName | Select-Object -ExpandProperty WorkItemIds + + { Remove-VSTeamWorkItem -Force -Destroy -Id $workItemId } | Should -Not -Throw + } + } + Context 'Pool full exercise' { It 'Get-VSTeamPool Should return agent pools' { $actual = Get-VSTeamPool