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

Function buildContent

apps/sim/connectors/jsm/jsm.ts:228–254  ·  view source on GitHub ↗

* Renders a readable plain-text document from a fully-fetched request and its * comments. Includes summary, description, reporter, status, and comment thread.

(request: JsmRequest, comments: JsmComment[])

Source from the content-addressed store, hash-verified

226 * comments. Includes summary, description, reporter, status, and comment thread.
227 */
228function buildContent(request: JsmRequest, comments: JsmComment[]): string {
229 const parts: string[] = []
230
231 const summary = getFieldText(request, 'summary')
232 if (summary) parts.push(summary)
233
234 const description = getFieldText(request, 'description')
235 if (description) parts.push(description)
236
237 const status = request.currentStatus?.status
238 if (status) parts.push(`Status: ${status}`)
239
240 const reporter = request.reporter?.displayName
241 if (reporter) parts.push(`Reporter: ${reporter}`)
242
243 if (comments.length > 0) {
244 parts.push('Comments:')
245 for (const comment of comments) {
246 const body = (comment.body ?? '').trim()
247 if (!body) continue
248 const author = comment.author?.displayName
249 parts.push(author ? `${author}: ${body}` : body)
250 }
251 }
252
253 return parts.join('\n\n').trim()
254}
255
256/**
257 * Resolves and caches the Jira cloud ID for a domain across a sync run.

Callers 1

jsm.tsFile · 0.70

Calls 3

getFieldTextFunction · 0.85
joinMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected