Skip to content

Commit c55102b

Browse files
committed
RHIDP-10933: [Doc] ServiceNow plugin: Allow integration without changing ServiceNow infrastructure
1 parent 0b1d4be commit c55102b

5 files changed

Lines changed: 184 additions & 0 deletions

assemblies/extend_configuring-dynamic-plugins/assembly-servicenow-custom-actions-in-rhdh.adoc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@ The custom actions in {product-short} help you automate the management of record
1515

1616
The `ServiceNow` custom actions plugin is community-sourced.
1717

18+
19+
include::../modules/shared/con-servicenow-entity-linking-methods.adoc[leveloffset=+1]
20+
21+
include::../modules/shared/proc-configure-servicenow-custom-mapping.adoc[leveloffset=+2]
22+
23+
include::../modules/shared/proc-using-servicenow-scaffolder-actions.adoc[leveloffset=+2]
24+
25+
include::../modules/shared/ref-servicenow-configuration-parameters.adoc[leveloffset=+2]
26+
1827
include::../modules/shared/proc-enable-servicenow-custom-actions-plugin-in-rhdh.adoc[leveloffset=+1]
1928

2029
include::../modules/shared/ref-supported-servicenow-custom-actions-in-rhdh.adoc[leveloffset=+1]
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
:_mod-docs-content-type: CONCEPT
2+
[id="servicenow-entity-linking-methods_{context}"]
3+
= ServiceNow entity linking methods
4+
5+
[role="_abstract"]
6+
7+
To view and manage ServiceNow incidents directly in {product} ({product-very-short}), you must link an entity to your ServiceNow records. Linking ensures that incident data is accurately synchronized and visible within the relevant component or system.
8+
9+
{product} provides two methods for linking these entities. You can choose the method that best fits your organization's security requirements and your ability to modify the ServiceNow schema.
10+
11+
== Direct mapping (Backstage Entity ID column)
12+
13+
The default method requires adding a custom column named `backstage_entity_id` to your ServiceNow incident table. You then manually or programmatically assign the specific {product-very-short} entity reference (for example, `component:default/my-service`) to this column in ServiceNow.
14+
15+
* **Pros:** Highly secure and precise; ensures data is only exposed to the intended entity.
16+
* **Cons:** Requires a schema change in ServiceNow and manual data entry for each incident.
17+
18+
== Flexible mapping (Custom column mapping)
19+
20+
The flexible mapping approach is an optional, opt-in feature that allows you to use any existing column in your ServiceNow incident table to link to {product-very-short} entities. Instead of creating a new column, you configure the ServiceNow plugin to look at an existing field (such as `short_description`, `cmdb_ci`, or a custom organizational ID) to match the entity.
21+
22+
* **Pros:** Does not require ServiceNow schema changes; faster to implement for organizations with strict ServiceNow governance.
23+
* **Cons:** Requires careful configuration to ensure that the search criteria in the chosen column are unique enough to prevent displaying unrelated incidents.
24+
25+
== Comparison of linking methods
26+
27+
|===
28+
| Feature | Direct Mapping | Flexible Mapping
29+
30+
| **ServiceNow Schema Change** | Required | Not Required
31+
| **Security Level** | High (Strict matching) | Medium (Dependent on column data)
32+
| **Configuration Complexity** | Low (Plugin side) | Medium (Requires YAML mapping)
33+
| **Ideal Use Case** | New ServiceNow instances or high-security environments. | Existing ServiceNow instances where schema changes are restricted.
34+
|===
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
:_mod-docs-content-type: PROCEDURE
2+
[id="configure-servicenow-custom-mapping_{context}"]
3+
= Configure ServiceNow incident mapping using custom columns
4+
5+
[role="_abstract"]
6+
7+
To integrate ServiceNow without modifying your existing schema, you can configure the plugin to map incidents using any ServiceNow column. While the platform uses the `backstage_entity_id `column by default, custom mapping ensures compatibility with your current ServiceNow configuration.
8+
9+
.Prerequisites
10+
* You have installed the ServiceNow plugin 1.0 or later.
11+
* You have administrative access to the {product} configuration.
12+
* You have identified the specific column in your ServiceNow incident table (for example, `short_description` or `cmdb_ci`) that contains values matching your {product-very-short} entity names.
13+
14+
.Procedure
15+
16+
. Open your {product} `app-config.yaml` file.
17+
18+
. Navigate to the `catalog.providers.servicenow` section.
19+
20+
. Add the `mapping` configuration to specify your custom column.
21+
+
22+
[source,yaml]
23+
----
24+
catalog:
25+
providers:
26+
servicenow:
27+
your-instance-name:
28+
baseUrl: ${SERVICENOW_BASE_URL}
29+
# The following lines enable the flexible mapping
30+
entityIdentificationField: "u_your_custom_column"
31+
# Ensure your integration still points to the correct location
32+
schedule:
33+
frequency: { minutes: 30 }
34+
timeout: { minutes: 3 }
35+
----
36+
37+
* `catalog.providers.servicenow.your-instance-name.entityIdentificationField` specifies the actual name of the column you wish to use for entity matching.
38+
39+
. Save the changes to `app-config.yaml`.
40+
41+
. Restart your {product} instance to apply the configuration.
42+
43+
.Verification
44+
45+
. Log in to your {product}.
46+
47+
. Open a Component that has a corresponding entry in your chosen ServiceNow column.
48+
49+
. Select the **ServiceNow** tab.
50+
51+
. Confirm that incidents are displayed correctly without the need for a `backstage_entity_id` column in ServiceNow.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
:_mod-docs-content-type: PROCEDURE
2+
[id="using-servicenow-scaffolder-actions_{context}"]
3+
= Using ServiceNow scaffolder actions in Software Templates
4+
5+
[role="_abstract"]
6+
7+
ServiceNow scaffolder actions enable the automation of ServiceNow operations, such as creating incidents or updating records, directly from Software Templates.
8+
9+
In {product} {product-very-short} 1.9 and later, these actions have been moved to a dedicated `servicenow` workspace to improve integration with the ServiceNow plugin.
10+
11+
.Prerequisites
12+
13+
* You have configured the ServiceNow plugin in your `app-config.yaml` file.
14+
* Your Software template is defined as an allowed entity type, for example `Template`, in the `catalog.rules` section of your `app-config.yaml` file.
15+
* You have the required permissions to create or edit Software Templates in {product-very-short}.
16+
17+
.Procedure
18+
19+
. Open your Software Template YAML file (usually `template.yaml`).
20+
21+
. In the `spec.steps` section, define a ServiceNow action using the `servicenow:` prefix.
22+
+
23+
[source,yaml]
24+
----
25+
spec:
26+
steps:
27+
- id: create-incident
28+
name: Create ServiceNow Incident
29+
action: servicenow:create-incident
30+
input:
31+
instanceName: 'production'
32+
short_description: 'Incident created from RHDH Software Template'
33+
severity: '3'
34+
----
35+
36+
* `spec.steps.action` specifies the automated function within the ServiceNow workspace that {product-very-short} uses to generate a new incident record in your connected ServiceNow instance. If you are migrating a template from an older version, update the action ID to match the new workspace location.
37+
38+
* `spec.steps.input.instanceName` specifies the ServiceNow instance, as defined in your `app-config.yaml` file, that {product-very-short} targets when executing the scaffolder action.
39+
40+
. Save the template file and register it in the {product-very-short} Catalog. If you are registering the template via a Pull Request, ensure you use the {backstage-integration} branch as configured in your `app-config.yaml` file.
41+
42+
. Run the template from the **Create** menu to verify the integration.
43+
44+
.Verification
45+
46+
. After the Scaffolder task completes, navigate to your ServiceNow instance.
47+
48+
. Confirm that the new incident appears with the description provided in the template.
49+
50+
. If you are using flexible mapping, verify that the incident is correctly linked to the new component in the **ServiceNow** tab of the {product-very-short} UI.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
:_mod-docs-content-type: REFERENCE
2+
[id="servicenow-configuration-parameters_{context}"]
3+
= ServiceNow configuration parameters
4+
5+
[role="_abstract"]
6+
7+
The ServiceNow plugin configuration parameters define one or more ServiceNow instances and map incidents to entities in the `app-config.yaml` file.
8+
9+
.ServiceNow configuration parameters
10+
[cols="3,1,1,5", options="header"]
11+
|===
12+
| Parameter | Type | Default | Description
13+
14+
| `baseUrl` | String | N/A | *Required.* The base URL of your ServiceNow instance (for example, `https://instance.service-now.com`).
15+
| `entityIdentificationField` | String | `backstage_entity_id` | The ServiceNow column used to match {product-very-short} entities. Specify a custom column name to use flexible mapping without ServiceNow schema changes.
16+
| `username` | String | N/A | The username for the ServiceNow service account.
17+
| `password` | String | N/A | The password for the ServiceNow service account.
18+
| `schedule.frequency` | Duration | `30m` | The interval at which the plugin synchronizes with ServiceNow.
19+
| `schedule.timeout` | Duration | `3m` | The maximum time allowed for a single synchronization attempt.
20+
|===
21+
22+
== Multi-instance configuration example
23+
24+
You can configure multiple ServiceNow endpoints by providing a unique key for each instance in the `servicenow` configuration block. These keys correspond to the `instanceName` parameter used in Software Templates.
25+
26+
[source,yaml]
27+
----
28+
catalog:
29+
providers:
30+
servicenow:
31+
production: <1>
32+
baseUrl: ${SERVICENOW_PROD_URL}
33+
entityIdentificationField: "u_custom_id"
34+
sandbox: <2>
35+
baseUrl: ${SERVICENOW_SANDBOX_URL}
36+
----
37+
38+
* `catalog.providers.servicenow.production` specifies the ServiceNow instance, as defined in your `app-config.yaml` file, that {product-very-short} targets when executing the scaffolder action.
39+
40+
* `catalog.providers.servicenow.sandbox` specifies an additional ServiceNow instance, such as a sandbox environment, for testing purposes.

0 commit comments

Comments
 (0)