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

Function buildIssueContent

apps/sim/connectors/linear/linear.ts:74–103  ·  view source on GitHub ↗

* Builds a formatted text document from a Linear issue.

(issue: Record<string, unknown>)

Source from the content-addressed store, hash-verified

72 * Builds a formatted text document from a Linear issue.
73 */
74function buildIssueContent(issue: Record<string, unknown>): string {
75 const parts: string[] = []
76
77 const identifier = issue.identifier as string | undefined
78 const title = (issue.title as string) || 'Untitled'
79 parts.push(`${identifier ? `${identifier}: ` : ''}${title}`)
80
81 const state = issue.state as Record<string, unknown> | undefined
82 if (state?.name) parts.push(`Status: ${state.name}`)
83
84 const priority = issue.priorityLabel as string | undefined
85 if (priority) parts.push(`Priority: ${priority}`)
86
87 const assignee = issue.assignee as Record<string, unknown> | undefined
88 if (assignee?.name) parts.push(`Assignee: ${assignee.name}`)
89
90 const labelsConn = issue.labels as Record<string, unknown> | undefined
91 const labelNodes = (labelsConn?.nodes || []) as Record<string, unknown>[]
92 if (labelNodes.length > 0) {
93 parts.push(`Labels: ${labelNodes.map((l) => l.name as string).join(', ')}`)
94 }
95
96 const description = issue.description as string | undefined
97 if (description) {
98 parts.push('')
99 parts.push(markdownToPlainText(description))
100 }
101
102 return parts.join('\n')
103}
104
105const ISSUE_FIELDS = `
106 id

Callers 1

linear.tsFile · 0.70

Calls 3

markdownToPlainTextFunction · 0.85
joinMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected