Integration of ServiceNow’s CMDB management with ManageIQ
- Prerequisites
- Importing ServiceNow datastore to ManageIQ
- Modifying the imported domains Instance values
- Creating Servicenow Incident Generic Object
- Importing the dialogs for the ServiceNow datastore methods
- Creating Add ServiceNow Incident Button
- Creating Servicenow catalog
- Creating ServiceNow Create Incident Service Catalog Item
- Creating ServiceNow View and Update Incidents Service Catalog Item
- Using ServiceNow Catalog Items and Buttons
- Clone the repository and zip the
ServiceNow
directoriy. - Download the dialogs yaml file from ServiceNow_Dialogs.
- Make sure you have a running instance of ManageIQ (the steps in this document are performed in ManageIQ's UI).
- Make sure you have a running Servicenow Instance and the required credentials.
-
Navigate to
Automation -> Embedded Automate -> Import / Export
. -
Under
Import Datastore Classes (*.zip)
, selectChoose file
and open the zip file that contains the datastore classes, then clickUpload
:- Under
Select domain you wish to import from:
, selectServiceNow
. - Under
Select namespaces you wish to import from:
, selectToggle All
and clickCommit
.
- Under
-
Navigate to
Automation -> Embedded Automate -> Explorer
. -
Under
Datastore
, selectDatastore -> ServiceNow
:- Select
Configuration -> Edit selected domain
:- Check the
Enabled
checkbox and click onsave
.
- Check the
- Select
After importing the required domains, the instance's Servicenow related properties need to be updated to match an existing, running Servicenow Instance.
-
Navigate to
Automation -> Embedded Automate -> Explorer
. -
For all the required instances perform the following steps:
- Select
Configuration -> Edit this instance
:- Replace
(snow_server)
value with your Servicenow Instance Host. - Replace
(snow_user)
and(snow_password)
values with your Servicenow's user and password. - Replace
(proxy_url)
with your instance's proxy url, or leave blank if there is none.
- Replace
NOTE
-
values are used in
"https://#{snow_server}/api/now/table/#{table_name}"
, so make sure to leave out the https:// and any endpoints from the(snow_server)
value. -
make sure to select automate instances, as there should be an automate instance and an automate method with the same name.
- Select
-
Navigate to
Automation -> Embedded Automate -> Generic Objects
. -
Select
Generic Object Definitions -> All Generic Object Definitions
and then selectConfiguration -> Add a new Generic Object Definition
:- Under
Name
, enter "Servicenow_Incident". - Under
Description
, enter "Servicenow Incident created from Cloudform". - Add the following
Attributes
:- ci_name: "String",
- ci_type: "String",
- urgency: "Integer",
- short_description: "String",
- number: "String",
- comments: "String",
- sys_id: "String",
- state: "String",
- assignment_group: "String",
- created_by: "String",
- Click
Add
.
NOTE
The object's attributes match the Incident's attributes, they may be changed, but then the
create.rb
method should be updated accordingly. - Under
-
Navigate to
Automation -> Embedded Automate -> Customization
. -
Under
Import
, select the dialogs yaml file and clickUpload
:- Under
Import Service Dialogs
, check all the dialogs and clickCommit
.
- Under
-
Navigate to
Automation -> Embedded Automate -> Customization
. -
Select
Buttons -> Object Types -> {object_type}
. -
Select
Configuration -> Add a new Button Group
:- Under
Name
, enterServicenow
. - Under
Description
, enterServicenow Button Group
. - Check
Display on Button
and select anIcon
andIcon color
. - Click
Add
.
- Under
-
Select the created group and select
Configuration -> Add a new Button
:-
Under
Name
, enterCreate Servicenow Incident
. -
Under
Description
, enterCreate Servicenow Incident Button
. -
Check
Display on Button
. -
Select an
Icon
andIcon Color
. -
Under
Dialog
select "Create Context Specific Snow Incident". -
NOTE: Make sure
Open Url
is unchecked. -
Under the
Advanced
tab, underObject Details
enter the following values:- System/Process: "Request",
- Message: "create",
- Request: "Call_Instance",
- Under
Attribute/Value Pairs
, add the pair: action: "create".
-
Click
Add
.
NOTE
When creating the button, you may specify expressions that define where the button is enabled or visible.
Example - creating a button on a Physical Server with name
physical-server-1
:- During the button creation under the
Advanced
tab:- Under
Visibility / Edit Selected Element
selectField
. - Another dropdown should appear, select
Physical Server:Name
. - Another dropdown and text box should appear; In dropdown, select
REGULAR EXPRESSION MATCHES
, and in text box insertphysical-server-1
. - Click
Commit
.
- Under
-
-
Navigate to
Services -> Catalogs
. -
Under
Catalogs
, selectAll Catalogs
. -
Select
Configuration -> Add New Catalog
:- Under
Name
, type "Servicenow". - Under
Description
, type "Catalog for Servicenow Incident Management Operations". - Click
Add
.
- Under
-
Navigate to
Services -> Catalogs
. -
Under
Catalog Items
, selectAll Catalog Items -> Servicenow
:- Select
Configuration -> Add a New Catalog Item
:- Do the following in the
Basic Info
section:- Under
Catalog Item Type
selectGeneric
. - Under
Name / Description
type "Create Incident" and "Catalog Item to create Servicenow incident". - Check
Display in Catalog
checkbox. - Under
Catalog
selectMy Company/Servicenow
. - Under
Dialog
selectCreate Generic Snow Incident
. - Under
Provisioning Entry Point
select/ServiceNow/Integration/ServiceNow/CMDB/create_generic_incident
(checkInclude Domain prefix in path
). - Under
Retirement Entry Point
select/ServiceNow/Service/Retirement/StateMachines/ServiceRetirement/Default
(checkInclude Domain prefix in path
).
- Under
- Do the following in the
Details
section:- Under
Long Description
type "Use this catalog item to create servicenowincident. Select the appropriate CI type and enter descriptions appropriately.".
- Under
- Click
Add
.
- Do the following in the
- Select
-
Navigate to
Services -> Catalogs
. -
Under
Catalog Items
, selectAll Catalog Items -> Servicenow
:- Select
Configuration -> Add a New Catalog Item
:- Do the following in the
Basic Info
section:- Under
Catalog Item Type
selectGeneric
. - Under
Name / Description
type "View and Update Incidents" and "Update Servicenow Incidents.". - Check
Display in Catalog
checkbox. - Under
Catalog
selectMy Company/Servicenow
. - Under
Dialog
selectView and Update Servicenow Incidents
. - Under
Provisioning Entry Point
select/ServiceNow/Integration/ServiceNow/CMDB/update_servicenow_incident
(checkInclude Domain prefix in path
). - Under
Retirement Entry Point
select/ServiceNow/Service/Retirement/StateMachines/ServiceRetirement/Default
(checkInclude Domain prefix in path
).
- Under
- Do the following in the
Details
section:- Under
Long Description
type "Use this catalog item to view and update servicenow incident. On Selecting the incident, the latest details from servicenow will be pulled. Update the required details and submit.".
- Under
- Click
Add
.
- Do the following in the
- Select
-
Navigate to
Services -> Catalogs
. -
Under
Service Catalogs
select the desired Catalog Item and clickOrder
.- Fill the dialog and click
Commit
.
- Fill the dialog and click
-
Navigate to the Object Type on which the button has been created (Example for Provider object type:
Compute -> Physical Infrastructure -> Providers
, and select the provider) -
When in the Object Type's section, the
Servicenow
button group should be visible:- Select it and select the
Create Incident
button. - Fill the dialog and click
Commit
.
- Select it and select the
- Navigate to
Automation -> Embedded Automate -> Generic Objects
. - Under
Generic Object Definitions
select theServicenow_Incident
. - Under
Relationships
the number of instances should be visible, clicking on that number should display them.