Skip to content
Merged
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
5 changes: 2 additions & 3 deletions src/commands/tickets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ function renderTicketDetail(ticket: Ticket): void {
lines.push(``, `${theme.muted('Assignee:')} ${ticket.assignee.name}`);
}
if (ticket.url) {
const shortUrl = `https://notion.so/${ticket.id.replace(/-/g, '')}`;
lines.push(``, `${theme.muted('URL:')} ${theme.primary(shortUrl)}`);
lines.push(``, `${theme.muted('URL:')} ${theme.primary(ticket.url)}`);
}
if (ticket.description) {
lines.push(``, theme.muted(ticket.description));
Expand Down Expand Up @@ -83,7 +82,7 @@ async function runTicketActions(
return;
}

const url = ticket.url ? `https://notion.so/${ticket.id.replace(/-/g, '')}` : null;
const url = ticket.url;

if (!url) return;

Expand Down
20 changes: 20 additions & 0 deletions src/integrations/jira/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,26 @@ export class JiraClient implements TicketsProvider {
});
}

async getStatuses(): Promise<string[]> {
try {
if (this.projectConfig?.projectKey) {
const res = await fetch(this.url(`/project/${this.projectConfig.projectKey}/statuses`), {
headers: this.headers,
});
if (res.ok) {
const data = (await res.json()) as { statuses: { name: string }[] }[];
return [...new Set(data.flatMap((t) => t.statuses.map((s) => s.name)))];
}
}
const res = await fetch(this.url('/status'), { headers: this.headers });
if (!res.ok) return [];
const data = (await res.json()) as { name: string }[];
return data.map((s) => s.name);
} catch {
return [];
}
}

async transitionTicket(ticketId: string, transitionName: string): Promise<void> {
return this.transitionIssue(ticketId, transitionName);
}
Expand Down