/** * JIRA Status Sync * * Synchronizes SpecWeave increment statuses with JIRA issue statuses. * * JIRA Status Transitions: * - Uses JIRA transitions API to change issue status * - Available transitions depend on workflow configuration * - Must fetch available transitions before applying * * @module jira-status-sync */ import { CircuitBreakerRegistry } from '../../../../../src/core/sync/circuit-breaker-registry.js'; import { SyncRetryQueue } from '../../../../../src/core/sync/sync-retry-queue.js'; /** * External status representation (JIRA-specific) */ export interface ExternalStatus { state: string; labels?: string[]; } export interface JiraStatusSyncOptions { circuitBreakerRegistry?: CircuitBreakerRegistry; retryQueue?: SyncRetryQueue; incrementId?: string; featureId?: string; projectPath?: string; projectName?: string; lockDir?: string; } /** * JIRA Status Sync * * Handles status synchronization with JIRA issues. */ export declare class JiraStatusSync { private client; private domain; private projectKey; private circuitBreakerRegistry?; private retryQueue?; private lockManager?; private incrementId; private featureId; private projectPath; private projectName; constructor(domain: string, email: string, apiToken: string, projectKey: string, options?: JiraStatusSyncOptions); /** * Execute fn under file lock (if lockManager configured). */ private withLock; /** * Check circuit breaker before making API calls. * Throws if breaker is open. */ private checkCircuitBreaker; /** * Record success on circuit breaker. */ private recordSuccess; /** * Handle API error: record failure on circuit breaker, enqueue retry, throw SyncError. */ private handleApiError; /** * Initialize: detect deployment type and update client baseURL */ init(): Promise; /** * Get current status from JIRA issue * * @param issueKey - JIRA issue key (e.g., PROJ-123) * @returns Current issue status */ getStatus(issueKey: string): Promise; /** * Update JIRA issue status via transitions * * JIRA requires using transitions to change status. * Cannot directly set status field. * * Handles missing transitions gracefully by logging a warning * instead of throwing an error. * * @param issueKey - JIRA issue key (e.g., PROJ-123) * @param status - Desired status * @returns true if transition succeeded, false if not available */ updateStatus(issueKey: string, status: ExternalStatus): Promise; /** * Post comment about status change to JIRA issue * * @param issueKey - JIRA issue key (e.g., PROJ-123) * @param oldStatus - Previous SpecWeave status * @param newStatus - New SpecWeave status */ postStatusComment(issueKey: string, oldStatus: string, newStatus: string): Promise; /** * Post AC progress comment with proper ADF formatting and dedup. * * Builds native ADF with: * - Bold header showing completion percentage * - Bullet list with checkmark/cross emojis per AC * - Fingerprint marker to prevent duplicate comments * * @param issueKey - JIRA issue key (e.g., PROJ-123) * @param acStates - Array of AC states with id, description, completed * @returns true if comment was posted, false if skipped (duplicate) */ postProgressComment(issueKey: string, acStates: Array<{ id: string; description: string; completed: boolean; }>): Promise; } //# sourceMappingURL=jira-status-sync.d.ts.map