@stubbedev/atlassian-mcp 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2 -2
- package/dist/jira.js +18 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -232,7 +232,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
|
232
232
|
},
|
|
233
233
|
{
|
|
234
234
|
name: 'jira_search',
|
|
235
|
-
description: 'Discover Jira resources. Use when asked "find tickets for...", "what\'s in the backlog", "show me my issues", "list projects", or "which board is for project X". Set resource:\n• "issues" (default) — search by text, JQL, project, status, assignee, issue type, or mine=true for your queue\n• "projects" — list all projects and their keys\n• "issue_types" — valid types and statuses for a project\n• "boards" — list boards (pass project to filter by project key); use this to find the boardId before fetching sprints or board_overview\n• "sprints" — sprints for a board (pass boardId); if you don\'t know the boardId, first use resource=boards\n• "board_overview" — active/future sprints with their issues for a board (pass boardId); use when asked "what\'s in the sprint", "show me the board", or "what\'s everyone working on"\n• "versions" — list fix versions/releases for a project (pass project
|
|
235
|
+
description: 'Discover Jira resources. Use when asked "find tickets for...", "what\'s in the backlog", "show me my issues", "list projects", or "which board is for project X". Set resource:\n• "issues" (default) — search by text, JQL, project, status, assignee, issue type, or mine=true for your queue\n• "projects" — list all projects and their keys\n• "issue_types" — valid types and statuses for a project\n• "boards" — list boards (pass project to filter by project key); use this to find the boardId before fetching sprints or board_overview\n• "sprints" — sprints for a board (pass boardId); if you don\'t know the boardId, first use resource=boards\n• "board_overview" — active/future sprints with their issues for a board (pass boardId); use when asked "what\'s in the sprint", "show me the board", or "what\'s everyone working on"\n• "versions" — list fix versions/releases for a project (pass project; optionally pass query to filter by name substring). If the version you need does not exist, create it yourself with `jira_version action=create` — do NOT ask the user to make it in the Jira UI.\n• "users" — find users by name/email (pass query)',
|
|
236
236
|
inputSchema: {
|
|
237
237
|
type: 'object',
|
|
238
238
|
properties: {
|
|
@@ -816,7 +816,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
816
816
|
if (resource === 'board_overview')
|
|
817
817
|
return await jira.boardOverview({ boardId: a.boardId, sprintState: a.sprintState, sprintMaxResults: a.maxResults, sprintStartAt: a.startAt, includeIssues: a.includeIssues, assignee: a.assignee, status: a.status });
|
|
818
818
|
if (resource === 'versions')
|
|
819
|
-
return await jira.listVersions({ projectKey: a.projectKey ?? a.project, maxResults: a.maxResults });
|
|
819
|
+
return await jira.listVersions({ projectKey: a.projectKey ?? a.project, query: a.query, maxResults: a.maxResults });
|
|
820
820
|
if (resource === 'users')
|
|
821
821
|
return await jira.searchUsers({ query: a.query ?? '', maxResults: a.maxResults });
|
|
822
822
|
// issues (default)
|
package/dist/jira.js
CHANGED
|
@@ -864,9 +864,20 @@ export class JiraClient {
|
|
|
864
864
|
async listVersions(args) {
|
|
865
865
|
const projectKey = await this.resolveProjectKey(args.projectKey);
|
|
866
866
|
const data = await this.request('GET', `/project/${encodeURIComponent(projectKey)}/versions`);
|
|
867
|
-
|
|
867
|
+
const query = args.query?.trim();
|
|
868
|
+
const createHint = (name) => `Create it with: jira_version action=create projectKey=${projectKey} name="${name}"`;
|
|
869
|
+
if (!data || data.length === 0) {
|
|
870
|
+
if (query)
|
|
871
|
+
return text(`No versions in ${projectKey}. ${createHint(query)}`);
|
|
868
872
|
return text(`No versions in ${projectKey}.`);
|
|
869
|
-
|
|
873
|
+
}
|
|
874
|
+
const filtered = query
|
|
875
|
+
? data.filter(v => v.name.toLowerCase().includes(query.toLowerCase()))
|
|
876
|
+
: data;
|
|
877
|
+
if (query && filtered.length === 0) {
|
|
878
|
+
return text(`No version matching "${query}" in ${projectKey} (${data.length} other version(s) exist). ${createHint(query)}`);
|
|
879
|
+
}
|
|
880
|
+
const sorted = [...filtered].sort((a, b) => {
|
|
870
881
|
if (a.released !== b.released)
|
|
871
882
|
return a.released ? 1 : -1;
|
|
872
883
|
if (a.archived !== b.archived)
|
|
@@ -888,8 +899,11 @@ export class JiraClient {
|
|
|
888
899
|
const dateStr = dateParts.length ? ` (${dateParts.join(', ')})` : '';
|
|
889
900
|
return `${i + 1}. [${v.id}] ${v.name}${tagStr}${dateStr}`;
|
|
890
901
|
});
|
|
891
|
-
const
|
|
892
|
-
|
|
902
|
+
const header = query
|
|
903
|
+
? `${filtered.length} version(s) matching "${query}" in ${projectKey}:`
|
|
904
|
+
: `${filtered.length} version(s) in ${projectKey}:`;
|
|
905
|
+
const more = filtered.length > shown.length ? `\n...and ${filtered.length - shown.length} more (raise maxResults).` : '';
|
|
906
|
+
return text(`${header}\n${lines.join('\n')}${more}`);
|
|
893
907
|
}
|
|
894
908
|
async mutateVersion(args) {
|
|
895
909
|
const action = args.action ?? 'create';
|