Summary
The ServiceNow plug-in provides for integration with a ServiceNow server. This plug-in imports incident management (Beta), change management and problem management data from a ServiceNow server and provides a single view of ServiceNow incidents, change requests, and problems in an HCL DevOps Velocity value stream map. Data between the ServiceNow server and the HCL DevOps Velocity server is synchronized every five minutes.
The plug-in can also be used to automate several ServiceNow tasks, such as create and update a ServiceNow request.
Compatibility
The plug-in supports the ServiceNow Madrid, Orlando, Paris and Washington release.
Usage
To install the plug-in, perform the following steps:
- In HCL DevOps Velocity, click Settings > Integrations > Available.
- In the Action column for the ServiceNow plug-in, click Install.
There are two methods to integrate the plug-in:
- Using the user interface
- Using a JSON file
Integrating the plug-in by using user interface
To integrate the plug-in using the user interface, perform the following steps:
- In HCL DevOps Velocity, click Settings > Integrations > Installed.
- In the Action column for the ServiceNow plug-in, click Add Integration.
- On the Add Integration dialog, enter the values for the fields to configure the integration and define communication.
- Click Add.
Integrating the plug-in by using JSON file
The JSON file contains the information for creating a value stream. Within the JSON file is a section for integrations. It is in this section that plugin properties can be defined. Refer to the sample JSON code.
To integrate the plug-in using a JSON, perform the following steps:
- Navigate to value stream page, and then click the necessary value stream.
- Click icon, and then Select Edit value stream to modify the JSON file in the code or tree view editors.
- Alternatively, you can also click Download JSON option to download the JSON file, and then select the Import JSON option to upload the revised JSON file.
- Edit the integration information in the JSON file to add the plug-in configuration properties. Refer to JSON sample code in the Configuration Properties section more details.
- Click Save.
Integration type
The ServiceNow plug-in supports scheduled events integration which are listed in the following table.
Scheduled events
snowAllResources |
Queries the ServiceNow repository for Incidents, Change request, Problems, ServiceNowWaitChangeTask, ServiceNowWaitRequests |
Configuration Properties
The following tables describe the properties used to configure the integration. Each table contains the field name when using the user interface and the property name when using a JSON file.
- The General Configuration Properties table describes configuration properties used by all plug-in integrations.
- The ServiceNow Configuration Properties table describes the ServiceNow configuration properties that define the connection and communications with the ServiceNow server. When using the JSON method to integrate the plug-in these properties are coded within the
properties
configuration property.
Some properties might not be displayed in the user interface, to see all properties enable the Show Hidden Properties field.
General Configuration properties
Name |
Description |
Required |
Property Name |
NA |
The version of the plug-in that you want to use. To view available versions, click the Version History tab. If a value is not specified, the latest version is used. |
No |
image |
Integration Name |
An assigned name to the value stream. |
Yes |
name |
Logging Level |
The level of Log4j messages to display in the log file. Valid values are: all, debug, info, warn, error, fatal, off, and trace. |
No |
loggingLevel |
NA |
List of configuration properties used to connect and communicate with ServiceNow server. Enclose the properties within braces. |
Yes |
properties |
|
The name of the tenant. |
Yes |
tenant_id |
NA |
Unique identifier assigned to the plug-in. The value for the ServiceNow Server plug-in is ucv-ext-servicenow |
Yes |
type |
ServiceNow Properties
Name |
Type |
Description |
Required |
Property Name |
Access Token |
Secure |
The access token used to authenticate with the ServiceNow server. You can use either this property or the Password property for authentication.
Note: When using OAuth 2.0, the Access Token will be ignored. |
No |
accessToken |
Password |
Secure |
The password used to authenticate with the ServiceNow server. |
No |
password |
HCL DevOps Velocity User Access Key |
Secure |
The user access key to authenticate with the HCL DevOps Velocity server. |
Yes |
ucvAccessKey |
URL |
String |
The URL of the ServiceNow server. |
Yes |
baseUrl |
User Name |
String |
The username used to authenticate with the ServiceNow server. |
No |
username |
Proxy Server |
String |
The URL of the proxy server including the port number. |
No |
proxyServer |
Proxy User Name |
String |
The user name used to authenticate with the proxy server. |
No |
proxyUsername |
Proxy Password |
String |
The password used to authenticate with the proxy server. |
No |
proxyPassword |
Resource types and sys_params |
Multiline |
This filed is used for selecting the Resource types (Change_request, incident, problem etc.,) to be synced and to pass sys_param values for each resource type. This field should be an array of objects where each object represents one event.
Example: [ { "table":"change_request", "sys_params":{ "category": "Software" } },... ] |
Yes |
resourceTypesAndSys_params |
Enable readonly replica |
Boolean |
When the feature flag is enabled, all the data collection queries will be reading it from the read replica instance. |
No |
enableReadonlyReplica |
Client Id |
String |
The client ID used to authenticate with the ServiceNow server using OAuth2.0. |
No |
clientId |
Client Secret |
Secure |
The client secret used for authentication with the ServiceNow server using OAuth2.0. |
No |
clientSecret |
Refresh Token |
Secure |
The refresh token used for authentication with the ServiceNow server using OAuth2.0. |
No |
refreshToken |
JSON code sample
The following sample code can be used as a template to define the integration within the JSON file for a value stream. Copy and paste the template into the JSON file Integration section and make the appropriate changes.
integrations": [
{
"type": "ucv-ext-servicenow",
"name": "Plugin for ServiceNow",
"tenant_id": "tenant_id",
"logginglevel": "info",
"properties": {
"ucvAccessKey": "urbancodevelocity_user_accesskey",
"baseUrl": "url_servicenow_server",
"username": "user_name",
"password": "pass_word",
"client_id": "client_Id",
"client_secret": "client_secret",
"refresh_token": "refresh_token",
"proxyServer": "proxy_server_url",
"proxyUsername": "proxy_server_user_name",
"proxyPassword": "proxy_server_password"
}
}
]
Automation Tasks
The following automation tasks are available in the ServiceNow plug-in:
ServiceNow – Create Change Request and Change Task
Use this step to create a ServiceNow change request in HCL DevOps Velocity.
Name |
Description |
Required |
Short Description |
A short description of the ServiceNow change request. |
Yes |
Request type |
The type of request type for the ServiceNow application. Example: Standard, Normal, and Emergency. |
Yes |
Assignment group |
The assignment group for the ServiceNow application. |
Yes |
Additional properties |
A list of additional properties for the change request in the format for each list item is {“property”:”value”}.
Example: {“short_description”:”Created by HCL Accelerate”}.
Separate each list item with a comma (,). See the ServiceNow API documentation for additional properties. |
No |
Create change task |
To create change task , provide necessary properties.
Example: [{“short_description”:”createtask”,”change_task_type”:”planning”,”description”:”changetask”,”start_date”:”2024-01-30 08:05:04″,”end_date”:”2024-01-31 08:05:13″,”outputProperty”:”example”}]. Here outputProperty holds sys_id of change task created.
To create multiple change task, provide comma separated objects.
Example: [{},{},{}].To create under existing change request mention “parent”:”CHG0030008″,”change_request”:”CHG0030008″ along with other properties. |
No |
Output property |
The name of the property that the sys_id of the created change request is saved. |
No |
ServiceNow – Update Change Request and Change Task
Use this step to update a ServiceNow change request in HCL DevOps Velocity.
Name |
Description |
Required |
Change Request Number |
Enter the change request number.
Note: Either change request number or property reference must be provided |
No |
Change request system id from property reference |
Enter the property reference to system id.
Note: Either change request number or property reference must be provided |
No |
Change request properties |
Enter properties for the change request to be updated in the format for each list item is {“property”:”value”}.
Example: {“short_description”:”change request description”,”planned_end_date”:”2024-01-31 07:52:53″,”planned_start_date”:”2024-01-30 07:52:47″}. Separate each list item with a comma (,). See the ServiceNow API documentation for additional properties. |
No |
Update change task |
To update change task , provide necessary properties.
Example to update:[{"sys_id":"abcd123","change_task_type":"planning","state":"1","planned_end_date":"2024-05-17 02:36:44","planned_start_date":"2024-05-17 02:36:30"}]
Example to create:[{"short_description":"createtask","change_task_type":"planning","description":"changetask","planned_end_date":"2024-05-17 02:36:44","planned_start_date":"2024-05-17 02:36:30","outputProperty":"example"}]. If sys_id not given, it creates change task.
To update multiple change task provide comma separated objects. Example: [{},{},{}] |
No |
ServiceNow – Wait Change Request
Use this task to wait ServiceNow change request in HCL DevOps Velocity.
Name |
Description |
Required |
Change Request Number |
Enter the change request number.
Note: Either change request number or property reference must be provided |
No |
Change request system id from property reference. |
Enter the property reference to system id.
Note: Either change request number or property reference must be provided |
No |
Field |
The change request field to wait for a match. |
Yes |
Value |
The value to match with the change request field. |
Yes |
ServiceNow – Wait Change Task
Use this step to create a ServiceNow wait change task.
Name |
Description |
Required |
Change task system id from property reference. |
Enter the property reference to system id. |
Yes |
Change Request Number |
Enter the change request number.
Note: Either change request number or property reference must be provided |
No |
Change request system id from property reference. |
Enter the property reference to system id.
Note: Either change request number or property reference must be provided |
No |
field |
Enter the change task field to wait for a match |
Yes |
Value |
Enter the value to match the change task field |
Yes |
Adding automation tasks to a release
After the plug-in is integrated, automated tasks are available to add as a task within a release.
- Verify that the ServiceNow server is connected to HCL DevOps Velocity.
- On the Create Task page, select the automation task from the Type field drop-down list.
- Complete the properties required for the task.
- Click Save.
Using OAuth with ServiceNow
To use OAuth in your integration, you need to provide the following details during configuration:
- client_id
- client_secret
- refresh_token
Perform the following steps to obtain the client_id and client_secret from your ServiceNow instance:
1. Log in to your ServiceNow instance.
2. In the left-hand navigation pane, search for OAuth and select Application Registry.
3. Click New and choose Create an OAuth API endpoint for external clients.
4. Fill in the required details and click Submit.
5. After submission, navigate to the newly created OAuth record and click on it to view the client_id and client_secret.
To obtain the refresh token send a POST request by providing the username, password, Client ID and Client secret as shown in the below image.
Use the credentials client_id, client_secret and refresh_token in your integration to authenticate using OAuth.