gitlab_create_issue
Create new issues in GitLab projects to track bugs, tasks, or feature requests. Specify project path, title, description, labels, and assignees.
Instructions
Creates a new issue in a GitLab project.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectPath | Yes | The path of the GitLab project. | |
| title | Yes | The title of the issue. | |
| description | No | The description of the issue. | |
| labels | No | Labels to assign to the issue. | |
| assigneeIds | No | User IDs to assign the issue to. |
Implementation Reference
- src/gitlab.service.ts:663-675 (handler)Core handler function that executes the GitLab API call to create an issue.async createIssue(projectPath: string, title: string, description?: string, labels?: string[], assigneeIds?: number[]): Promise<any> { const encodedProjectPath = encodeURIComponent(projectPath); const body: any = { title }; if (description) body.description = description; if (labels && labels.length > 0) body.labels = labels.join(','); if (assigneeIds && assigneeIds.length > 0) body.assignee_ids = assigneeIds; return this.callGitLabApi<any>( `projects/${encodedProjectPath}/issues`, 'POST', body, ); }
- src/index.ts:865-896 (registration)Tool registration including name, description, and input schema.{ name: 'gitlab_create_issue', description: 'Creates a new issue in a GitLab project.', inputSchema: { type: 'object', properties: { projectPath: { type: 'string', description: 'The path of the GitLab project.', }, title: { type: 'string', description: 'The title of the issue.', }, description: { type: 'string', description: 'The description of the issue.', }, labels: { type: 'array', items: { type: 'string' }, description: 'Labels to assign to the issue.', }, assigneeIds: { type: 'array', items: { type: 'number' }, description: 'User IDs to assign the issue to.', }, }, required: ['projectPath', 'title'], }, },
- src/index.ts:1986-2006 (handler)MCP server request handler that processes calls to 'gitlab_create_issue' and delegates to GitLabService.case 'gitlab_create_issue': { if (!gitlabService) { throw new Error('GitLab service is not initialized.'); } const { projectPath, title, description, labels, assigneeIds } = args as { projectPath: string; title: string; description?: string; labels?: string[]; assigneeIds?: number[] }; const result = await gitlabService.createIssue(projectPath, title, description, labels, assigneeIds); return { content: [ { type: 'text', text: `Issue created successfully: ${JSON.stringify(result, null, 2)}`, }, ], }; }
- src/gitlab.service.ts:663-675 (schema)Type definitions for the createIssue method parameters.async createIssue(projectPath: string, title: string, description?: string, labels?: string[], assigneeIds?: number[]): Promise<any> { const encodedProjectPath = encodeURIComponent(projectPath); const body: any = { title }; if (description) body.description = description; if (labels && labels.length > 0) body.labels = labels.join(','); if (assigneeIds && assigneeIds.length > 0) body.assignee_ids = assigneeIds; return this.callGitLabApi<any>( `projects/${encodedProjectPath}/issues`, 'POST', body, ); }