Integrating your MettleCI Workbench with ServiceNow will enable MettleCI Workbench to perform a dynamic lookup when linking DataStage Git commits to one or more ServiceNow work items directly within the Workbench user interface.
Register Workbench as an OAuth2 ServiceNow Application
Setup OAuth in ServiceNow in your ServiceNow instance.
Create a new OAuth API endpoint for Workbench to access ServiceNow:
Set the “Name” Field to “MettleCI Workbench” and the “Redirect URL” to
https://<workbench url>:8080/api/auth/delegated/service_now
and click “Submit”:
If your organization has installed multiple MettleCI Workbench application, you can add them all to the same ServiceNow Application Registration by adding multiple Redirect URLs.Click on your newly created Application Registration:
Note down the “Client ID” and “Client Secret” field properties for later use:
Configuring MettleCI Workbench Work Item Lookup with Azure DevOps
Access the MettleCI Workbench page to integrate with your Azure Work Item Management system by logging in to MettleCI Workbench and select Issue Management from the Profile menu (top right)
On the Registered Issue Management Systems screen select the “+” to create a new Issue Management type.. Initially you will have only the “Default Generic Issue Manager” but you can add as many as you need to (including more than one of the same type)
Enter the following values and click Submit:
Issue Management Type: Azure
Name: Anything you like, but something that identifies your Azure organisational instance would be a sensible choice
Tenant ID: Your Directory (tenant) ID
Client ID: Your Application (client) ID
Client Secret: Your client secret
Restart the workbench service:
$> sudo service dm-mettleci-workbench restart
ServiceNow work items will be available from the the Issues drop down on the Git Commit page during Check-in:
For older Workbench installations prior to
If you are starting Workbench for the first time, you will be taken through a setup wizard. You can configure your ServiceNow work item lookup in the setup wizard.
Alternatively, log into your MettleCI Workbench server and open/opt/dm/mci/config.yml
in your favorite editor and follow the next three steps.Change the
issueManagement
property toserviceNow
, add anserviceNow
section as shown below and replace the<tags>
with the values noted in the previous steps:issueManagement: serviceNow serviceNow: url: <your ServiceNow instance URL> clientId: <your Client ID> clientSecret: "<your Client Secret>"
Add at least one ServiceNow Table to search during Work Item lookup:
issueManagement: serviceNow serviceNow: url: <your ServiceNow instance URL> clientId: <your Client ID> clientSecret: "<your Client Secret>" search: - table: <first ServiceNow Table to search> id: <template string> summary: <template string> - table: <second ServiceNow Table to search> id: <template string> summary: <template string>
During issue lookup, Workbench will search each ServiceNow Table configured in the search list. The Ids that will appear in the commit message are generated from the “id” template string and the text shown in the lookup is generated from the “summary” template strings.
Template Strings are text containing special${column_name}
variables which work bench will replace with Column data from the ServiceNow Table based on thecolumn_name
.
For example, the following configuration can be used to first lookup Incident and then Problem Tables as provided in default ServiceNow configurations:issueManagement: serviceNow serviceNow: url: <your ServiceNow instance URL> clientId: <your Client ID> clientSecret: "<your Client Secret>" search: - table: incident id: "${number}" summary: "${number}: ${short_description}" - table: problem id: "${number}" summary: "${number}: ${short_description}"
Restart the workbench service
sudo service dm-mettleci-workbench restart
ServiceNow work items will be available from the the Issues drop down during Check-in: