* Builds a plain-text representation of a Jira issue for knowledge base indexing.
(fields: Record<string, unknown>)
| 28 | * Builds a plain-text representation of a Jira issue for knowledge base indexing. |
| 29 | */ |
| 30 | function buildIssueContent(fields: Record<string, unknown>): string { |
| 31 | const parts: string[] = [] |
| 32 | |
| 33 | const summary = fields.summary as string | undefined |
| 34 | if (summary) parts.push(summary) |
| 35 | |
| 36 | const description = extractAdfText(fields.description) |
| 37 | if (description) parts.push(description) |
| 38 | |
| 39 | const comments = fields.comment as { comments?: Array<{ body?: unknown }> } | undefined |
| 40 | if (comments?.comments) { |
| 41 | for (const comment of comments.comments) { |
| 42 | const text = extractAdfText(comment.body) |
| 43 | if (text) parts.push(text) |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | return parts.join('\n\n').trim() |
| 48 | } |
| 49 | |
| 50 | /** |
| 51 | * Extracts common metadata fields from a Jira issue into an ExternalDocument |
no test coverage detected