* Maps user-provided accountId to the Jira API value. * Empty string, "null", "none", or "unassigned" → null (unassign). * "-1" → "-1" (auto-assign). Otherwise the trimmed accountId.
(value: string | null | undefined)
| 9 | * "-1" → "-1" (auto-assign). Otherwise the trimmed accountId. |
| 10 | */ |
| 11 | function resolveAssigneeAccountId(value: string | null | undefined): string | null { |
| 12 | if (value === null || value === undefined) return null |
| 13 | const trimmed = String(value).trim() |
| 14 | if (trimmed === '') return null |
| 15 | const lower = trimmed.toLowerCase() |
| 16 | if (lower === 'null' || lower === 'none' || lower === 'unassigned') return null |
| 17 | return trimmed |
| 18 | } |
| 19 | |
| 20 | export const jiraAssignIssueTool: ToolConfig<JiraAssignIssueParams, JiraAssignIssueResponse> = { |
| 21 | id: 'jira_assign_issue', |