count_issues
Count issues in Backlog projects using filters like project, status, priority, assignee, dates, and custom fields to track work items.
Instructions
Returns count of issues
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | No | Project IDs | |
| issueTypeId | No | Issue type IDs | |
| categoryId | No | Category IDs | |
| versionId | No | Version IDs | |
| milestoneId | No | Milestone IDs | |
| statusId | No | Status IDs | |
| priorityId | No | Priority IDs | |
| assigneeId | No | Assignee user IDs | |
| createdUserId | No | Created user IDs | |
| resolutionId | No | Resolution IDs | |
| parentIssueId | No | Parent issue IDs | |
| keyword | No | Keyword to search for in issues | |
| startDateSince | No | Start date since (yyyy-MM-dd) | |
| startDateUntil | No | Start date until (yyyy-MM-dd) | |
| dueDateSince | No | Due date since (yyyy-MM-dd) | |
| dueDateUntil | No | Due date until (yyyy-MM-dd) | |
| createdSince | No | Created since (yyyy-MM-dd) | |
| createdUntil | No | Created until (yyyy-MM-dd) | |
| updatedSince | No | Updated since (yyyy-MM-dd) | |
| updatedUntil | No | Updated until (yyyy-MM-dd) | |
| customFields | No | Custom field filters (text, numeric, date, or list) |
Implementation Reference
- src/tools/countIssues.ts:131-136 (handler)The handler function for the 'count_issues' tool. It spreads the input parameters (rest) and adds custom field filters, then calls the Backlog API's getIssuesCount method to return the count of matching issues.handler: async ({ customFields, ...rest }) => { return backlog.getIssuesCount({ ...rest, ...customFieldFiltersToPayload(customFields), }); },
- src/tools/countIssues.ts:9-117 (schema)Zod input schema definition for the 'count_issues' tool, including optional arrays for IDs (project, type, etc.), strings for keywords and dates, and custom fields filters.const countIssuesSchema = buildToolSchema((t) => ({ projectId: z .array(z.number()) .optional() .describe(t('TOOL_COUNT_ISSUES_PROJECT_ID', 'Project IDs')), issueTypeId: z .array(z.number()) .optional() .describe(t('TOOL_COUNT_ISSUES_ISSUE_TYPE_ID', 'Issue type IDs')), categoryId: z .array(z.number()) .optional() .describe(t('TOOL_COUNT_ISSUES_CATEGORY_ID', 'Category IDs')), versionId: z .array(z.number()) .optional() .describe(t('TOOL_COUNT_ISSUES_VERSION_ID', 'Version IDs')), milestoneId: z .array(z.number()) .optional() .describe(t('TOOL_COUNT_ISSUES_MILESTONE_ID', 'Milestone IDs')), statusId: z .array(z.number()) .optional() .describe(t('TOOL_COUNT_ISSUES_STATUS_ID', 'Status IDs')), priorityId: z .array(z.number()) .optional() .describe(t('TOOL_COUNT_ISSUES_PRIORITY_ID', 'Priority IDs')), assigneeId: z .array(z.number()) .optional() .describe(t('TOOL_COUNT_ISSUES_ASSIGNEE_ID', 'Assignee user IDs')), createdUserId: z .array(z.number()) .optional() .describe(t('TOOL_COUNT_ISSUES_CREATED_USER_ID', 'Created user IDs')), resolutionId: z .array(z.number()) .optional() .describe(t('TOOL_COUNT_ISSUES_RESOLUTION_ID', 'Resolution IDs')), parentIssueId: z .array(z.number()) .optional() .describe(t('TOOL_COUNT_ISSUES_PARENT_ISSUE_ID', 'Parent issue IDs')), keyword: z .string() .optional() .describe( t('TOOL_COUNT_ISSUES_KEYWORD', 'Keyword to search for in issues') ), startDateSince: z .string() .optional() .describe( t('TOOL_COUNT_ISSUES_START_DATE_SINCE', 'Start date since (yyyy-MM-dd)') ), startDateUntil: z .string() .optional() .describe( t('TOOL_COUNT_ISSUES_START_DATE_UNTIL', 'Start date until (yyyy-MM-dd)') ), dueDateSince: z .string() .optional() .describe( t('TOOL_COUNT_ISSUES_DUE_DATE_SINCE', 'Due date since (yyyy-MM-dd)') ), dueDateUntil: z .string() .optional() .describe( t('TOOL_COUNT_ISSUES_DUE_DATE_UNTIL', 'Due date until (yyyy-MM-dd)') ), createdSince: z .string() .optional() .describe( t('TOOL_COUNT_ISSUES_CREATED_SINCE', 'Created since (yyyy-MM-dd)') ), createdUntil: z .string() .optional() .describe( t('TOOL_COUNT_ISSUES_CREATED_UNTIL', 'Created until (yyyy-MM-dd)') ), updatedSince: z .string() .optional() .describe( t('TOOL_COUNT_ISSUES_UPDATED_SINCE', 'Updated since (yyyy-MM-dd)') ), updatedUntil: z .string() .optional() .describe( t('TOOL_COUNT_ISSUES_UPDATED_UNTIL', 'Updated until (yyyy-MM-dd)') ), customFields: z .array(buildCustomFieldFilterSchema(t)) .optional() .describe( t( 'TOOL_COUNT_ISSUES_CUSTOM_FIELDS', 'Custom field filters (text, numeric, date, or list)' ) ), }));
- src/tools/tools.ts:95-95 (registration)The 'countIssuesTool' factory is called with backlog client and translation helper to instantiate the ToolDefinition, which is added to the 'issue' toolset in the allTools export.countIssuesTool(backlog, helper),
- src/tools/tools.ts:11-11 (registration)Import of the countIssuesTool factory function from its module.import { countIssuesTool } from './countIssues.js';
- src/tools/countIssues.ts:129-130 (schema)The input schema is constructed by wrapping countIssuesSchema with z.object and passing the translation helper.schema: z.object(countIssuesSchema(t)), outputSchema: IssueCountSchema,