MCPcopy Index your code
hub / github.com/simstudioai/sim / buildIssueContent

Function buildIssueContent

apps/sim/connectors/jira/jira.ts:30–48  ·  view source on GitHub ↗

* Builds a plain-text representation of a Jira issue for knowledge base indexing.

(fields: Record<string, unknown>)

Source from the content-addressed store, hash-verified

28 * Builds a plain-text representation of a Jira issue for knowledge base indexing.
29 */
30function 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

Callers 1

issueToFullDocumentFunction · 0.70

Calls 3

extractAdfTextFunction · 0.90
joinMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected