Last Update: 11/7/2016

Work Item Form Navigation Service

This API is in private preview and subject to change.

The work item form navigation service allows you to open the work item form for a new or existing work item. You can use the service to open a work item form with an initial set of field values pre-populated.

Example

    VSS.require(["TFS/WorkItemTracking/Services"], function(workItemServices) {
        workItemServices.WorkItemFormNavigationService.getService().then(function (workItemNavSvc) {
            workItemNavSvc.openWorkItem(1);
        });
    });

See a full example in the work-item-form sample extension found in the vsts-extension-samples repository.

Methods

openWorkItem()

Opens the specified work item. The host page will display the work item in a dialog, or it may update the current page view, depending on the current page.

Syntax

 IPromise<void> openWorkItem(workItemId, openInNewTab)

Parameters

  • workItemId: number. The id of the work item to open.
  • openInNewTab: boolean. Optional. If true, opens the work item in a new tab. Default is false.

Returns

  • IPromise<void>. An empty promise, or an error if rejected.

openNewWorkItem()

Opens a new work item of the specified type. The host page will display the new work item in a dialog, or it may update the current page view, depending on the current page.

Syntax

 IPromise<void> openNewWorkItem(workItemTypeName, initialValues)

Parameters

  • workItemTypeName: string. The name of the work item type to open.
  • initialValues: IDictionaryStringTo. Optional. A dictionary of any initial field values (field reference name to value pairs) to set after opening the new work item.

Returns

  • IPromise<void>. An empty promise, or an error if rejected.