Camel Spring Boot

ServiceNow

Query and change records, attachments, import sets and service catalog items of a ServiceNow instance through its REST API.

What’s inside

Please refer to the above links for usage and configuration details.

Maven coordinates

<dependency>
    <groupId>org.apache.camel.springboot</groupId>
    <artifactId>camel-servicenow-starter</artifactId>
</dependency>

Spring Boot Auto-Configuration

The starter supports 49 options, which are listed below.

Name Description Default Type

camel.component.servicenow.api-url

The base URL of the ServiceNow REST API. If not set, https://{instanceName}.service-now.com/api is used.

String

camel.component.servicenow.api-version

The version of the REST API, for example v1, which the producer adds to the request path. If not set, the path has no version and ServiceNow uses the latest one. The CamelServiceNowApiVersion header replaces this option.

String

camel.component.servicenow.autowired-enabled

Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.

true

Boolean

camel.component.servicenow.configuration

The shared configuration of the endpoints. Each endpoint starts from a copy of it. The option is a org.apache.camel.component.servicenow.ServiceNowConfiguration type.

ServiceNowConfiguration

camel.component.servicenow.date-format

The java.time.format.DateTimeFormatter pattern of the LocalDate fields of the models in the JSON. It is not used when the mapper option is set.

yyyy-MM-dd

String

camel.component.servicenow.date-time-format

The java.time.format.DateTimeFormatter pattern of the LocalDateTime fields of the models in the JSON. It is not used when the mapper option is set.

yyyy-MM-dd HH:mm:ss

String

camel.component.servicenow.display

Which scorecards a scorecards request returns by the Display field of their indicator: true for only those with Display selected, all for any (sysparm_display). The CamelServiceNowDisplay header replaces this option.

true

String

camel.component.servicenow.display-value

Whether ServiceNow returns the display values (true), the actual values (false) or both (all) of the fields (sysparm_display_value). The CamelServiceNowDisplayValue header replaces this option.

false

String

camel.component.servicenow.enabled

Whether to enable auto configuration of the servicenow component. This is enabled by default.

Boolean

camel.component.servicenow.exclude-reference-link

Whether ServiceNow leaves out the Table API links of reference fields in the response (sysparm_exclude_reference_link). The CamelServiceNowExcludeReferenceLink header replaces this option.

false

Boolean

camel.component.servicenow.favorites

Whether a scorecards request returns only the scorecards that are favorites of the user (sysparm_favorites). The CamelServiceNowFavorites header replaces this option.

Boolean

camel.component.servicenow.http-client-policy

To use a custom Apache CXF org.apache.cxf.transports.http.configuration.HTTPClientPolicy for the HTTP connection, for example for timeouts. When it is set, the proxyHost and proxyPort options are not used. The option is a org.apache.cxf.transports.http.configuration.HTTPClientPolicy type.

HTTPClientPolicy

camel.component.servicenow.include-aggregates

Whether a scorecards request returns all available aggregates of an indicator, also when an aggregate is already applied (sysparm_include_aggregates). The CamelServiceNowIncludeAggregates header replaces this option.

false

Boolean

camel.component.servicenow.include-available-aggregates

Whether a scorecards request returns all available aggregates of an indicator when no aggregate is applied (sysparm_include_available_aggregates). The CamelServiceNowIncludeAvailableAggregates header replaces this option.

false

Boolean

camel.component.servicenow.include-available-breakdowns

Whether a scorecards request returns all available breakdowns of an indicator (sysparm_include_available_breakdowns). The CamelServiceNowIncludeAvailableBreakdowns header replaces this option.

false

Boolean

camel.component.servicenow.include-score-notes

Whether a scorecards request returns the notes of each score, with their text, author and time (sysparm_include_score_notes). The CamelServiceNowIncludeScoreNotes header replaces this option.

false

Boolean

camel.component.servicenow.include-scores

Whether a scorecards request returns all scores of a scorecard instead of only the most recent one (sysparm_include_scores). The CamelServiceNowIncludeScores header replaces this option.

false

Boolean

camel.component.servicenow.input-display-value

Whether ServiceNow treats the field values of a create or change as display values instead of actual values (sysparm_input_display_value). The CamelServiceNowInputDisplayValue header replaces this option.

false

Boolean

camel.component.servicenow.instance-name

The name of the ServiceNow instance for the endpoints whose URI does not name one.

String

camel.component.servicenow.key

Whether a scorecards request returns only the scorecards of key indicators (sysparm_key). The CamelServiceNowKey header replaces this option.

Boolean

camel.component.servicenow.lazy-start-producer

Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel’s routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.

false

Boolean

camel.component.servicenow.mapper

To use a custom Jackson tools.jackson.databind.ObjectMapper, which must be a JsonMapper, to convert the request and the response. When it is set, the dateFormat, timeFormat and dateTimeFormat options are not used. The option is a tools.jackson.databind.ObjectMapper type.

ObjectMapper

camel.component.servicenow.models

The model class per table name, used for both the request and the response. A table with no class uses a Map. The CamelServiceNowModel header replaces this option. This is a multi-value option with prefix: model.

Object>>

camel.component.servicenow.oauth-client-id

The client ID of the OAuth application in ServiceNow. When it and oauthClientSecret are set, the producer gets an access token from oauthTokenUrl with the password grant of userName and password, and sends the token instead of basic authentication.

