MCPcopy Create free account
hub / github.com/simstudioai/sim / buildProjectClause

Function buildProjectClause

apps/sim/connectors/jira/jira.ts:18–25  ·  view source on GitHub ↗

* Builds a JQL clause restricting issues to the given project keys. * Single key uses `project = "X"`; multiple keys use `project in ("X","Y")`. * Each key is escaped for inclusion in a JQL double-quoted string.

(projectKeys: string[])

Source from the content-addressed store, hash-verified

16 * Each key is escaped for inclusion in a JQL double-quoted string.
17 */
18function buildProjectClause(projectKeys: string[]): string {
19 const escapeKey = (key: string) => key.replace(/\\/g, '\\\\').replace(/"/g, '\\"')
20 if (projectKeys.length === 1) {
21 return `project = "${escapeKey(projectKeys[0])}"`
22 }
23 const list = projectKeys.map((k) => `"${escapeKey(k)}"`).join(',')
24 return `project in (${list})`
25}
26
27/**
28 * Builds a plain-text representation of a Jira issue for knowledge base indexing.

Callers 1

jira.tsFile · 0.85

Calls 2

escapeKeyFunction · 0.85
joinMethod · 0.80

Tested by

no test coverage detected