WorkItemTrackingHttpClient2_2

Important

Disclaimer: This API is in private preview and subject to change. This API is in private preview and subject to change.

Module path: TFS/WorkItemTracking/RestClient

Initialization sample

  import RestClient = require("TFS/WorkItemTracking/RestClient");

  // Get an instance of the client
  var client = RestClient.getClient();
    
  // Call a method on the client
  // e.g. client.getResource(...).then(...);

Methods

createAttachment()

Creates an attachment.

Syntax

 IPromise<Contracts.AttachmentReference> createAttachment(content, fileName, uploadType)

Parameters

  • content: string. Content to upload
  • fileName: string. Optional.
  • uploadType: string. Optional.

Returns

createOrUpdateClassificationNode()

Syntax

 IPromise<Contracts.WorkItemClassificationNode> createOrUpdateClassificationNode(postedNode, project, structureGroup, path)

Parameters

Returns

createQuery()

Creates a query, or moves a query.

Syntax

 IPromise<Contracts.QueryHierarchyItem> createQuery(postedQuery, project, query)

Parameters

  • postedQuery: Contracts.QueryHierarchyItem. The query to create.
  • project: string. Project ID or project name
  • query: string. The parent path for the query to create.

Returns

createWorkItem()

Syntax

 IPromise<Contracts.WorkItem> createWorkItem(document, project, type, validateOnly, bypassRules)

Parameters

Returns

deleteClassificationNode()

Syntax

 IPromise<void> deleteClassificationNode(project, structureGroup, path, reclassifyId)

Parameters

  • project: string. Project ID or project name
  • structureGroup: Contracts.TreeStructureGroup.
  • path: string. Optional.
  • reclassifyId: number. Optional.

Returns

deleteQuery()

Syntax

 IPromise<void> deleteQuery(project, query)

Parameters

  • project: string. Project ID or project name
  • query: string.

Returns

deleteWorkItem()

Syntax

 IPromise<Contracts.WorkItemDelete> deleteWorkItem(id, destroy)

Parameters

  • id: number.
  • destroy: boolean. Optional.

Returns

destroyWorkItem()

Syntax

 IPromise<void> destroyWorkItem(id, project)

Parameters

  • id: number.
  • project: string. Optional.

Returns

evaluateRulesOnField()

Validates the fields values.

Syntax

 IPromise<void> evaluateRulesOnField(ruleEngineInput)

Parameters

Returns

exportWorkItemTypeDefinition()

Export work item type

Syntax

 IPromise<Contracts.WorkItemTypeTemplate> exportWorkItemTypeDefinition(project, type, exportGlobalLists)

Parameters

  • project: string. Optional. Project ID or project name
  • type: string. Optional.
  • exportGlobalLists: boolean. Optional.

Returns

getAttachmentContent()

Returns an attachment

Syntax

 IPromise<ArrayBuffer> getAttachmentContent(id, fileName)

Parameters

  • id: string.
  • fileName: string. Optional.

Returns

getAttachmentZip()

Returns an attachment

Syntax

 IPromise<ArrayBuffer> getAttachmentZip(id, fileName)

Parameters

  • id: string.
  • fileName: string. Optional.

Returns

getClassificationNode()

Syntax

 IPromise<Contracts.WorkItemClassificationNode> getClassificationNode(project, structureGroup, path, depth)

Parameters

  • project: string. Project ID or project name
  • structureGroup: Contracts.TreeStructureGroup.
  • path: string. Optional.
  • depth: number. Optional.

Returns

getDeletedWorkItem()

Syntax

 IPromise<Contracts.WorkItemDelete> getDeletedWorkItem(id, project)

Parameters

  • id: number.
  • project: string. Optional.

Returns

getDeletedWorkItems()

Syntax

 IPromise<Contracts.WorkItemDeleteReference[]> getDeletedWorkItems(project, ids)

Parameters

  • project: string. Optional. Project ID or project name
  • ids: number[]. Optional.

Returns

getDependentFields()

Returns the dependent fields for the corresponding workitem type and fieldname

Syntax

 IPromise<Contracts.FieldDependentRule> getDependentFields(project, type, field)

Parameters

  • project: string. Project ID or project name
  • type: string.
  • field: string.

Returns

getField()

