ServiceNow - Manage Assets with Scripted REST API
  • 05 Nov 2024
  • 3 Minutes to read
  • Dark
    Light
  • PDF

ServiceNow - Manage Assets with Scripted REST API

  • Dark
    Light
  • PDF

Article summary

ServiceNow - Manage Assets with Scripted REST API executes a custom REST API endpoint on assets returned by the selected query or assets selected on the relevant asset page.

See Creating Enforcement Sets to learn more about adding Enforcement Actions to Enforcement Sets.

Note:

Required Fields

These fields must be configured to run the Enforcement Set.

  • Action name - The name of this Enforcement Action. The system sets a default name. You can change the name.
  • Configure Dynamic Values - Toggle on to enter a Dynamic Value statement. See Creating Enforcement Action Dynamic Value Statements to learn more about Dynamic Value statement syntax.

  • Use stored credentials from the ServiceNow adapter - Select this option to use credentials from the adapter connection. By default, the first connection is selected.

    • When you select this option, the Select Adapter Connection drop-down becomes available. Select the adapter connection to use for this Enforcement Action.
    NOTE
    To use this option, you must successfully configure a ServiceNow adapter connection.
  • API endpoint (default: api/now/table/cmdb_ci_computer) - The endpoint to execute.

  • Compute Node - The Axonius node to use when connecting to the specified host. For more details, see Connecting Additional Axonius Nodes.

Additional Fields

These fields are optional.

  • ServiceNow domain - URL for the ServiceNow admin panel.

  • User name and Password - To connect to ServiceNow, you will need to create a user with action privileges.

  • Client ID and Client Secret - The OAuth Client ID and Client Secret for OAuth access to ServiceNow. Refer to OAuth 2.0 with Inbound REST for full details on how to obtain the OAuth Token.

  • Refresh Token - When using the OAuth method of authentication, enter the value of the Refresh Token issued by a ServiceNow instance.

  • Apigee URL - The URL of the domain that the get request is sent to for acquiring APIgee token.

  • Resource Apigee - The resources you want the APIgee to access.

  • Verify SSL - Select whether to verify the SSL certificate of the server against the CA database inside of Axonius. For more details, see SSL Trust & CA Settings.

  • HTTPS Proxy - Connect the adapter to a proxy instead of directly connecting it to the domain.

  • Map Axonius fields to adapter fields - Use the Field Mapping Wizard to map Axonius fields to fields in external systems. In this way you can transfer data found in Axonius into the external system as part of the configuration of relevant enforcement actions. The wizard shows you which fields exist on the Axonius system, allowing you to map them easily.

    Note:

  • Additional fields - Specify additional fields to be added as part of the ServiceNow asset as key/value pairs in JSON format. For example: {"field1": "value1", "field2": "value2"}. You can also use functions within the field value either by themselves or embedded within larger text strings. In this example, the {{CURRENT_DATE}} function is embedded into the field value for the field Date of Update:
    AdditionalFieldsFunctionsCurrentDate.png

    • Use the {{CURRENT_DATE}} function to add the current date:
      • Using {{CURRENT_DATE}} with no format codes is the same as using the format codes: %B %d, %Y. This produces a date string like this: August 09, 2022.
      • Use format codes to specify a date format. For example, in the string AX VM Update - {{CURRENT_DATE:%m/%d/%Y}}, the %m/%d/%Y format codes will be replaced with 08/09/2022. The full string will be AX VM Update - 08/09/2022. The available format codes are described here: Format Codes.
  • Number of parallel requests (default: 10) - The number of requests allowed at the same time.

  • Retry count (default: 1) - If the action fails, Axonius will retry to execute it this many times for each device.

  • Gateway Name - Select the Gateway through which to connect to perform the action.


For more details about other Enforcement Actions available, see Action Library.


Was this article helpful?