Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | 17x 17x 17x 17x 8x 8x 8x 5x 4x 3x 3x | import { ConnectionManager } from '../services/ConnectionManager';
import { GET_PROJECT_OR_GROUP_WORK_ITEM_TYPES, GET_WORK_ITEM_TYPES } from '../graphql/workItems';
import { graphqlSupports } from '../entities/instance-version';
// Define interface for work item type objects
interface WorkItemType {
id: string;
name: string;
}
/**
* Internal utility function to get work item types for a namespace
* This is NOT exposed as a tool - it's for internal use only
*/
export async function getWorkItemTypes(namespace: string): Promise<WorkItemType[]> {
// Get GraphQL client from ConnectionManager
const connectionManager = ConnectionManager.getInstance();
const client = connectionManager.getClient();
if (graphqlSupports('Namespace', 'workItemTypes')) {
const response = await client.request(GET_WORK_ITEM_TYPES, { namespacePath: namespace });
return response.namespace?.workItemTypes?.nodes ?? [];
}
// Older instances expose work item types on the project or group only.
const response = await client.request(GET_PROJECT_OR_GROUP_WORK_ITEM_TYPES, {
namespacePath: namespace,
});
return (response.project ?? response.group)?.workItemTypes?.nodes ?? [];
}
|