Syntax

 IPromise<Contracts.WorkItemField> getField(field)

Parameters

  • field: string.

Returns

getFields()

Syntax

 IPromise<Contracts.WorkItemField[]> getFields()

Parameters

Returns

getHistory()

Returns history of all revision for a given work item ID

Syntax

 IPromise<Contracts.WorkItemHistory[]> getHistory(id, top, skip)

Parameters

  • id: number.
  • top: number. Optional.
  • skip: number. Optional.

Returns

getHistoryById()

Returns the history value of particular revision

Syntax

 IPromise<Contracts.WorkItemHistory> getHistoryById(id, revisionNumber)

Parameters

  • id: number.
  • revisionNumber: number.

Returns

getQueries()

Retrieves all queries the user has access to in the current project

Syntax

 IPromise<Contracts.QueryHierarchyItem[]> getQueries(project, expand, depth, includeDeleted)

Parameters

  • project: string. Project ID or project name
  • expand: Contracts.QueryExpand. Optional.
  • depth: number. Optional.
  • includeDeleted: boolean. Optional.

Returns

getQuery()

Retrieves a single query by project and either ID or path

Syntax

 IPromise<Contracts.QueryHierarchyItem> getQuery(project, query, expand, depth, includeDeleted)

Parameters

  • project: string. Project ID or project name
  • query: string.
  • expand: Contracts.QueryExpand. Optional.
  • depth: number. Optional.
  • includeDeleted: boolean. Optional.

Returns

getRelationType()

Gets the work item relation types.

Syntax

 IPromise<Contracts.WorkItemRelationType> getRelationType(relation)

Parameters

  • relation: string.

Returns

getRelationTypes()

Syntax

 IPromise<Contracts.WorkItemRelationType[]> getRelationTypes()

Parameters

Returns

getReportingLinks()

Get a batch of work item links

Syntax

 IPromise<Contracts.ReportingWorkItemLinksBatch> getReportingLinks(project, types, watermark, startDateTime)

Parameters

  • project: string. Optional. Project ID or project name
  • types: string[]. Optional. A list of types to filter the results to specific work item types. Omit this parameter to get work item links of all work item types.
  • watermark: number. Optional. Specifies the watermark to start the batch from. Omit this parameter to get the first batch of links.
  • startDateTime: Date. Optional. Date/time to use as a starting point for link changes. Only link changes that occurred after that date/time are returned. Cannot be used in conjunction with 'watermark' parameter.

Returns

getRevision()

Returns a fully hydrated work item for the requested revision

Syntax

 IPromise<Contracts.WorkItem> getRevision(id, revisionNumber, expand)

Parameters

Returns

getRevisions()

Returns the list of fully hydrated work item revisions, paged.

Syntax

 IPromise<Contracts.WorkItem[]> getRevisions(id, top, skip, expand)

Parameters

Returns

getRootNodes()

Syntax

 IPromise<Contracts.WorkItemClassificationNode[]> getRootNodes(project, depth)

Parameters

  • project: string. Project ID or project name
  • depth: number. Optional.

Returns

getUpdate()

Returns a single update for a work item

Syntax

 IPromise<Contracts.WorkItemUpdate> getUpdate(id, updateNumber)

Parameters

  • id: number.
  • updateNumber: number.

Returns

getUpdates()

Returns a the deltas between work item revisions

Syntax

 IPromise<Contracts.WorkItemUpdate[]> getUpdates(id, top, skip)

Parameters

  • id: number.
  • top: number. Optional.
  • skip: number. Optional.

Returns

getWorkItem()

Returns a single work item

Syntax

 IPromise<Contracts.WorkItem> getWorkItem(id, fields, asOf, expand)

Parameters

Returns

getWorkItems()

Returns a list of work items

Syntax

 IPromise<Contracts.WorkItem[]> getWorkItems(ids, fields, asOf, expand)

Parameters

Returns

getWorkItemTemplate()

Returns a single work item from a template

Syntax

 IPromise<Contracts.WorkItem> getWorkItemTemplate(project, type, fields, asOf, expand)

Parameters

  • project: string. Project ID or project name
  • type: string.
  • fields: string. Optional.
  • asOf: Date. Optional.
  • expand: Contracts.WorkItemExpand. Optional.

Returns

getWorkItemType()

