﻿/// <reference path='../typings/tsd.d.ts' />

import Q = require("q");

// Register context menu action
VSS.register("vsts-extension-ts-seed-simple-action", {
    getMenuItems: (context) => {
        return [<IContributedMenuItem>{
            title: "Work Item Menu Action"
        }];
    }
});
﻿/// <reference path='../typings/tsd.d.ts' />

// Register context menu action
VSS.register("vsts-extension-ts-seed-simple-action", {
    getMenuItems: (context) => {
        return [<IContributedMenuItem>{
            title: "Work Item Menu Action",
            action: (actionContext) => {
                let workItemId = actionContext.id
                    || (actionContext.ids && actionContext.ids.length > 0 && actionContext.ids[0])
                    || (actionContext.workItemIds && actionContext.workItemIds.length > 0 && actionContext.workItemIds[0]);
                    
                if (workItemId) {
                    alert(`Selected work item ${workItemId}`);
                }
            }
        }];
    }
});
Add alert action to work item context menu
Add alert action to work item context menu
