Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug345 #348

Merged
merged 5 commits into from
Jul 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .docs/Get-VSTeamWorkItem.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
6 changes: 4 additions & 2 deletions Source/Public/Add-VSTeamWorkItem.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Source/VSTeam.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
2 changes: 1 addition & 1 deletion Source/formats/Team.Agent.TableView.ps1xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<PropertyName>os</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>id</PropertyName>
<PropertyName>agentId</PropertyName>
</TableColumnItem>
</TableColumnItems>
</TableRowEntry>
Expand Down
32 changes: 32 additions & 0 deletions integration/test/010_projects.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down