//#region src/atlassian/jira.d.ts /** * Thin typed wrapper over `acli` for fetching Jira tickets. * * Implemented as raw `acli` invocations rather than the Atlassian REST API * so we inherit the operator's already-authenticated session — no extra * token to manage and no `acli jira auth switch` orchestration in scripts. */ interface JiraTicket { key: string; summary: string; /** ADF description flattened to markdown. Empty string when the ticket has none. */ descriptionMarkdown: string; /** Issue type display name (e.g., "Story", "Bug"). Undefined when missing. */ issueType?: string; /** Status display name (e.g., "Ready for Agent"). Undefined when missing. */ status?: string; /** Assignee display name. Undefined for unassigned tickets. */ assigneeDisplayName?: string; } interface FetchJiraTicketOptions { /** * Atlassian site slug (e.g., `"formfactory"` for `formfactory.atlassian.net`). * Accepts either the bare slug or the full `.atlassian.net` host; the * `.atlassian.net` suffix and surrounding whitespace are stripped. When * provided, `acli` is switched to this site before the fetch — required * for multi-site operators since Jira project keys are only unique per site. * When omitted, the operator's current `acli` site is used as-is. */ site?: string; } /** * Fetch a Jira ticket by key via `acli jira workitem view --json`. * Pass `options.site` to enforce a specific Atlassian site; without it the * call uses whichever site `acli` is currently authenticated to. Concurrent * calls with different `site` values are safely serialized via an internal * lock — `acli`'s site is global per process. */ declare function fetchJiraTicket(ticketKey: string, options?: FetchJiraTicketOptions): Promise; interface JiraTicketSummary { /** Ticket key (e.g. `"ENG-17"`). */ key: string; summary: string; /** Status display name (e.g. `"In Progress"`). Empty string when missing. */ status: string; /** Issue type display name (e.g. `"Story"`). Empty string when missing. */ issueType: string; /** Parent ticket key for sub-tasks; undefined for top-level items. */ parentKey?: string; /** * Canonical browse URL. Populated only when `options.site` is provided * (otherwise we can't compose the host). */ url?: string; } interface SearchJiraTicketsOptions { /** * Atlassian site slug — same semantics as `FetchJiraTicketOptions.site`. * When provided, `acli` is switched to this site before the search and * each returned ticket gets a `url` derived from it. */ site?: string; } /** * Search Jira tickets matching a JQL query via * `acli jira workitem search --jql --fields key,summary,status,issuetype --json`. * * Concurrent calls with different `site` values are serialized via the * same internal lock that `fetchJiraTicket` uses — `acli`'s authenticated * site is process-global. */ declare function searchJiraTickets(jql: string, options?: SearchJiraTicketsOptions): Promise; /** * Read `jira.organization` from `.ff/settings.json` in the current * working directory. This is the Atlassian site slug (e.g., * `"formfactory"` for `formfactory.atlassian.net`) that * {@link fetchJiraTicket} and {@link searchJiraTickets} expect as their * `site` option. * * Returns undefined when the file or the field is absent — single-site * operators can leave it unset and rely on `acli`'s current state. * Throws on permission/IO errors, invalid JSON, non-object root, or a * non-string organization value — those indicate misconfiguration. */ declare function loadJiraSite(): string | undefined; //#endregion export { fetchJiraTicket as a, SearchJiraTicketsOptions as i, JiraTicket as n, loadJiraSite as o, JiraTicketSummary as r, searchJiraTickets as s, FetchJiraTicketOptions as t };