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

Error running Add-VSTeamWorkItem in version 6.5.0 #345

Closed
2 of 7 tasks
wybaugh opened this issue Jul 21, 2020 · 7 comments
Closed
2 of 7 tasks

Error running Add-VSTeamWorkItem in version 6.5.0 #345

wybaugh opened this issue Jul 21, 2020 · 7 comments
Labels
bug when a bug has been identified or filed Investigating when an issue needs further investigation by a maintainer. Used only by maintainer.

Comments

@wybaugh
Copy link

wybaugh commented Jul 21, 2020

Hey guys,

I'm receiving the following error when attempting to create a PBI:

CreateAzureDevOpsTicket failed System.Management.Automation.ValidationMetadataException: The variable cannot be validated because the value $Product Backlog Item is not a valid value for the WorkItemType variable.
   at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
   at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)
   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
   at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame)
   at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0)
   at System.Management.Automation.PSScriptCmdlet.RunClause(Action`1 clause, Object dollarUnderbar, Object inputToProcess)
   at System.Management.Automation.PSScriptCmdlet.DoProcessRecord()
   at System.Management.Automation.CommandProcessor.ProcessRecord()

Steps to reproduce

Write-Host "Creating PBI"
$tfsWorkItem = Add-VSTeamWorkItem -ProjectName $adoProject -Title $kaceTicket.Title -Description $description -WorkItemType 'Product Backlog Item' -IterationPath $adoIterationPath -AdditionalFields $additionalFields

Expanded:

Add-VSTeamWorkItem -ProjectName "BI Team" -Title "Test - please don't delete" -Description "KACE Ticket Test" -WorkItemType "Product Backlog Item" -IterationPath "BI Team" -AdditionalFields
 System.Collections.DictionaryEntry System.Collections.DictionaryEntry System.Collections.DictionaryEntry

Expected behavior

This works under 6.4.6 with no error

Actual behavior

CreateAzureDevOpsTicket failed System.Management.Automation.ValidationMetadataException: The variable cannot be validated because the value $Product Backlog Item is not a valid value for the WorkItemType variable.
   at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
   at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)
   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
   at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame)
   at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0)
   at System.Management.Automation.PSScriptCmdlet.RunClause(Action`1 clause, Object dollarUnderbar, Object inputToProcess)
   at System.Management.Automation.PSScriptCmdlet.DoProcessRecord()
   at System.Management.Automation.CommandProcessor.ProcessRecord()

Environment data

OS

  • macOS
  • Windows
  • Linux

Server

  • TFS 2017
  • TFS 2018
  • Azure DevOps Server
  • Azure DevOps Service
> Get-VSTeamAPIVersion

Name                           Value                                                                                                                                                                                                                             
----                           -----                                                                                                                                                                                                                             
Release                        5.1                                                                                                                                                                                                                               
Version                        VSTS                                                                                                                                                                                                                              
MemberEntitlementManagement    6.0-preview                                                                                                                                                                                                                       
TaskGroups                     6.0-preview                                                                                                                                                                                                                       
DistributedTask                6.0-preview                                                                                                                                                                                                                       
Core                           5.1                                                                                                                                                                                                                               
Packaging                      6.0-preview                                                                                                                                                                                                                       
VariableGroups                 5.1-preview.1                                                                                                                                                                                                                     
Build                          5.1                                                                                                                                                                                                                               
Git                            5.1                                                                                                                                                                                                                               
ServiceEndpoints               5.0-preview                                                                                                                                                                                                                       
ExtensionsManagement           6.0-preview                                                                                                                                                                                                                       
Graph                          6.0-preview                                                                                                                                                                                                                       
Policy                         5.1                                                                                                                                                                                                                               
Tfvc                           5.1                                                                                                                                                                                                                               
Processes                      6.0-preview      

<!-- provide the output of $PSVersionTable -->

```powershell
> $PSVersionTable

Name                           Value                                                                                                                                                                                                                             
----                           -----                                                                                                                                                                                                                             
PSVersion                      5.1.16299.1146                                                                                                                                                                                                                    
PSEdition                      Desktop                                                                                                                                                                                                                           
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                                                                                                           
BuildVersion                   10.0.16299.1146                                                                                                                                                                                                                   
CLRVersion                     4.0.30319.42000                                                                                                                                                                                                                   
WSManStackVersion              3.0                                                                                                                                                                                                                               
PSRemotingProtocolVersion      2.3                                                                                                                                                                                                                               
SerializationVersion           1.1.0.1        
@SebastianSchuetze
Copy link
Collaborator

I edited you post for the code. Could you please make sure that you use code markup for readability? Thanks!

Is the "Product Backlog Item" a custom work item type?

@SebastianSchuetze SebastianSchuetze added the Investigating when an issue needs further investigation by a maintainer. Used only by maintainer. label Jul 21, 2020
@wybaugh
Copy link
Author

wybaugh commented Jul 21, 2020

Hi Sebastian. I don't think it is a custom work item type. 'Product Backlog Item' is a tab complete parameter option of the workitem type in VSTeam.

@DarqueWarrior
Copy link
Collaborator

Testing now.

@DarqueWarrior
Copy link
Collaborator

I was able to duplicate. I will work on a fix now. Thanks for reporting this. I will also add some integration tests around this.

@wybaugh
Copy link
Author

wybaugh commented Jul 28, 2020

Awesome! Thank you and thank you for an awesome module!

@DarqueWarrior
Copy link
Collaborator

A work-around until I get this changed pushed is to not set the default project and just pass it in. There is a WorkItem Type Validator that is kicking when you have a default project.

DarqueWarrior added a commit that referenced this issue Jul 28, 2020
@DarqueWarrior DarqueWarrior mentioned this issue Jul 28, 2020
3 tasks
@DarqueWarrior DarqueWarrior added the bug when a bug has been identified or filed label Jul 29, 2020
DarqueWarrior added a commit that referenced this issue Jul 29, 2020
* Fixed Bug #345
* Fixed Bug #337
@DarqueWarrior
Copy link
Collaborator

Fix will be in 6.5.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug when a bug has been identified or filed Investigating when an issue needs further investigation by a maintainer. Used only by maintainer.
Projects
None yet
Development

No branches or pull requests

3 participants