Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I connected to VSTS Server by using:

$teamProjectCollection = [Microsoft.TeamFoundation.Client.TfsTeamProjectCollectionFactory]::GetTeamProjectCollection("http://wonderful01:8080")

$ws = $teamProjectCollection.GetService([type]"Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore")

$closebug=$ws.getworkitem(801089)

After that I ran $closebug, and got one of the items I need to modify:

Value                    : Fixed
OriginalValue            : Fixed
FieldDefinition          : Microsoft.TeamFoundation.WorkItemTracking.Client.FieldDefinition
Id                       : 10001
Name                     : Substatus
ReferenceName            : Microsoft.SQL.Substatus
IsDirty                  : False
IsEditable               : True
IsComputed               : False
IsRequired               : True
AllowedValues            : {Verification Not Needed, Verified}
HasAllowedValuesList     : True
IsLimitedToAllowedValues : True
ProhibitedValues         : {}
HasPatternMatch          : False
Status                   : InvalidListValue
IsValid                  : False
WorkItem                 : Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItem

So how can I change the vaule from "fixed" to "verified"?

share|improve this question
    
Anybody know something about this?... –  pansal Sep 15 '11 at 1:51
add comment

1 Answer

I am coming to answer my question. After a long time investigation I found that substatus could be invoked by:

$closebug.fields[54]

To change value from "fixed" to "resolved", use:

$closebug.fields[54].value="resolved"

Then update the change:

$closebug.save()

I am not quite understanding why it works, and I think there should be a better way to do it. Welcome comments.

share|improve this answer
1  
Thanks for updating the question with your answer! –  Wesley Sep 20 '11 at 2:51
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.