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()
- createOrUpdateClassificationNode()
- createQuery()
- createWorkItem()
- deleteClassificationNode()
- deleteQuery()
- deleteWorkItem()
- destroyWorkItem()
- evaluateRulesOnField()
- exportWorkItemTypeDefinition()
- getAttachmentContent()
- getAttachmentZip()
- getClassificationNode()
- getDeletedWorkItem()
- getDeletedWorkItems()
- getDependentFields()
- getField()
- getFields()
- getHistory()
- getHistoryById()
- getQueries()
- getQuery()
- getRelationType()
- getRelationTypes()
- getReportingLinks()
- getRevision()
- getRevisions()
- getRootNodes()
- getUpdate()
- getUpdates()
- getWorkItem()
- getWorkItems()
- getWorkItemTemplate()
- getWorkItemType()
- getWorkItemTypeCategories()
- getWorkItemTypeCategory()
- getWorkItemTypes()
- queryById()
- queryByWiql()
- readReportingRevisionsGet()
- readReportingRevisionsPost()
- restoreWorkItem()
- updateClassificationNode()
- updateQuery()
- updateWorkItem()
- updateWorkItemTemplate()
- updateWorkItemTypeDefinition()
createAttachment()
Creates an attachment.
Syntax
IPromise<Contracts.AttachmentReference> createAttachment(content, fileName, uploadType)
Parameters
content
: string. Content to uploadfileName
: string. Optional.uploadType
: string. Optional.
Returns
createOrUpdateClassificationNode()
Syntax
IPromise<Contracts.WorkItemClassificationNode> createOrUpdateClassificationNode(postedNode, project, structureGroup, path)
Parameters
postedNode
: Contracts.WorkItemClassificationNode.project
: string.structureGroup
: Contracts.TreeStructureGroup.path
: string. Optional.
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 namequery
: string. The parent path for the query to create.
Returns
createWorkItem()
Syntax
IPromise<Contracts.WorkItem> createWorkItem(document, project, type, validateOnly, bypassRules)
Parameters
document
: VSS_Common_Contracts.JsonPatchDocument.project
: string.type
: string.validateOnly
: boolean. Optional.bypassRules
: boolean. Optional.
Returns
deleteClassificationNode()
Syntax
IPromise<void> deleteClassificationNode(project, structureGroup, path, reclassifyId)
Parameters
project
: string. Project ID or project namestructureGroup
: Contracts.TreeStructureGroup.path
: string. Optional.reclassifyId
: number. Optional.
Returns
- IPromise<void>
deleteQuery()
Syntax
IPromise<void> deleteQuery(project, query)
Parameters
project
: string. Project ID or project namequery
: string.
Returns
- IPromise<void>
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
- IPromise<void>
evaluateRulesOnField()
Validates the fields values.
Syntax
IPromise<void> evaluateRulesOnField(ruleEngineInput)
Parameters
ruleEngineInput
: Contracts.FieldsToEvaluate.
Returns
- IPromise<void>
exportWorkItemTypeDefinition()
Export work item type
Syntax
IPromise<Contracts.WorkItemTypeTemplate> exportWorkItemTypeDefinition(project, type, exportGlobalLists)
Parameters
project
: string. Optional. Project ID or project nametype
: string. Optional.exportGlobalLists
: boolean. Optional.
Returns
getAttachmentContent()
Returns an attachment
Syntax
IPromise<ArrayBuffer> getAttachmentContent(id, fileName)
Parameters
id
: string.fileName
: string. Optional.
Returns
- IPromise<ArrayBuffer>
getAttachmentZip()
Returns an attachment
Syntax
IPromise<ArrayBuffer> getAttachmentZip(id, fileName)
Parameters
id
: string.fileName
: string. Optional.
Returns
- IPromise<ArrayBuffer>
getClassificationNode()
Syntax
IPromise<Contracts.WorkItemClassificationNode> getClassificationNode(project, structureGroup, path, depth)
Parameters
project
: string. Project ID or project namestructureGroup
: 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 nameids
: 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 nametype
: 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 nameexpand
: 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 namequery
: 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 nametypes
: 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
id
: number.revisionNumber
: number.expand
: Contracts.WorkItemExpand. Optional.
Returns
getRevisions()
Returns the list of fully hydrated work item revisions, paged.
Syntax
IPromise<Contracts.WorkItem[]> getRevisions(id, top, skip, expand)
Parameters
id
: number.top
: number. Optional.skip
: number. Optional.expand
: Contracts.WorkItemExpand. Optional.
Returns
getRootNodes()
Syntax
IPromise<Contracts.WorkItemClassificationNode[]> getRootNodes(project, depth)
Parameters
project
: string. Project ID or project namedepth
: 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
id
: number.fields
: string[]. Optional.asOf
: Date. Optional.expand
: Contracts.WorkItemExpand. Optional.
Returns
getWorkItems()
Returns a list of work items
Syntax
IPromise<Contracts.WorkItem[]> getWorkItems(ids, fields, asOf, expand)
Parameters
ids
: number[].fields
: string[]. Optional.asOf
: Date. Optional.expand
: Contracts.WorkItemExpand. Optional.
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 nametype
: 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 nametype
: 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 namecategory
: 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 nameteam
: 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 nameteam
: 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 namefields
: 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 formatproject
: string. Optional. Project ID or project namewatermark
: 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
payload
: Contracts.WorkItemDeleteUpdate.id
: number.project
: string. Optional.
Returns
updateClassificationNode()
Syntax
IPromise<Contracts.WorkItemClassificationNode> updateClassificationNode(postedNode, project, structureGroup, path)
Parameters
postedNode
: Contracts.WorkItemClassificationNode.project
: string.structureGroup
: Contracts.TreeStructureGroup.path
: string. Optional.
Returns
updateQuery()
Syntax
IPromise<Contracts.QueryHierarchyItem> updateQuery(queryUpdate, project, query, undeleteDescendants)
Parameters
queryUpdate
: Contracts.QueryHierarchyItem.project
: string.query
: string.undeleteDescendants
: boolean. Optional.
Returns
updateWorkItem()
Syntax
IPromise<Contracts.WorkItem> updateWorkItem(document, id, validateOnly, bypassRules)
Parameters
document
: VSS_Common_Contracts.JsonPatchDocument.id
: number.validateOnly
: boolean. Optional.bypassRules
: boolean. Optional.
Returns
updateWorkItemTemplate()
Syntax
IPromise<Contracts.WorkItem> updateWorkItemTemplate(document, project, type, validateOnly, bypassRules)
Parameters
document
: VSS_Common_Contracts.JsonPatchDocument.project
: string.type
: string.validateOnly
: boolean. Optional.bypassRules
: boolean. Optional.
Returns
updateWorkItemTypeDefinition()
Add/updates a work item type
Syntax
IPromise<Contracts.ProvisioningResult> updateWorkItemTypeDefinition(updateModel, project)
Parameters
updateModel
: Contracts.WorkItemTypeTemplateUpdateModel.project
: string. Optional.