Returns a the deltas between work item revisions

Syntax

 IPromise<Contracts.WorkItemType> getWorkItemType(project, type)

Parameters

  • project: string. Project ID or project name
  • type: string.

Returns

getWorkItemTypeCategories()

Syntax

 IPromise<Contracts.WorkItemTypeCategory[]> getWorkItemTypeCategories(project)

Parameters

  • project: string. Project ID or project name

Returns

getWorkItemTypeCategory()

Returns a the deltas between work item revisions

Syntax

 IPromise<Contracts.WorkItemTypeCategory> getWorkItemTypeCategory(project, category)

Parameters

  • project: string. Project ID or project name
  • category: string.

Returns

getWorkItemTypes()

Syntax

 IPromise<Contracts.WorkItemType[]> getWorkItemTypes(project)

Parameters

  • project: string. Project ID or project name

Returns

queryById()

Gets the results of the query by id.

Syntax

 IPromise<Contracts.WorkItemQueryResult> queryById(id, project, team)

Parameters

  • id: string. The query id.
  • project: string. Optional. Project ID or project name
  • team: string. Optional. Team ID or team name

Returns

queryByWiql()

Gets the results of the query.

Syntax

 IPromise<Contracts.WorkItemQueryResult> queryByWiql(wiql, project, team)

Parameters

  • wiql: Contracts.Wiql. The query containing the wiql.
  • project: string. Optional. Project ID or project name
  • team: string. Optional. Team ID or team name

Returns

readReportingRevisionsGet()

Get a batch of work item revisions

Syntax

 IPromise<Contracts.ReportingWorkItemRevisionsBatch> readReportingRevisionsGet(project, fields, types, watermark, startDateTime, includeIdentityRef, includeDeleted)

Parameters

  • project: string. Optional. Project ID or project name
  • fields: string[]. Optional. A list of fields to return in work item revisions. Omit this parameter to get all reportable fields.
  • types: string[]. Optional. A list of types to filter the results to specific work item types. Omit this parameter to get work item revisions of all work item types.
  • watermark: number. Optional. Specifies the watermark to start the batch from. Omit this parameter to get the first batch of revisions.
  • startDateTime: Date. Optional. Date/time to use as a starting point for revisions, all revisions occur after this date/time. Cannot be used in conjunction with 'watermark' parameter.
  • includeIdentityRef: boolean. Optional. Return an identity reference instead of a string value for identity fields.
  • includeDeleted: boolean. Optional. Specify if the deleted item should be returned.

Returns

readReportingRevisionsPost()

Get a batch of work item revisions

Syntax

 IPromise<Contracts.ReportingWorkItemRevisionsBatch> readReportingRevisionsPost(filter, project, watermark, startDateTime)

Parameters

  • filter: Contracts.ReportingWorkItemRevisionsFilter. An object that contains request settings: field filter, type filter, identity format
  • project: string. Optional. Project ID or project name
  • watermark: number. Optional. Specifies the watermark to start the batch from. Omit this parameter to get the first batch of revisions.
  • startDateTime: Date. Optional. Date/time to use as a starting point for revisions, all revisions occur after this date/time. Cannot be used in conjunction with 'watermark' parameter.

Returns

restoreWorkItem()

Syntax

 IPromise<Contracts.WorkItemDelete> restoreWorkItem(payload, id, project)

Parameters

Returns

updateClassificationNode()

Syntax

 IPromise<Contracts.WorkItemClassificationNode> updateClassificationNode(postedNode, project, structureGroup, path)

Parameters

Returns

updateQuery()

Syntax

 IPromise<Contracts.QueryHierarchyItem> updateQuery(queryUpdate, project, query, undeleteDescendants)

Parameters

Returns

updateWorkItem()

Syntax

 IPromise<Contracts.WorkItem> updateWorkItem(document, id, validateOnly, bypassRules)

Parameters

Returns

updateWorkItemTemplate()

Syntax

 IPromise<Contracts.WorkItem> updateWorkItemTemplate(document, project, type, validateOnly, bypassRules)

Parameters

Returns

updateWorkItemTypeDefinition()

Add/updates a work item type

Syntax

 IPromise<Contracts.ProvisioningResult> updateWorkItemTypeDefinition(updateModel, project)

Parameters

Returns