操作
バグ #334
未完了Redmine-1: API基盤・チケット機能 (4h)
ステータス:
新規
優先度:
高め
担当者:
-
開始日:
2025-06-07
期日:
進捗率:
0%
予定工数:
説明
Redmine API基盤とチケット作成・検索機能を実装する。
実装内容¶
Redmine API基盤¶
export class RedmineManager {
private apiKey: string = 'feb66d81a5f4ff9c585ce30fce2ac06e0554aec6';
private baseUrl: string = 'https://call2arm.com';
private redis: Redis;
private async makeApiRequest(endpoint: string, method: string = 'GET', data?: any) {
const headers = {
'X-Redmine-API-Key': this.apiKey,
'Content-Type': 'application/json'
};
const url = `${this.baseUrl}${endpoint}`;
const response = await axios({ method, url, headers, data });
return response.data;
}
}
チケット作成機能¶
async createTicket(userId: string, ticketData: {
subject: string;
description: string;
project_id?: number;
tracker_id?: number;
priority_id?: number;
}) {
const data = {
issue: {
project_id: ticketData.project_id || 1,
tracker_id: ticketData.tracker_id || 1,
priority_id: ticketData.priority_id || 2,
subject: ticketData.subject,
description: ticketData.description
}
};
const result = await this.makeApiRequest('/issues.json', 'POST', data);
// 作成履歴記録
await this.logRedmineActivity(userId, 'create_ticket', result.issue);
return {
content: [{
type: "text",
text: `Ticket created: #${result.issue.id} - ${result.issue.subject}`
}]
};
}
チケット検索機能¶
- プロジェクト別検索
- キーワード検索
- ステータス別検索
- 担当者別検索
成果物¶
- Redmine API基盤実装
- チケット作成機能
- チケット検索機能
作業時間: 4時間¶
表示するデータがありません
操作