String

camel.component.servicenow.oauth-client-secret

The client secret of the OAuth application in ServiceNow, used with oauthClientId.

String

camel.component.servicenow.oauth-token-url

The URL of the OAuth token endpoint of ServiceNow. If not set, https://{instanceName}.service-now.com/oauth_token.do is used.

String

camel.component.servicenow.password

The password of the ServiceNow account, used with userName.

String

camel.component.servicenow.per-page

The maximum number of scorecards that a scorecards request returns per page, at most 100 (sysparm_per_page). The CamelServiceNowPerPage header replaces this option.

10

Integer

camel.component.servicenow.proxy-authorization-policy

To use a custom Apache CXF org.apache.cxf.configuration.security.ProxyAuthorizationPolicy for the authentication to the proxy. When it is set, the proxyUserName and proxyPassword options are not used. The option is a org.apache.cxf.configuration.security.ProxyAuthorizationPolicy type.

ProxyAuthorizationPolicy

camel.component.servicenow.proxy-host

The host name of the HTTP proxy. The proxy is used only when proxyPort is also set and httpClientPolicy is not set.

String

camel.component.servicenow.proxy-password

The password for basic authentication to the proxy, used with proxyUserName.

String

camel.component.servicenow.proxy-port

The port of the HTTP proxy, used with proxyHost.

Integer

camel.component.servicenow.proxy-user-name

The user name for basic authentication to the proxy. It is used only when proxyPassword is also set and proxyAuthorizationPolicy is not set.

String

camel.component.servicenow.release

The ServiceNow release whose REST APIs the producer calls. FUJI supports the table, aggregate and import resources, and HELSINKI all resources. GENEVA is not supported.

helsinki

ServiceNowRelease

camel.component.servicenow.request-models

The class of the request body per table name. The producer fails when the body is not an instance of it, and a table with no class uses a Map. The CamelServiceNowRequestModel and CamelServiceNowModel headers replace this option. This is a multi-value option with prefix: request-model.

Object>>

camel.component.servicenow.resource

The REST API that the producer calls when the CamelServiceNowResource header is not set: table, aggregate, import, attachment, scorecards, misc, service_catalog, service_catalog_items, service_catalog_cart or service_catalog_categories. The FUJI release supports only table, aggregate and import.

String

camel.component.servicenow.response-models

The class per table name that the producer converts the result to. A table with no class uses a Map. The CamelServiceNowResponseModel and CamelServiceNowModel headers replace this option. This is a multi-value option with prefix: response-model.

Object>>

camel.component.servicenow.retrieve-target-record-on-import

Whether the create action of the import resource returns the record that the import inserted into the target table, which the producer reads with a second request, instead of the import set result. The CamelServiceNowRetrieveTargetRecord header replaces this option.

false

Boolean

camel.component.servicenow.sort-by

The value that a scorecards request sorts the scorecards by (sysparm_sortby). If not set, ServiceNow sorts by value. The CamelServiceNowSortBy header replaces this option.

String

camel.component.servicenow.sort-dir

The sort direction of a scorecards request, asc or desc (sysparm_sortdir). If not set, ServiceNow sorts in descending order. The CamelServiceNowSortDir header replaces this option.

String

camel.component.servicenow.ssl-context-parameters

The TLS configuration of the connection to the REST API. If not set and useGlobalSslContextParameters is enabled on the component, the global SSL context parameters are used. The option is a org.apache.camel.support.jsse.SSLContextParameters type.

SSLContextParameters

camel.component.servicenow.suppress-auto-sys-field

Whether ServiceNow does not generate the system fields, such as sys_updated_on, when a record is created or changed (sysparm_suppress_auto_sys_field). The CamelServiceNowSuppressAutoSysField header replaces this option.

false

Boolean

camel.component.servicenow.suppress-pagination-header

Whether ServiceNow leaves out the Link header of the response (sysparm_suppress_pagination_header), from which the producer sets the CamelServiceNowOffsetNext, CamelServiceNowOffsetPrev, CamelServiceNowOffsetFirst and CamelServiceNowOffsetLast headers. The CamelServiceNowSuppressPaginationHeader header replaces this option.

false

Boolean

camel.component.servicenow.table

The name of the table, for example incident, for the table, aggregate and import resources. The CamelServiceNowTable header replaces this option. The table name also selects the class of the models, requestModels and responseModels options.

String

camel.component.servicenow.target

Whether a scorecards request returns only the scorecards that have a target (sysparm_target). The CamelServiceNowTarget header replaces this option.

Boolean

camel.component.servicenow.time-format

The java.time.format.DateTimeFormatter pattern of the LocalTime fields of the models in the JSON. It is not used when the mapper option is set.

HH:mm:ss

String

camel.component.servicenow.top-level-only

Whether the categories of a catalog (the categories subject of the service_catalog resource) are only those whose parent is the catalog (sysparm_top_level_only). The CamelServiceNowTopLevelOnly header replaces this option.

Boolean

camel.component.servicenow.use-global-ssl-context-parameters

Whether to use the global SSL context parameters of the CamelContext when the sslContextParameters option is not set.

false

Boolean

camel.component.servicenow.user-name

The user name of the ServiceNow account. The producer sends it with basic authentication, or in the OAuth password grant when oauthClientId and oauthClientSecret are set.

String