feat: Add ServiceNow integration#3113
Conversation
a3e11f7 to
0bd93db
Compare
web_src/src/pages/workflowv2/mappers/servicenow/on_incident.tsx
Outdated
Show resolved
Hide resolved
web_src/src/pages/workflowv2/mappers/servicenow/on_incident.tsx
Outdated
Show resolved
Hide resolved
7de6912 to
80180ee
Compare
80180ee to
a80027a
Compare
a80027a to
e9820b8
Compare
e9820b8 to
1b39aa7
Compare
Signed-off-by: ConeDjordjic <turbo.topcone@gmail.com>
1b39aa7 to
9ee52ab
Compare
|
@ConeDjordjic quick summary of what we discussed:
|
da6a17b to
30ea193
Compare
web_src/src/pages/workflowv2/mappers/servicenow/get_incidents.ts
Outdated
Show resolved
Hide resolved
30ea193 to
0a59ab3
Compare
0a59ab3 to
4332370
Compare
- Remove OnIncident webhook trigger (required manual Business Rule setup) - Remove Basic Auth support (OAuth only) - Add GetIncidents action component with clear/low/high output channels - Fix on_hold_reason IDs (was skipping 2): Awaiting Caller=1, Awaiting Change=2, Awaiting Problem=3, Awaiting Vendor=4 - Remove unused GetIncident client method Signed-off-by: ConeDjordjic <turbo.topcone@gmail.com>
4332370 to
35870e4
Compare
# Conflicts: # web_src/src/ui/BuildingBlocksSidebar/index.tsx # web_src/src/ui/componentSidebar/integrationIcons.tsx
web_src/src/pages/workflowv2/mappers/servicenow/get_incidents.ts
Outdated
Show resolved
Hide resolved
dd83618 to
69d5d21
Compare
Signed-off-by: ConeDjordjic <turbo.topcone@gmail.com>
69d5d21 to
d0b2f32
Compare
web_src/src/pages/workflowv2/mappers/servicenow/get_incidents.ts
Outdated
Show resolved
Hide resolved
|
@ConeDjordjic, I think @AleksandarCole mentioned to create a getIncident instead of a getIncidents (plural) component. |
cc345b0 to
c361b57
Compare
2f7aeec to
226c5ea
Compare
web_src/src/pages/workflowv2/mappers/servicenow/get_incident.ts
Outdated
Show resolved
Hide resolved
226c5ea to
3940004
Compare
3940004 to
97cda5e
Compare
Signed-off-by: ConeDjordjic <turbo.topcone@gmail.com>
97cda5e to
9ab1a43
Compare
Signed-off-by: Pedro F. Leao <pedroforestileao@gmail.com>
|
@ConeDjordjic I udpated the docs myself. Service now asks to add some strange permissions |
Signed-off-by: Pedro F. Leao <pedroforestileao@gmail.com>
|
The PR is merged. @ConeDjordjic Thanks a lot for your contribution <3 cc: @AleksandarCole |
|
My bad, forgot to update the docs. The admin role part is a remnant from an earlier implementation that required it for automatic business rule creation for on_incident. It's not needed at the moment but the service itself is very limiting in terms of permissions. If at some point in the future we want to implement on_incident again without a bunch of manual steps, admin permissions will be required. For the current implementation only itil is required. The glide.oauth.inbound.client.credential.grant_type.enabled property needs to be enabled because ServiceNow disables the client credentials grant type by default. Without it, the OAuth token request will fail. Sorry I forgot to cover that in the video demo. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| return nil, fmt.Errorf("error parsing response: %w", err) | ||
| } | ||
| return &response.Result, nil | ||
| } |
There was a problem hiding this comment.
GetIncident sys_id path not escaped
Medium Severity
GetIncident interpolates sysID directly into the request path. If a crafted value containing reserved URL characters is ever passed (e.g. via API manipulation or corrupted config), it can alter the request path/query and fetch unintended resources or fail unexpectedly.
| eventState: getState(componentName)(execution), | ||
| eventId: execution.rootEvent!.id!, | ||
| }, | ||
| ]; |
There was a problem hiding this comment.
Implements superplanehq#3006 Addresses review feedback from @AleksandarCole: - Removed the OnIncident trigger (required complex manual Business Rule setup in ServiceNow) - Removed Basic Auth, OAuth only - Added GetIncidents action component as a replacement GetIncidents made the most sense over other options like create change request, query CMDB items, or manage service catalog requests. Those are more one-off actions. GetIncidents is more useful as a recurring check that can actually branch the workflow based on what's going on. ## Summary Adds the ServiceNow integration with: - **Create Incident** action: creates incidents via the Table API - **Get Incidents** action: queries incidents with filters and routes based on urgency Authentication is OAuth only. Categories, subcategories, assignment groups, and users are loaded from the ServiceNow API. Selecting a group filters the user list. Selecting a category filters the subcategory list. ## Output Channels (Get Incidents) - **Clear**: no incidents matched the filters - **Low**: incidents found, but none are high urgency - **High**: at least one high-urgency incident found ## Video Demo (updated) https://www.youtube.com/watch?v=DXuqBVpNBtk ## Implementation ### Backend (`pkg/integrations/servicenow/`) - `servicenow.go`: integration config and OAuth auth - `create_incident.go`: create incident action - `get_incidents.go`: query incidents with filters - `client.go`: ServiceNow Table API client - `list_resources.go`: loads categories, subcategories, groups, and users ### Frontend (`web_src/src/pages/workflowv2/mappers/servicenow/`) - Action mapper for Create Incident - Action mapper for Get Incidents with urgency-based state coloring --------- Signed-off-by: ConeDjordjic <turbo.topcone@gmail.com> Signed-off-by: Pedro F. Leao <pedroforestileao@gmail.com> Co-authored-by: Pedro F. Leao <pedroforestileao@gmail.com>



Implements #3006
Addresses review feedback from @AleksandarCole:
GetIncidents made the most sense over other options like create change request,
query CMDB items, or manage service catalog requests. Those are more one-off
actions. GetIncidents is more useful as a recurring check that can actually
branch the workflow based on what's going on.
Summary
Adds the ServiceNow integration with:
Authentication is OAuth only. Categories, subcategories, assignment groups,
and users are loaded from the ServiceNow API. Selecting a group filters the
user list. Selecting a category filters the subcategory list.
Output Channels (Get Incidents)
Video Demo (updated)
https://www.youtube.com/watch?v=DXuqBVpNBtk
Implementation
Backend (
pkg/integrations/servicenow/)servicenow.go: integration config and OAuth authcreate_incident.go: create incident actionget_incidents.go: query incidents with filtersclient.go: ServiceNow Table API clientlist_resources.go: loads categories, subcategories, groups, and usersFrontend (
web_src/src/pages/workflowv2/mappers/servicenow/)