You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(servicenow): stop constant interpolation leaking into tool descriptions
The docs generator and the client-facing integration catalog read tool
descriptions from source rather than from the evaluated module, so a
template literal like `state ${INCIDENT_STATE.RESOLVED}` shipped to users
verbatim: `apps/sim/lib/integrations/integrations.json` and the published
ServiceNow integration page both rendered `${INCIDENT_STATE.RESOLVED}`
instead of `6`. Inline the base-system coded values in the description
text; the constants stay in use everywhere behavior depends on them.
Also drops an escaped `\'` in the `inputDisplayValue` description for the
same reason, and adds a standing guard test asserting no subBlock id
carries two different seeded defaults — the invariant behind the
per-operation defaulting bug, now checked structurally rather than only
through the four per-operation cases.
Copy file name to clipboardExpand all lines: apps/docs/content/docs/en/integrations/servicenow.mdx
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -239,7 +239,7 @@ Create an incident in ServiceNow. Reference fields (caller, assignment group, as
239
239
|`impact`| string | No | Impact: 1 \(High\), 2 \(Medium\), or 3 \(Low\). |
240
240
|`urgency`| string | No | Urgency: 1 \(High\), 2 \(Medium\), or 3 \(Low\). |
241
241
|`priority`| string | No | Priority 1-5 \(1 Critical … 5 Planning\). Normally derived from impact and urgency, so prefer setting those. |
242
-
|`state`| string | No | Incident state coded value. Base system: $\{INCIDENT_STATE.NEW\}=New, $\{INCIDENT_STATE.IN_PROGRESS\}=In Progress, $\{INCIDENT_STATE.ON_HOLD\}=On Hold, $\{INCIDENT_STATE.RESOLVED\}=Resolved, $\{INCIDENT_STATE.CLOSED\}=Closed, $\{INCIDENT_STATE.CANCELED\}=Canceled. Defaults to New. |
242
+
|`state`| string | No | Incident state coded value. Base system: 1=New, 2=In Progress, 3=On Hold, 6=Resolved, 7=Closed, 8=Canceled. Defaults to New. |
243
243
|`assignmentGroup`| string | No | Assignment group \(assignment_group\) — sys_id of the sys_user_group. |
244
244
|`assignedTo`| string | No | Assigned to \(assigned_to\) — sys_id of the sys_user. |
245
245
|`cmdbCi`| string | No | Configuration item \(cmdb_ci\) — sys_id of the affected CI. |
@@ -330,7 +330,7 @@ Search ServiceNow incidents by state, priority, assignment, caller, or text. All
330
330
| Parameter | Type | Required | Description |
331
331
| --------- | ---- | -------- | ----------- |
332
332
|`searchText`| string | No | Text to match against the incident short description using the ServiceNow LIKE operator, which matches anywhere in the field. |
333
-
|`state`| string | No | Incident state coded value. Base system: $\{INCIDENT_STATE.NEW\}=New, $\{INCIDENT_STATE.IN_PROGRESS\}=In Progress, $\{INCIDENT_STATE.ON_HOLD\}=On Hold, $\{INCIDENT_STATE.RESOLVED\}=Resolved, $\{INCIDENT_STATE.CLOSED\}=Closed, $\{INCIDENT_STATE.CANCELED\}=Canceled. |
333
+
|`state`| string | No | Incident state coded value. Base system: 1=New, 2=In Progress, 3=On Hold, 6=Resolved, 7=Closed, 8=Canceled. |
334
334
|`priority`| string | No | Priority coded value 1-5 \(1 Critical … 5 Planning\). |
335
335
|`assignmentGroup`| string | No | sys_id of the assignment group. |
336
336
|`assignedTo`| string | No | sys_id of the assigned user. |
@@ -379,7 +379,7 @@ Update fields on an existing ServiceNow incident. Only the fields you supply are
379
379
| --------- | ---- | -------- | ----------- |
380
380
|`shortDescription`| string | No | New short description. |
381
381
|`description`| string | No | New detailed description. |
382
-
|`state`| string | No | Incident state coded value. Base system: $\{INCIDENT_STATE.NEW\}=New, $\{INCIDENT_STATE.IN_PROGRESS\}=In Progress, $\{INCIDENT_STATE.ON_HOLD\}=On Hold, $\{INCIDENT_STATE.RESOLVED\}=Resolved, $\{INCIDENT_STATE.CLOSED\}=Closed, $\{INCIDENT_STATE.CANCELED\}=Canceled. Use Resolve or Close ServiceNow Incident for those transitions so the resolution fields are populated. |
382
+
|`state`| string | No | Incident state coded value. Base system: 1=New, 2=In Progress, 3=On Hold, 6=Resolved, 7=Closed, 8=Canceled. Use Resolve or Close ServiceNow Incident for those transitions so the resolution fields are populated. |
383
383
|`impact`| string | No | Impact: 1 \(High\), 2 \(Medium\), or 3 \(Low\). |
384
384
|`urgency`| string | No | Urgency: 1 \(High\), 2 \(Medium\), or 3 \(Low\). |
385
385
|`priority`| string | No | Priority coded value 1-5 \(1 Critical … 5 Planning\). |
@@ -425,7 +425,7 @@ Update fields on an existing ServiceNow incident. Only the fields you supply are
425
425
426
426
### Resolve ServiceNow Incident
427
427
428
-
Move a ServiceNow incident to Resolved (state $\{INCIDENT_STATE.RESOLVED\}) with a resolution code and resolution notes.
428
+
Move a ServiceNow incident to Resolved (state 6) with a resolution code and resolution notes.
429
429
430
430
#### Input
431
431
@@ -469,7 +469,7 @@ Move a ServiceNow incident to Resolved (state $\{INCIDENT_STATE.RESOLVED\}) with
469
469
470
470
### Close ServiceNow Incident
471
471
472
-
Move a ServiceNow incident to Closed (state $\{INCIDENT_STATE.CLOSED\}) with a resolution code and resolution notes. Closing normally requires the itil_admin or admin role.
472
+
Move a ServiceNow incident to Closed (state 7) with a resolution code and resolution notes. Closing normally requires the itil_admin or admin role.
473
473
474
474
#### Input
475
475
@@ -662,7 +662,7 @@ Search ServiceNow change requests by state, type, risk, assignment, or text. All
662
662
| Parameter | Type | Required | Description |
663
663
| --------- | ---- | -------- | ----------- |
664
664
|`searchText`| string | No | Text to match against the change short description using the ServiceNow LIKE operator, which matches anywhere in the field. |
665
-
|`state`| string | No | Change state coded value. Base system: $\{CHANGE_STATE.NEW\}=New, $\{CHANGE_STATE.ASSESS\}=Assess, $\{CHANGE_STATE.AUTHORIZE\}=Authorize, $\{CHANGE_STATE.SCHEDULED\}=Scheduled, $\{CHANGE_STATE.IMPLEMENT\}=Implement, $\{CHANGE_STATE.REVIEW\}=Review, $\{CHANGE_STATE.CLOSED\}=Closed, $\{CHANGE_STATE.CANCELED\}=Canceled. |
665
+
|`state`| string | No | Change state coded value. Base system: -5=New, -4=Assess, -3=Authorize, -2=Scheduled, -1=Implement, 0=Review, 3=Closed, 4=Canceled. |
666
666
|`type`| string | No | Change type: "normal", "standard", or "emergency". |
667
667
|`risk`| string | No | Risk coded value. The choice list is configured per instance. |
668
668
|`assignmentGroup`| string | No | sys_id of the assignment group. |
@@ -711,7 +711,7 @@ Update fields on an existing ServiceNow change request. Only the fields you supp
711
711
| --------- | ---- | -------- | ----------- |
712
712
|`shortDescription`| string | No | New short description. |
713
713
|`description`| string | No | New detailed description. |
714
-
|`state`| string | No | Change state coded value. Base system: $\{CHANGE_STATE.NEW\}=New, $\{CHANGE_STATE.ASSESS\}=Assess, $\{CHANGE_STATE.AUTHORIZE\}=Authorize, $\{CHANGE_STATE.SCHEDULED\}=Scheduled, $\{CHANGE_STATE.IMPLEMENT\}=Implement, $\{CHANGE_STATE.REVIEW\}=Review, $\{CHANGE_STATE.CLOSED\}=Closed, $\{CHANGE_STATE.CANCELED\}=Canceled. |
714
+
|`state`| string | No | Change state coded value. Base system: -5=New, -4=Assess, -3=Authorize, -2=Scheduled, -1=Implement, 0=Review, 3=Closed, 4=Canceled. |
715
715
|`risk`| string | No | Risk coded value. The choice list is configured per instance. |
716
716
|`impact`| string | No | Impact: 1 \(High\), 2 \(Medium\), or 3 \(Low\). |
717
717
|`priority`| string | No | Priority coded value 1-5 \(1 Critical … 5 Planning\). |
@@ -757,14 +757,14 @@ Update fields on an existing ServiceNow change request. Only the fields you supp
757
757
758
758
### Move ServiceNow Change State
759
759
760
-
Move a ServiceNow change request to another state. Base-system change model states are $\{CHANGE_STATE.NEW\}=New, $\{CHANGE_STATE.ASSESS\}=Assess, $\{CHANGE_STATE.AUTHORIZE\}=Authorize, $\{CHANGE_STATE.SCHEDULED\}=Scheduled, $\{CHANGE_STATE.IMPLEMENT\}=Implement, $\{CHANGE_STATE.REVIEW\}=Review, $\{CHANGE_STATE.CLOSED\}=Closed, $\{CHANGE_STATE.CANCELED\}=Canceled. The state machine rejects transitions whose conditions are not met.
760
+
Move a ServiceNow change request to another state. Base-system change model states are -5=New, -4=Assess, -3=Authorize, -2=Scheduled, -1=Implement, 0=Review, 3=Closed, 4=Canceled. The state machine rejects transitions whose conditions are not met.
761
761
762
762
#### Input
763
763
764
764
| Parameter | Type | Required | Description |
765
765
| --------- | ---- | -------- | ----------- |
766
-
|`state`| string | Yes | Target state coded value: $\{CHANGE_STATE.NEW\}\(New\), $\{CHANGE_STATE.ASSESS\}\(Assess\), $\{CHANGE_STATE.AUTHORIZE\}\(Authorize\), $\{CHANGE_STATE.SCHEDULED\}\(Scheduled\), $\{CHANGE_STATE.IMPLEMENT\}\(Implement\), $\{CHANGE_STATE.REVIEW\}\(Review\), $\{CHANGE_STATE.CLOSED\}\(Closed\), or $\{CHANGE_STATE.CANCELED\}\(Canceled\). |
767
-
|`closeCode`| string | No | Close code, required when moving to Closed \($\{CHANGE_STATE.CLOSED\}\): "successful", "successful_issues", or "unsuccessful". |
766
+
|`state`| string | Yes | Target state coded value: -5\(New\), -4\(Assess\), -3\(Authorize\), -2\(Scheduled\), -1\(Implement\), 0\(Review\), 3\(Closed\), or 4\(Canceled\). |
767
+
|`closeCode`| string | No | Close code, required when moving to Closed \(3\): "successful", "successful_issues", or "unsuccessful". |
768
768
|`closeNotes`| string | No | Close notes describing the outcome of the change. |
769
769
|`workNotes`| string | No | Internal work note explaining the transition. |
770
770
@@ -995,14 +995,14 @@ Retrieve a single ServiceNow requested item (RITM) by number (e.g., RITM0010001)
995
995
996
996
### List ServiceNow Approvals
997
997
998
-
List approval records from the ServiceNow Approval [sysapproval_approver] table. Defaults to the "$\{APPROVAL_STATE.REQUESTED\}" state, which is what a user's pending approvals look like.
998
+
List approval records from the ServiceNow Approval [sysapproval_approver] table. Defaults to the "requested" state, which is what a user's pending approvals look like.
999
999
1000
1000
#### Input
1001
1001
1002
1002
| Parameter | Type | Required | Description |
1003
1003
| --------- | ---- | -------- | ----------- |
1004
1004
|`approverSysId`| string | No | sys_id of the approver \(sys_user\) whose approvals should be listed. Use Find ServiceNow User to resolve an email address to a sys_id. |
1005
-
|`state`| string | No | Approval state: "$\{APPROVAL_STATE.REQUESTED\}" \(pending, the default\), "$\{APPROVAL_STATE.APPROVED\}", or "$\{APPROVAL_STATE.REJECTED\}". Pass an empty string with a custom query to list every state. |
1005
+
|`state`| string | No | Approval state: "requested" \(pending, the default\), "approved", or "rejected". Pass an empty string with a custom query to list every state. |
1006
1006
|`approvalFor`| string | No | sys_id of the record being approved, matched against the sysapproval reference field. |
1007
1007
1008
1008
#### Output
@@ -1046,7 +1046,7 @@ Approve or reject a ServiceNow approval record by setting its state on the Appro
1046
1046
| Parameter | Type | Required | Description |
1047
1047
| --------- | ---- | -------- | ----------- |
1048
1048
|`approvalSysId`| string | Yes | sys_id of the approval record on the sysapproval_approver table. Use List ServiceNow Approvals to find it. |
1049
-
|`decision`| string | Yes | Decision to record: "$\{APPROVAL_STATE.APPROVED\}" or "$\{APPROVAL_STATE.REJECTED\}". |
1049
+
|`decision`| string | Yes | Decision to record: "approved" or "rejected". |
1050
1050
|`comments`| string | No | Comment to record alongside the decision. This is a journal field. |
Copy file name to clipboardExpand all lines: apps/sim/lib/integrations/integrations.json
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -17984,11 +17984,11 @@
17984
17984
},
17985
17985
{
17986
17986
"name": "Resolve Incident",
17987
-
"description": "Move a ServiceNow incident to Resolved (state ${INCIDENT_STATE.RESOLVED}) with a resolution code and resolution notes."
17987
+
"description": "Move a ServiceNow incident to Resolved (state 6) with a resolution code and resolution notes."
17988
17988
},
17989
17989
{
17990
17990
"name": "Close Incident",
17991
-
"description": "Move a ServiceNow incident to Closed (state ${INCIDENT_STATE.CLOSED}) with a resolution code and resolution notes. Closing normally requires the itil_admin or admin role."
17991
+
"description": "Move a ServiceNow incident to Closed (state 7) with a resolution code and resolution notes. Closing normally requires the itil_admin or admin role."
17992
17992
},
17993
17993
{
17994
17994
"name": "Add Incident Comment",
@@ -18012,7 +18012,7 @@
18012
18012
},
18013
18013
{
18014
18014
"name": "Move Change State",
18015
-
"description": "Move a ServiceNow change request to another state. Base-system change model states are ${CHANGE_STATE.NEW}=New, ${CHANGE_STATE.ASSESS}=Assess, ${CHANGE_STATE.AUTHORIZE}=Authorize, ${CHANGE_STATE.SCHEDULED}=Scheduled, ${CHANGE_STATE.IMPLEMENT}=Implement, ${CHANGE_STATE.REVIEW}=Review, ${CHANGE_STATE.CLOSED}=Closed, ${CHANGE_STATE.CANCELED}=Canceled. The state machine rejects transitions whose conditions are not met."
18015
+
"description": "Move a ServiceNow change request to another state. Base-system change model states are -5=New, -4=Assess, -3=Authorize, -2=Scheduled, -1=Implement, 0=Review, 3=Closed, 4=Canceled. The state machine rejects transitions whose conditions are not met."
18016
18016
},
18017
18017
{
18018
18018
"name": "List Change Tasks",
@@ -18040,7 +18040,7 @@
18040
18040
},
18041
18041
{
18042
18042
"name": "List Approvals",
18043
-
"description": "List approval records from the ServiceNow Approval [sysapproval_approver] table. Defaults to the \"${APPROVAL_STATE.REQUESTED}\" state, which is what a user's pending approvals look like."
18043
+
"description": "List approval records from the ServiceNow Approval [sysapproval_approver] table. Defaults to the \"requested\" state, which is what a user's pending approvals look like."
description: `Move a ServiceNow incident to Closed (state ${INCIDENT_STATE.CLOSED}) with a resolution code and resolution notes. Closing normally requires the itil_admin or admin role.`,
27
+
description:
28
+
'Move a ServiceNow incident to Closed (state 7) with a resolution code and resolution notes. Closing normally requires the itil_admin or admin role.',
description: `List approval records from the ServiceNow Approval [sysapproval_approver] table. Defaults to the "${APPROVAL_STATE.REQUESTED}" state, which is what a user's pending approvals look like.`,
27
+
description: `List approval records from the ServiceNow Approval [sysapproval_approver] table. Defaults to the "requested" state, which is what a user's pending approvals look like.`,
description: `Approval state: "${APPROVAL_STATE.REQUESTED}" (pending, the default), "${APPROVAL_STATE.APPROVED}", or "${APPROVAL_STATE.REJECTED}". Pass an empty string with a custom query to list every state.`,
43
+
description:
44
+
'Approval state: "requested" (pending, the default), "approved", or "rejected". Pass an empty string with a custom query to list every state.',
'Set to true to write display names into reference fields (e.g., assigned_to: "Beth Anglin") and let ServiceNow resolve them to sys_ids. Defaults to false, meaning reference fields must be sys_ids. Note that true also reinterprets date and time values in the requesting user\'s timezone rather than GMT.',
86
+
description: `Set to true to write display names into reference fields (e.g., assigned_to: "Beth Anglin") and let ServiceNow resolve them to sys_ids. Defaults to false, meaning reference fields must be sys_ids. Note that true also reinterprets date and time values in the requesting user's timezone rather than GMT.`,
0 commit comments