# ServiceNow

Firefly integrates with ServiceNow to populate the Configuration Management Database (CMDB) with cloud infrastructure data. This integration provides a robust solution for synchronizing your cloud infrastructure data from Firefly to ServiceNow's CMDB. It enables organizations to maintain an accurate and up-to-date view of their cloud assets across multiple cloud providers.

## Setup Procedure

1. Create a ServiceNow account if you do not already have one.
2. In Firefly, click **Settings > Integrations**.
3. Click **Add New > ServiceNow**.
4. Enter a Name for the integration (e.g., "ServiceNow Integration").
5. Enter your ServiceNow Username and Password.
6. Enter the ServiceNow instance URL.
7. Click **Next**.
8. Click **Done**.

## Installation

This section provides step-by-step instructions to set up your ServiceNow application and ensure it functions correctly in your instance. It also outlines dependencies, external system connections, and how to test the configuration.

### 1. Application Dependencies

* **Required Plugin:**
  * Configuration Management For Scoped Apps (CMDB) (`com.snc.cmdb.scoped`).
* **System Table Permissions (all require read access via `x_w4f_firefly_conn.fireflyuser` role):**.
  * FireFly CMDB Inventory (`x_w4f_firefly_conn_firefly_cmdb_inventory`).
  * Asset Type (`x_w4f_firefly_conn_asset_type`).
  * Firefly Governance Policy (`x_w4f_firefly_conn_firefly_governance_policy`).
  * Related Configuration Items\_Violated Policies (`x_w4f_firefly_conn_m2m_x_w4f_firefl_x_w4f_firefl`).

### 2. Configuration Instructions

* Install the app **Firefly Connector | 1.0.0**.
* Create a user with username and password, and assign the `x_w4f_firefly_conn.fireflyuser` and `ITIL` roles.
* Add a Discovery Source for Firefly Application to the `discovery_source` field on the Configuration Item (`cmdb_ci`) table in the Global Scope:
  1. Set the scope to Global using the Application scope picker.
  2. Go to **Fix script** from the Application Navigator.
  3. Create a new Fix script named "Add Discovery source for Firefly".
  4. In the script field, add:

     ```js
     var source_name = "Firefly-Con";
     var dsUtil = new global.CMDBDataSourceUtil();
     dsUtil.addDataSource(source_name);
     ```
  5. Save and run the Fix Script.
  6. Confirm the choice value is added: Go to `sys_choice.LIST` from Navigator.
  7. Add the following filter conditions: `name=cmdb_ci`, `element=discovery_source`, `value=Firefly-Con`. Ensure one record is displayed.
* Login as a ServiceNow Admin User, go to the Incident module from the Navigator. Click **Incident > All**. Open any existing Incident.
* Click the three-line hamburger icon. Select **Configure > Related Lists > Add the "Violated Policies" related list** and save the form.
* Ensure system properties for Maximum incident count and Severity of Policies for incident creation are set. Navigate to **Firefly Configurations** under Firefly Connector Module.

### 3. External Systems Connection

* **Steps to create a dedicated integration user:**
  * Create a new user on the instance (e.g., `firefly.IntegrationUser`).
  * Assign the roles: `x_w4f_firefly_conn.fireflyuser`, `rest_service`.

### 4. Testing the Configuration

* Firefly should hit the ServiceNow scripted API with Inventory and Policy Data.
* Navigate to the `x_w4f_firefly_conn_firefly_cmdb_inventory` and `x_w4f_firefly_conn_firefly_governance_policy` tables.
* The rows in Firefly should be inserted as records into the respective tables in ServiceNow.
* An Incident should be created for every request if it has specific severity policy violations, mapping all the CIs with policy violations having severity mentioned in system property.

### 5. Getting Started

After installation, you'll need to:

1. Configure your ServiceNow instance credentials.
2. Set up the desired sync frequency.
3. Select the cloud providers and resources to track.
4. Configure any specific mapping rules for your CMDB.

For detailed installation instructions, please refer to our [ServiceNow Installation Guide](https://store.servicenow.com/api/sn_store/v1/store/attachment/b2d8e32e1be06a50a85b16db234bcb9d).

### Key Features

* **Secure API Integration**: Periodic data synchronization with secure authentication and encryption.
* **Multi-Cloud Support**: Comprehensive asset tracking across major cloud providers:
  * Amazon Web Services (AWS).
  * Microsoft Azure.
  * Google Cloud Platform (Google Cloud).
* **Data Management**:
  * Dedicated tables for cloud inventory management.
  * Governance insights and reporting.
  * Import sets and transform maps for seamless data integration.
* **Compliance & Monitoring**:
  * Built-in compliance monitoring.
  * Robust error handling and logging.
  * Real-time status updates.
* **Scalability**:
  * User-friendly interface.
  * Designed to scale with growing infrastructure needs.
  * Flexible configuration options.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.firefly.ai/integrations/project-management/servicenow.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
