Skip to main content

Get-VSTeamWorkItem

SYNOPSIS​

Returns one or more a work items from your project.

SYNTAX​

ByID (Default)​

Get-VSTeamWorkItem -Id <Int32[]> [-Expand <String>] [-Fields <String[]>] [<CommonParameters>]

List​

Get-VSTeamWorkItem -Id <Int32[]> [-ErrorPolicy <String>] [-Expand <String>] [-Fields <String[]>]
[<CommonParameters>]

DESCRIPTION​

Returns one or more a work items from your project.

EXAMPLES​

Example 1​

Get-VSTeamWorkItem -Id 47,48

This command gets work items with IDs 47 and 48 by using the IDs parameter.

PARAMETERS​

-Id​

The id of one or more work items.

Type: Int32[]
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-ErrorPolicy​

The flag to control error policy in a bulk get work items request. The acceptable values for this parameter are:

  • Fail
  • Omit
Type: String
Parameter Sets: List
Aliases:

Required: False
Position: Named
Default value: Omit
Accept pipeline input: False
Accept wildcard characters: False

-Fields​

Comma-separated list of requested fields.

Type: String[]
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Expand​

Comma-separated list of requested fields. The acceptable values for this parameter are:

  • None
  • Relations
  • Fields
  • Links
  • All
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters​

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS​

System.String​

ProjectName

WorkItemType

OUTPUTS​

NOTES​

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 you must provide -ProjectName or you will have to type in the names.

Prerequisites:

Set the account and version that all calls will use with Set-VSTeamAccount. Default version sets to API version 3.0 (TFS2017) if not manually set.

tips:

  • check called version of the API with Get-VSTeamAPIVersion or Get-VSTeamInfo
  • use Set-VSTeamDefaultProject to set default project for every call
  • use Set-VSTeamDefaultAPITimeout to change the default timeout of 60 seconds for all calls.
  • use Profiles to load an account and the correct version