Skip to content

Commit

Permalink
migrate subtask for server
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianRupprecht committed Nov 21, 2023
1 parent dcab85b commit 62b3b64
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion electron/providers/jira-server-provider/JiraServerProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,33 @@ export class JiraServerProvider implements IProvider {
subtaskSummary: string,
subtaskIssueTypeId: string
): Promise<{ id: string; key: string }> {
throw new Error("Method not implemented for Jira Server")
return new Promise((resolve, reject) => {
this.getRestApiClient(2)
.post(
'/issue',
{
fields: {
summary: subtaskSummary,
issuetype: {
id: subtaskIssueTypeId,
},
parent: {
key: parentIssueKey,
},
project: {
id: projectId,
},
},
}
)
.then(async (response) => {
const createdSubtask: { id: string; key: string } = response.data
resolve(createdSubtask)
})
.catch((error) => {
reject(new Error(`Error creating subtask: ${error}`))
})
})
}

editIssue(issue: Issue, issueIdOrKey: string): Promise<void> {
Expand Down

0 comments on commit 62b3b64

Please sign in to comment.