Skip to main content

Update-VSTeamWorkItem

SYNOPSIS

Update a work item in your project.

SYNTAX

Update-VSTeamWorkItem -Id <Int32> [-Title <String>] [-Description <String>] [-IterationPath <String>]
[-AssignedTo <String>] [-AdditionalFields <Hashtable>] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

Update-VSTeamWorkItem will update a new work item in your project.

EXAMPLES

Example 1

Set-VSTeamDefaultProject Demo
Update-VSTeamWorkItem -WorkItemId 1 -Title "Updated Work Item"

ID Title Status
-- ---
id: Update-VSTeamWorkItem
title: Update-VSTeamWorkItem
hide_title: true
hide_table_of_contents: false
custom_edit_url: https://github.com/MethodsAndPractices/vsteam/edit/trunk/.docs/Update-VSTeamWorkItem.md
description: ''
keywords:
- vsteam
- cmdlet
- azure devops
------
id: Update-VSTeamWorkItem
title: Update-VSTeamWorkItem
hide_title: true
hide_table_of_contents: false
custom_edit_url: https://github.com/MethodsAndPractices/vsteam/edit/trunk/.docs/Update-VSTeamWorkItem.md
description: ''
keywords:
- vsteam
- cmdlet
- azure devops
----- ---
id: Update-VSTeamWorkItem
title: Update-VSTeamWorkItem
hide_title: true
hide_table_of_contents: false
custom_edit_url: https://github.com/MethodsAndPractices/vsteam/edit/trunk/.docs/Update-VSTeamWorkItem.md
description: ''
keywords:
- vsteam
- cmdlet
- azure devops
---
6 Updated Work Item To Do

Example 3

Set-VSTeamDefaultProject Demo
$additionalFields = @{"System.Tags"= "TestTag"; "System.AreaPath" = "Project\\MyPath"}
Update-VSTeamWorkItem -Title "Updated Work Item" -WorkItemType Task -Description "This is a description" -AdditionalFields $additionalFields

ID Title Status
-- ---
id: Update-VSTeamWorkItem
title: Update-VSTeamWorkItem
hide_title: true
hide_table_of_contents: false
custom_edit_url: https://github.com/MethodsAndPractices/vsteam/edit/trunk/.docs/Update-VSTeamWorkItem.md
description: ''
keywords:
- vsteam
- cmdlet
- azure devops
------
6 Updated Work Item To Do

PARAMETERS

-Id

The id of the work item.

Type: Int32
Parameter Sets: (All)
Aliases:

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

-Title

The title of the work item

Type: String
Parameter Sets: (All)
Aliases:

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

-Description

The Description of the work item

Type: String
Parameter Sets: (All)
Aliases:

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

-IterationPath

The IterationPath of the work item

Type: String
Parameter Sets: (All)
Aliases:

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

-AssignedTo

The email address of the user this work item will be assigned to.

Type: String
Parameter Sets: (All)
Aliases:

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

-AdditionalFields

Hashtable which contains a key value pair of any field that should be filled with values. Key is the internal name of the field and the value is the content of the field being filled. E.g. the internal name for the area path is 'System.AreaPath'.

Type: Hashtable
Parameter Sets: (All)
Aliases:

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

-Force

Forces the function without confirmation.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

-WhatIf

Shows what would happen if the function runs. The function is not run.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

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

-Confirm

Prompts you for confirmation before running the function.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: False
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

Any of the basic work item parameters defined in this method, will cause an exception if also added to the parameter AdditionalFields, since it is redundant. Either only use the parameter OR define them in the AdditionalFields parameter.

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