Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

You are done with the Service Now portion of the configuration, but you may want to keep this open until you have validated everything is working.

...

  1. Access the MettleCI Workbench page to integrate with your Service Now Work Item Management system by logging in to MettleCI Workbench and select Issue Management from the Profile menu (top right)

  2. 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” present, but you can add as many as you need to (including more than one of the same type if necessary) one at a time. It is recommended that you get one working before you add another.

  3. On the Add Issue Management screen that appears

select Service Now from the Select Issue Management Type dropdown

...

and click Next

4. On the Register ServiceNow Issue Management screen that appears next, enter the following values and click Submit:

...

  • Field list

    • Name: Anything you like, but something that identifies your Service Now organisational instance would be a sensible choice

    • URL: The URI of your Service Now instance recorded earlier.

    • Client ID: Your Application (client) ID recorded earlier

    • Client Secret: Your client secret recorded earlier

    • Search Queries: This

    defaults to change_task as the table, keyed on number with short_description as the summary shown to the user. If this is sufficient, you can accept this default, or you can edit the query
    • has no default, you will need to create at least one query. Consult with your ServiceNow administrators to determine what table(s) your organization uses, and thus, what table(s), then add or edit the query or queries as needed by using the “pencil” icon and “+” icon to edit what is queried or add a new table to query, respectively.

    Consult with your ServiceNow administrators to determine what table(s) your organization uses
    • The example uses change_task as the table, keyed on number with number: short_description as the summary shown to the user.

  • OPTIONAL - In the Search Queries section of any query, you can add add a filter expression to any of your queries to limit what is returned. Note that this expression is not checked for correct syntax. Consult with your ServiceNow administrators to determine whether you need to filter (most organizations will not) and what columns/values to filter on.

  • It is not necessary to restart the workbench Workbench service, but clearing the log and then restarting the service may aid in debugging

    Code Block
    $> cd /opt/dm/mci
    $> mv mci.log mci.log_preIssueManagementChanges
    $> sudo service dm-mettleci-workbench restart
    
  • During issue lookup, Workbench will search each ServiceNow Table configured in the Search Queries list. The Ids that will appear in the commit message are generated from the value of the “Primary Key Column” value and the text shown to the user in the lookup is generated from the “Ticket Summary Column” value. These settings are retained in the

...

  • issuesmanagement-settings.yaml file in the installation directory

...

  • . Assuming the choices above were made, this file would would appear like so: (ID 0 is the default generic issue management which takes no other parameters)

Code Block
---
- id: 0
  type: "GENERIC"
  name: Default Generic Issue Manager"
- id: 1
  type: "SERVICENOW"  
  name: MyServiceNow:
  url: <your ServiceNow instance URL>
  clientId: <your Client ID>
  clientSecret: "<your Client Secret>"
  search:
      - table: "change_ task"
        id: "${number}"
        summary: "${number}: ${short_description}"
        queryfilter: "state='ACTIVE'"


Template Strings are text containing special ${column_name} variables which work bench Workbench will replace with Column data from the ServiceNow Table based on the column_name.
For example, the following configuration can be used to first lookup Incident and then Problem Tables as provided in default ServiceNow configurations:

  1. Code Block
    issueManagement: serviceNow

5.
5. You can now select your new Service Now WIM from any existing or new project.

From Project Management, select an existing project for editing via the pencil icon:

...

At the bottom there is a dropdown to let you select from all currently configured types of Work Item Management

...

Select myServiceNow (or whatever you named your connection) from the choices

...

and then select Update Project. Change all existing projects that you want to use Service Now with, as desired.

6. ServiceNow work items will be available from the the Issues drop down on the Git Commit page during Check-in for projects using it:

...

That concludes Service Now setup.

...