@atlassian-dc-mcp/jira 0.7.0 → 0.8.0
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/CHANGELOG.md +11 -0
- package/build/index.js +4 -7
- package/build/index.js.map +1 -1
- package/build/jira-service.d.ts +14 -0
- package/build/jira-service.d.ts.map +1 -1
- package/build/jira-service.js +25 -1
- package/build/jira-service.js.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +10 -7
- package/src/jira-service.ts +34 -1
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [0.8.0](https://github.com/b1ff/atlassian-dc-mcp/compare/v0.7.0...v0.8.0) (2025-09-06)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **jira:** introduce issue update functionality ([d9c20cb](https://github.com/b1ff/atlassian-dc-mcp/commit/d9c20cbcacc20a50131666a7276dedf46a5ee544))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [0.7.0](https://github.com/b1ff/atlassian-dc-mcp/compare/v0.6.0...v0.7.0) (2025-08-03)
|
|
7
18
|
|
|
8
19
|
|
package/build/index.js
CHANGED
|
@@ -1,25 +1,20 @@
|
|
|
1
1
|
import { connectServer, createMcpServer, formatToolResponse } from '@atlassian-dc-mcp/common';
|
|
2
2
|
import { JiraService, jiraToolSchemas } from './jira-service.js';
|
|
3
3
|
import * as process from 'node:process';
|
|
4
|
-
// Validate required environment variables
|
|
5
4
|
const missingEnvVars = JiraService.validateConfig();
|
|
6
5
|
if (missingEnvVars.length > 0) {
|
|
7
6
|
throw new Error(`Missing required environment variables: ${missingEnvVars.join(', ')}`);
|
|
8
7
|
}
|
|
9
8
|
const jiraService = new JiraService(process.env.JIRA_HOST, process.env.JIRA_API_TOKEN, process.env.JIRA_API_BASE_PATH);
|
|
10
|
-
// Initialize MCP server
|
|
11
9
|
const server = createMcpServer({
|
|
12
10
|
name: "atlassian-jira-mcp",
|
|
13
11
|
version: "0.1.0"
|
|
14
12
|
});
|
|
15
|
-
// Define JIRA instance type
|
|
16
13
|
const jiraInstanceType = "JIRA Data Center edition instance";
|
|
17
|
-
// Add JIRA issue search tool
|
|
18
14
|
server.tool("jira_searchIssues", `Search for JIRA issues using JQL in the ${jiraInstanceType}`, jiraToolSchemas.searchIssues, async ({ jql, expand, startAt, maxResults = 10 }) => {
|
|
19
15
|
const result = await jiraService.searchIssues(jql, startAt, expand, maxResults);
|
|
20
16
|
return formatToolResponse(result);
|
|
21
17
|
});
|
|
22
|
-
// Add get JIRA issue tool
|
|
23
18
|
server.tool("jira_getIssue", `Get details of a JIRA issue by its key from the ${jiraInstanceType}`, jiraToolSchemas.getIssue, async ({ issueKey, expand }) => {
|
|
24
19
|
const result = await jiraService.getIssue(issueKey, expand);
|
|
25
20
|
return formatToolResponse(result);
|
|
@@ -28,15 +23,17 @@ server.tool('jira_getIssueComments', `Get comments of a JIRA issue by its key fr
|
|
|
28
23
|
const result = await jiraService.getIssueComments(issueKey, expand);
|
|
29
24
|
return formatToolResponse(result);
|
|
30
25
|
});
|
|
31
|
-
// Add create JIRA issue tool
|
|
32
26
|
server.tool("jira_createIssue", `Create a new JIRA issue in the ${jiraInstanceType}`, jiraToolSchemas.createIssue, async (params) => {
|
|
33
27
|
const result = await jiraService.createIssue(params);
|
|
34
28
|
return formatToolResponse(result);
|
|
35
29
|
});
|
|
30
|
+
server.tool("jira_updateIssue", `Update an existing JIRA issue in the ${jiraInstanceType}`, jiraToolSchemas.updateIssue, async (params) => {
|
|
31
|
+
const result = await jiraService.updateIssue(params);
|
|
32
|
+
return formatToolResponse(result);
|
|
33
|
+
});
|
|
36
34
|
server.tool("jira_postIssueComment", `Post a comment on a JIRA issue in the ${jiraInstanceType}`, jiraToolSchemas.postIssueComment, async ({ issueKey, comment }) => {
|
|
37
35
|
const result = await jiraService.postIssueComment(issueKey, comment);
|
|
38
36
|
return formatToolResponse(result);
|
|
39
37
|
});
|
|
40
|
-
// Connect the server after all tools are registered
|
|
41
38
|
await connectServer(server);
|
|
42
39
|
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9F,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AAExC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9F,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AAExC,MAAM,cAAc,GAAG,WAAW,CAAC,cAAc,EAAE,CAAC;AACpD,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;IAC9B,MAAM,IAAI,KAAK,CAAC,2CAA2C,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC1F,CAAC;AAED,MAAM,WAAW,GAAG,IAAI,WAAW,CACjC,OAAO,CAAC,GAAG,CAAC,SAAU,EACtB,OAAO,CAAC,GAAG,CAAC,cAAe,EAC3B,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAC/B,CAAC;AAEF,MAAM,MAAM,GAAG,eAAe,CAAC;IAC7B,IAAI,EAAE,oBAAoB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AAC,WAAW,CAAC,MAAM,CAAC,CAAC;IACrD,OAAO,kBAAkB,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC,CACF,CAAC;AAEF,MAAM,CAAC,IAAI,CACT,kBAAkB,EAClB,wCAAwC,gBAAgB,EAAE,EAC1D,eAAe,CAAC,WAAW,EAC3B,KAAK,EAAE,MAAM,EAAE,EAAE;IACf,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IACrD,OAAO,kBAAkB,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC,CACF,CAAC;AAEF,MAAM,CAAC,IAAI,CACT,uBAAuB,EACvB,yCAAyC,gBAAgB,EAAE,EAC3D,eAAe,CAAC,gBAAgB,EAChC,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;IAC9B,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,gBAAgB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACrE,OAAO,kBAAkB,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC,CACF,CAAA;AAED,MAAM,aAAa,CAAC,MAAM,CAAC,CAAC"}
|
package/build/jira-service.d.ts
CHANGED
|
@@ -12,6 +12,13 @@ export declare class JiraService {
|
|
|
12
12
|
issueTypeId: string;
|
|
13
13
|
customFields?: Record<string, any>;
|
|
14
14
|
}): Promise<import("@atlassian-dc-mcp/common").ApiErrorResponse<import("./jira-client/index.js").IssueCreateResponse>>;
|
|
15
|
+
updateIssue(params: {
|
|
16
|
+
issueKey: string;
|
|
17
|
+
summary?: string;
|
|
18
|
+
description?: string;
|
|
19
|
+
issueTypeId?: string;
|
|
20
|
+
customFields?: Record<string, any>;
|
|
21
|
+
}): Promise<import("@atlassian-dc-mcp/common").ApiErrorResponse<void>>;
|
|
15
22
|
static validateConfig(): string[];
|
|
16
23
|
}
|
|
17
24
|
export declare const jiraToolSchemas: {
|
|
@@ -40,5 +47,12 @@ export declare const jiraToolSchemas: {
|
|
|
40
47
|
issueTypeId: z.ZodString;
|
|
41
48
|
customFields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
42
49
|
};
|
|
50
|
+
updateIssue: {
|
|
51
|
+
issueKey: z.ZodString;
|
|
52
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
53
|
+
description: z.ZodOptional<z.ZodString>;
|
|
54
|
+
issueTypeId: z.ZodOptional<z.ZodString>;
|
|
55
|
+
customFields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
56
|
+
};
|
|
43
57
|
};
|
|
44
58
|
//# sourceMappingURL=jira-service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jira-service.d.ts","sourceRoot":"","sources":["../src/jira-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,qBAAa,WAAW;gBACV,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM;IAMvD,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,EAAE,UAAU,GAAE,MAAW;IAWtF,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM;IAI1C,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM;IAIlD,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;IAIlD,WAAW,CAAC,MAAM,EAAE;QACxB,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,EAAE,MAAM,CAAC;QACpB,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KACpC;
|
|
1
|
+
{"version":3,"file":"jira-service.d.ts","sourceRoot":"","sources":["../src/jira-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,qBAAa,WAAW;gBACV,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM;IAMvD,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,EAAE,UAAU,GAAE,MAAW;IAWtF,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM;IAI1C,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM;IAIlD,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;IAIlD,WAAW,CAAC,MAAM,EAAE;QACxB,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,EAAE,MAAM,CAAC;QACpB,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KACpC;IAiBK,WAAW,CAAC,MAAM,EAAE;QACxB,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KACpC;IAqBD,MAAM,CAAC,cAAc,IAAI,MAAM,EAAE;CASlC;AAED,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiC3B,CAAC"}
|
package/build/jira-service.js
CHANGED
|
@@ -34,13 +34,30 @@ export class JiraService {
|
|
|
34
34
|
description: params.description,
|
|
35
35
|
issuetype: { id: params.issueTypeId }
|
|
36
36
|
};
|
|
37
|
-
// Merge custom fields with standard fields
|
|
38
37
|
const fields = params.customFields
|
|
39
38
|
? { ...standardFields, ...params.customFields }
|
|
40
39
|
: standardFields;
|
|
41
40
|
return IssueService.createIssue(true, { fields });
|
|
42
41
|
}, 'Error creating issue');
|
|
43
42
|
}
|
|
43
|
+
async updateIssue(params) {
|
|
44
|
+
return handleApiOperation(async () => {
|
|
45
|
+
const standardFields = {};
|
|
46
|
+
if (params.summary !== undefined) {
|
|
47
|
+
standardFields.summary = params.summary;
|
|
48
|
+
}
|
|
49
|
+
if (params.description !== undefined) {
|
|
50
|
+
standardFields.description = params.description;
|
|
51
|
+
}
|
|
52
|
+
if (params.issueTypeId !== undefined) {
|
|
53
|
+
standardFields.issuetype = { id: params.issueTypeId };
|
|
54
|
+
}
|
|
55
|
+
const fields = params.customFields
|
|
56
|
+
? { ...standardFields, ...params.customFields }
|
|
57
|
+
: standardFields;
|
|
58
|
+
return IssueService.editIssue(params.issueKey, 'true', { fields });
|
|
59
|
+
}, 'Error updating issue');
|
|
60
|
+
}
|
|
44
61
|
static validateConfig() {
|
|
45
62
|
const requiredEnvVars = ['JIRA_API_TOKEN'];
|
|
46
63
|
const missingVars = requiredEnvVars.filter(varName => !process.env[varName]);
|
|
@@ -75,6 +92,13 @@ export const jiraToolSchemas = {
|
|
|
75
92
|
description: z.string().describe("Issue description in the format suitable for JIRA DATA CENTER edition (JIRA Wiki Markup)."),
|
|
76
93
|
issueTypeId: z.string().describe("Issue type id (e.g. id of Task, Bug, Story). Should be found first a correct number for specific JIRA installation."),
|
|
77
94
|
customFields: z.record(z.any()).optional().describe("Optional custom fields as key-value pairs. Examples: {'customfield_10001': 'Custom Value', 'priority': {'id': '1'}, 'assignee': {'name': 'john.doe'}, 'labels': ['urgent', 'bug']}")
|
|
95
|
+
},
|
|
96
|
+
updateIssue: {
|
|
97
|
+
issueKey: z.string().describe("JIRA issue key (e.g., PROJ-123)"),
|
|
98
|
+
summary: z.string().optional().describe("New summary (optional)"),
|
|
99
|
+
description: z.string().optional().describe("New description in JIRA Wiki Markup (optional)"),
|
|
100
|
+
issueTypeId: z.string().optional().describe("New issue type id (optional)"),
|
|
101
|
+
customFields: z.record(z.any()).optional().describe("Optional custom fields to update as key-value pairs. Examples: {'customfield_10001': 'Custom Value', 'priority': {'id': '1'}, 'assignee': {'name': 'john.doe'}, 'labels': ['urgent', 'bug']}")
|
|
78
102
|
}
|
|
79
103
|
};
|
|
80
104
|
//# sourceMappingURL=jira-service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jira-service.js","sourceRoot":"","sources":["../src/jira-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE9E,MAAM,OAAO,WAAW;IACtB,YAAY,IAAY,EAAE,KAAa,EAAE,WAAoB;QAC3D,OAAO,CAAC,IAAI,GAAG,WAAW,IAAI,WAAW,IAAI,OAAO,CAAC;QACrD,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC;QACtB,OAAO,CAAC,OAAO,GAAG,GAAG,CAAC;IACxB,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,GAAW,EAAE,OAAgB,EAAE,MAAiB,EAAE,aAAqB,EAAE;QAC1F,OAAO,kBAAkB,CAAC,GAAG,EAAE;YAC7B,OAAO,aAAa,CAAC,wBAAwB,CAAC;gBAC5C,GAAG;gBACH,UAAU;gBACV,MAAM;gBACN,OAAO;aACR,CAAC,CAAC;QACL,CAAC,EAAE,wBAAwB,CAAC,CAAC;IAC/B,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,QAAgB,EAAE,MAAe;QAC9C,OAAO,kBAAkB,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,CA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run.js",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"test": "jest"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@atlassian-dc-mcp/common": "^0.
|
|
18
|
+
"@atlassian-dc-mcp/common": "^0.8.0",
|
|
19
19
|
"@modelcontextprotocol/sdk": "^1.5.0",
|
|
20
20
|
"dotenv": "^16.4.7",
|
|
21
21
|
"zod": "^3.24.2"
|
|
@@ -29,5 +29,5 @@
|
|
|
29
29
|
"publishConfig": {
|
|
30
30
|
"access": "public"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "5e924022217bdeb4a286705b1a1d81ec0b1def64"
|
|
33
33
|
}
|
package/src/index.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { connectServer, createMcpServer, formatToolResponse } from '@atlassian-d
|
|
|
2
2
|
import { JiraService, jiraToolSchemas } from './jira-service.js';
|
|
3
3
|
import * as process from 'node:process';
|
|
4
4
|
|
|
5
|
-
// Validate required environment variables
|
|
6
5
|
const missingEnvVars = JiraService.validateConfig();
|
|
7
6
|
if (missingEnvVars.length > 0) {
|
|
8
7
|
throw new Error(`Missing required environment variables: ${missingEnvVars.join(', ')}`);
|
|
@@ -14,16 +13,13 @@ const jiraService = new JiraService(
|
|
|
14
13
|
process.env.JIRA_API_BASE_PATH,
|
|
15
14
|
);
|
|
16
15
|
|
|
17
|
-
// Initialize MCP server
|
|
18
16
|
const server = createMcpServer({
|
|
19
17
|
name: "atlassian-jira-mcp",
|
|
20
18
|
version: "0.1.0"
|
|
21
19
|
});
|
|
22
20
|
|
|
23
|
-
// Define JIRA instance type
|
|
24
21
|
const jiraInstanceType = "JIRA Data Center edition instance";
|
|
25
22
|
|
|
26
|
-
// Add JIRA issue search tool
|
|
27
23
|
server.tool(
|
|
28
24
|
"jira_searchIssues",
|
|
29
25
|
`Search for JIRA issues using JQL in the ${jiraInstanceType}`,
|
|
@@ -34,7 +30,6 @@ server.tool(
|
|
|
34
30
|
}
|
|
35
31
|
);
|
|
36
32
|
|
|
37
|
-
// Add get JIRA issue tool
|
|
38
33
|
server.tool(
|
|
39
34
|
"jira_getIssue",
|
|
40
35
|
`Get details of a JIRA issue by its key from the ${jiraInstanceType}`,
|
|
@@ -54,7 +49,6 @@ server.tool(
|
|
|
54
49
|
return formatToolResponse(result);
|
|
55
50
|
});
|
|
56
51
|
|
|
57
|
-
// Add create JIRA issue tool
|
|
58
52
|
server.tool(
|
|
59
53
|
"jira_createIssue",
|
|
60
54
|
`Create a new JIRA issue in the ${jiraInstanceType}`,
|
|
@@ -65,6 +59,16 @@ server.tool(
|
|
|
65
59
|
}
|
|
66
60
|
);
|
|
67
61
|
|
|
62
|
+
server.tool(
|
|
63
|
+
"jira_updateIssue",
|
|
64
|
+
`Update an existing JIRA issue in the ${jiraInstanceType}`,
|
|
65
|
+
jiraToolSchemas.updateIssue,
|
|
66
|
+
async (params) => {
|
|
67
|
+
const result = await jiraService.updateIssue(params);
|
|
68
|
+
return formatToolResponse(result);
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
|
|
68
72
|
server.tool(
|
|
69
73
|
"jira_postIssueComment",
|
|
70
74
|
`Post a comment on a JIRA issue in the ${jiraInstanceType}`,
|
|
@@ -75,5 +79,4 @@ server.tool(
|
|
|
75
79
|
}
|
|
76
80
|
)
|
|
77
81
|
|
|
78
|
-
// Connect the server after all tools are registered
|
|
79
82
|
await connectServer(server);
|
package/src/jira-service.ts
CHANGED
|
@@ -47,7 +47,6 @@ export class JiraService {
|
|
|
47
47
|
issuetype: { id: params.issueTypeId }
|
|
48
48
|
};
|
|
49
49
|
|
|
50
|
-
// Merge custom fields with standard fields
|
|
51
50
|
const fields = params.customFields
|
|
52
51
|
? { ...standardFields, ...params.customFields }
|
|
53
52
|
: standardFields;
|
|
@@ -56,6 +55,33 @@ export class JiraService {
|
|
|
56
55
|
}, 'Error creating issue');
|
|
57
56
|
}
|
|
58
57
|
|
|
58
|
+
async updateIssue(params: {
|
|
59
|
+
issueKey: string;
|
|
60
|
+
summary?: string;
|
|
61
|
+
description?: string;
|
|
62
|
+
issueTypeId?: string;
|
|
63
|
+
customFields?: Record<string, any>;
|
|
64
|
+
}) {
|
|
65
|
+
return handleApiOperation(async () => {
|
|
66
|
+
const standardFields: Record<string, any> = {};
|
|
67
|
+
if (params.summary !== undefined) {
|
|
68
|
+
standardFields.summary = params.summary;
|
|
69
|
+
}
|
|
70
|
+
if (params.description !== undefined) {
|
|
71
|
+
standardFields.description = params.description;
|
|
72
|
+
}
|
|
73
|
+
if (params.issueTypeId !== undefined) {
|
|
74
|
+
standardFields.issuetype = { id: params.issueTypeId };
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const fields = params.customFields
|
|
78
|
+
? { ...standardFields, ...params.customFields }
|
|
79
|
+
: standardFields;
|
|
80
|
+
|
|
81
|
+
return IssueService.editIssue(params.issueKey, 'true', { fields });
|
|
82
|
+
}, 'Error updating issue');
|
|
83
|
+
}
|
|
84
|
+
|
|
59
85
|
static validateConfig(): string[] {
|
|
60
86
|
const requiredEnvVars = ['JIRA_API_TOKEN'] as const;
|
|
61
87
|
const missingVars: string[] = requiredEnvVars.filter(varName => !process.env[varName]);
|
|
@@ -92,5 +118,12 @@ export const jiraToolSchemas = {
|
|
|
92
118
|
description: z.string().describe("Issue description in the format suitable for JIRA DATA CENTER edition (JIRA Wiki Markup)."),
|
|
93
119
|
issueTypeId: z.string().describe("Issue type id (e.g. id of Task, Bug, Story). Should be found first a correct number for specific JIRA installation."),
|
|
94
120
|
customFields: z.record(z.any()).optional().describe("Optional custom fields as key-value pairs. Examples: {'customfield_10001': 'Custom Value', 'priority': {'id': '1'}, 'assignee': {'name': 'john.doe'}, 'labels': ['urgent', 'bug']}")
|
|
121
|
+
},
|
|
122
|
+
updateIssue: {
|
|
123
|
+
issueKey: z.string().describe("JIRA issue key (e.g., PROJ-123)"),
|
|
124
|
+
summary: z.string().optional().describe("New summary (optional)"),
|
|
125
|
+
description: z.string().optional().describe("New description in JIRA Wiki Markup (optional)"),
|
|
126
|
+
issueTypeId: z.string().optional().describe("New issue type id (optional)"),
|
|
127
|
+
customFields: z.record(z.any()).optional().describe("Optional custom fields to update as key-value pairs. Examples: {'customfield_10001': 'Custom Value', 'priority': {'id': '1'}, 'assignee': {'name': 'john.doe'}, 'labels': ['urgent', 'bug']}")
|
|
95
128
|
}
|
|
96
129
|
};
|