Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ const tools: Tool[] = [
},
description: 'Array of component names',
},
customFields: {
type: 'object',
description: 'Map of additional Jira field IDs/keys (e.g., customfield_10211) to include in the fields payload',
additionalProperties: true,
},
},
required: ['projectKey', 'summary', 'issueType'],
},
Expand Down Expand Up @@ -169,6 +174,11 @@ const tools: Tool[] = [
type: 'string',
description: 'New status/workflow state (e.g., "In Progress", "Done")',
},
customFields: {
type: 'object',
description: 'Map of additional Jira field IDs/keys (e.g., customfield_10211) to include in the fields payload',
additionalProperties: true,
},
},
required: ['issueKey'],
},
Expand Down Expand Up @@ -346,6 +356,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
assignee: args.assignee as string,
labels: args.labels as string[],
components: args.components as string[],
customFields: args.customFields as Record<string, any>,
};
const issue = await getJiraClient().createIssue(input);
return {
Expand All @@ -365,6 +376,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
assignee: args.assignee as string,
priority: args.priority as string,
labels: args.labels as string[],
customFields: args.customFields as Record<string, any>,
status: args.status as string,
};
const issue = await getJiraClient().updateIssue(args.issueKey as string, input);
Expand Down
14 changes: 14 additions & 0 deletions src/jira-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ export interface CreateIssueInput {
assignee?: string;
labels?: string[];
components?: string[];
// Pass-through map for Jira custom fields (e.g., { customfield_10211: 10015 })
customFields?: Record<string, any>;
}

export interface UpdateIssueInput {
Expand All @@ -61,6 +63,8 @@ export interface UpdateIssueInput {
priority?: string;
labels?: string[];
status?: string;
// Pass-through map for Jira custom fields to update
customFields?: Record<string, any>;
}

export interface JiraComment {
Expand Down Expand Up @@ -138,6 +142,11 @@ export class JiraClient {
issueData.fields.components = input.components.map(c => ({ name: c }));
}

// Merge any provided custom fields directly into the fields payload
if (input.customFields && typeof input.customFields === 'object') {
Object.assign(issueData.fields, input.customFields);
}

const response = await this.client.post('/issue', issueData);
return await this.getIssue(response.data.key);
}
Expand Down Expand Up @@ -167,6 +176,11 @@ export class JiraClient {
updateData.fields.labels = input.labels;
}

// Merge any provided custom fields directly into the fields payload
if (input.customFields && typeof input.customFields === 'object') {
Object.assign(updateData.fields, input.customFields);
}

await this.client.put(`/issue/${issueKey}`, updateData);

// Handle status transition separately if provided
Expand Down