mirror of
https://github.com/stablyai/orca.git
synced 2026-10-03 16:02:11 +00:00
Creating a Jira issue was impossible whenever a project marked Reporter
required. Jira's createmeta returns `reporter` with `schema.type: "user"`
and no `allowedValues`, so the create dialog rendered it as a plain text
Input and never searched anyone; whatever was typed left the renderer as a
bare string, which Jira Cloud rejects with "Reporter is required." — the
same for a pasted accountId.
- render a searched picker for any user-typed create field, scoped to the
target project (create has no issue key, so the existing issue-scoped
assignable search could not be reused as-is)
- report a failed user search in the dropdown instead of showing it empty,
including an unrecognized payload from an older paired host
- carry a picked user as a provider-neutral marker the execution host
resolves to Cloud `{id}` or Server/DC `{name}`, matching what updateIssue
already does for assignees
- keep a typed or pasted account id selectable, since Jira accepts one the
directory search never surfaced
- name the still-blank required fields under the form instead of leaving
Create disabled with no explanation
`jira.listAssignableUsers` keeps its array shape for paired older clients.
88 lines
2.8 KiB
TypeScript
88 lines
2.8 KiB
TypeScript
import type {
|
|
JiraComment,
|
|
JiraConnectionStatus,
|
|
JiraCreateField,
|
|
JiraCreateIssueArgs,
|
|
JiraIssue,
|
|
JiraIssueFilter,
|
|
JiraIssueType,
|
|
JiraIssueUpdate,
|
|
JiraPriority,
|
|
JiraProject,
|
|
JiraProjectStatusOrder,
|
|
JiraSiteSelection,
|
|
JiraTransition,
|
|
JiraUser,
|
|
JiraUserSearchArgs,
|
|
JiraUserSearchResult,
|
|
JiraViewer
|
|
} from '../../shared/jira-types'
|
|
|
|
export type JiraApi = {
|
|
connect: (args: {
|
|
siteUrl: string
|
|
email: string
|
|
apiToken: string
|
|
authType?: 'cloud' | 'server'
|
|
}) => Promise<{ ok: true; viewer: JiraViewer } | { ok: false; error: string }>
|
|
disconnect: (args?: { siteId?: string }) => Promise<void>
|
|
selectSite: (args: { siteId: JiraSiteSelection }) => Promise<JiraConnectionStatus>
|
|
status: () => Promise<JiraConnectionStatus>
|
|
readStatus: () => Promise<JiraConnectionStatus>
|
|
testConnection: (args?: {
|
|
siteId?: string
|
|
}) => Promise<{ ok: true; viewer: JiraViewer } | { ok: false; error: string }>
|
|
searchIssues: (args: {
|
|
jql: string
|
|
limit?: number
|
|
siteId?: JiraSiteSelection
|
|
requestId?: string
|
|
}) => Promise<JiraIssue[]>
|
|
cancelSearchIssues: (args: { requestId: string }) => Promise<void>
|
|
listIssues: (args?: {
|
|
filter?: JiraIssueFilter
|
|
limit?: number
|
|
siteId?: JiraSiteSelection
|
|
}) => Promise<JiraIssue[]>
|
|
getIssue: (args: { key: string; siteId?: string }) => Promise<JiraIssue | null>
|
|
lookupIssueSummary: (args: {
|
|
key: string
|
|
siteId: string
|
|
requestId?: string
|
|
}) => Promise<JiraIssue | null>
|
|
cancelIssueSummary: (args: { requestId: string }) => Promise<void>
|
|
createIssue: (
|
|
args: JiraCreateIssueArgs
|
|
) => Promise<{ ok: true; id: string; key: string; url: string } | { ok: false; error: string }>
|
|
updateIssue: (args: {
|
|
key: string
|
|
updates: JiraIssueUpdate
|
|
siteId?: string
|
|
}) => Promise<{ ok: true } | { ok: false; error: string }>
|
|
addIssueComment: (args: {
|
|
key: string
|
|
body: string
|
|
siteId?: string
|
|
}) => Promise<{ ok: true; id: string } | { ok: false; error: string }>
|
|
issueComments: (args: { key: string; siteId?: string }) => Promise<JiraComment[]>
|
|
listProjects: (args?: { siteId?: JiraSiteSelection }) => Promise<JiraProject[]>
|
|
listIssueTypes: (args: { projectIdOrKey: string; siteId?: string }) => Promise<JiraIssueType[]>
|
|
listCreateFields: (args: {
|
|
projectIdOrKey: string
|
|
issueTypeId: string
|
|
siteId?: string
|
|
}) => Promise<JiraCreateField[]>
|
|
listPriorities: (args?: { siteId?: string }) => Promise<JiraPriority[]>
|
|
listAssignableUsers: (args: {
|
|
key: string
|
|
query?: string
|
|
siteId?: string
|
|
}) => Promise<JiraUser[]>
|
|
searchUsers: (args: JiraUserSearchArgs) => Promise<JiraUserSearchResult>
|
|
listTransitions: (args: { key: string; siteId?: string }) => Promise<JiraTransition[]>
|
|
getProjectStatusOrder: (args: {
|
|
projectKey: string
|
|
siteId?: string
|
|
}) => Promise<JiraProjectStatusOrder>
|
|
}
|