WorkItem Class

Represents a work item on Team Foundation Server.

System.Object
  Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItem

Namespace:  Microsoft.TeamFoundation.WorkItemTracking.Client
Assembly:  Microsoft.TeamFoundation.WorkItemTracking.Client (in Microsoft.TeamFoundation.WorkItemTracking.Client.dll)

public sealed class WorkItem

The WorkItem type exposes the following members.

  NameDescription
Public methodWorkItemInitializes a new instance of the WorkItem class of the specified WorkItemType.
Top

  NameDescription
Public propertyAreaIdGets or sets the integer value of the AreaId field for this work item.
Public propertyAreaPathGets or sets the string value of the AreaPath field for this work item.
Public propertyAttachedFileCountGets the number of attached files for this work item.
Public propertyAttachmentsGets the AttachmentCollection object that represents the attachments that belong to this work item.
Public propertyAuthorizedDate
Public propertyChangedByGets the string value of the ChangedBy field for this work item.
Public propertyChangedDateGets the DateTime object that represents the date and time that this work item was last changed.
Public propertyCreatedByGets the string value of the CreatedBy field for this work item.
Public propertyCreatedDateGets the DateTime object that represents the date and time that this work item was created.
Public propertyDescriptionGets or sets a string that describes this work item.
Public propertyDisplayFormGets the display form that is associated with this work item.
Public propertyExternalLinkCountGets the number of external links in this work item.
Public propertyFieldsGets the FieldCollection object that contains the Fields of this work item.
Public propertyHistoryGets or sets the string value of the History field for this work item.
Public propertyHyperLinkCountGets the number of hyperlinks in this work item.
Public propertyIdGets the ID of this work item.
Public propertyIsDirtyGets a flag that describes whether this work item has been changed since its last save.
Public propertyIsNewGets a flag that describes whether this work item is new.
Public propertyIsOpenGets a flag that describes whether this work item is currently open for edit.
Public propertyIsPartialOpenGets a flag that describes whether the work item is partially opened.
Public propertyIsReadOnlyGets a flag that describes whether the work item is read-only.
Public propertyIsReadOnlyOpenGets a flag that describes whether the work item is open as read-only.
Public propertyItem[String]Gets or sets the value of a field in this work item that is specified by the field name.
Public propertyItem[CoreField]Gets or sets the value of a field in this work item that is specified by the field ID.
Public propertyIterationIdGets or sets the integer value of the IterationId field of this work item.
Public propertyIterationPathGets or sets the string value of the IterationPath field of this work item.
Public propertyLinksGets the collection of the links in this work item.
Public propertyNodeNameGets or sets the string value of the NodeName field of this work item.
Public propertyProjectGets the current project that is associated with this work item.
Public propertyReasonGets or sets the string value of the Reason field for this work item.
Public propertyRelatedLinkCountGets the number of related links of this work item.
Public propertyRevGets the integer that represents the revision number of this work item.
Public propertyRevisedDateGets a DateTime object that represents the revision date and time of this work item.
Public propertyRevisionGets the integer that represents the revision number of this work item.
Public propertyRevisionsGets a RevisionCollection object that represents a collection of valid revision numbers for this work item.
Public propertyStateGets or sets a string that describes the state of this work item.
Public propertyStoreGets the WorkItemStore to which this work item belongs.
Public propertyTags
Public propertyTemporaryIdGets the temporary ID of this work item.
Public propertyTitleGets or sets a string that describes the title of this work item.
Public propertyTypeGets a WorkItemType object that represents the type of this work item.
Public propertyUriGets the uniform resource identifier (Uri) of this work item.
Public propertyWatermark
Public propertyWorkItemLinkHistoryGets a WorkItemLinkCollection object that represents a collection of the WorkItemLinks that link to this work item now or linked to it in the past.
Public propertyWorkItemLinksGets a WorkItemLinkCollection object that represents a collection of the WorkItemLinks that currently link to this work item.
Top

  NameDescription
Public methodCloseCloses this WorkItem instance and frees memory that is associated with it.
Public methodCopy()Creates a copy of this WorkItem instance.
Public methodCopy(WorkItemType)Creates a copy of this WorkItem instance that is of the specified WorkItemType.
Public methodCopy(WorkItemType, WorkItemCopyFlags)Creates a copy of this WorkItem instance that is of the specified WorkItemType.
Public methodEqualsDetermines whether the specified object is equal to the current object. (Inherited from Object.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetNextStateGets the next state of this work item based on the action of a user.
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodIsValidValidates the fields of this work item.
Public methodOpenOpens this work item for modification.
Public methodPartialOpenOpens this work item for modification when transmitting minimal amounts of data over the network.
Public methodResetReverts all changes that were made since the last save.
Public methodSave()Saves any pending changes on this work item.
Public methodSave(SaveFlags)Saves any pending changes on this work item.
Public methodSetDirtyTemporarily overrides the dirty state of a work item. Any modification to the work item will cause this to be reset to the correct value, depending on the work item's modification state.
Public methodSyncToLatestSynchronizes the work item to the latest revision.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Public methodValidateGets an ArrayList of fields in this work item that are not valid.
Top

  NameDescription
Public eventFieldChangedOccurs when a field is updated in this WorkItem instance.
Public eventSavingThe event gets fired every time that the work item is about to be saved.
Top

The following methods to access the fields and field values are available:

  • WorkItem["field-name"] gets/sets the value of a field.

  • WorkItem.Fields["field-name"] gets/sets the field, not the value.

  • WorkItem.Fields["field-name"].Value gets/sets the value of the field.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft