Create a change request

2 minute read

Use this functionality to create a new change request in ServiceNow. The user must provide valid credentials (Basic authentication or OAuth authentication) and any of the other fields defined in the input table below.

All CloudBees action repositories are listed at CloudBees, Inc. on GitHub.

Input fields

The following table lists the fields to use for create change request:

Table 1. Fields available to CREATE a change request
Change request model field Data type Required Description

action-type

String

Yes

The type of operation is create.

url

String

Yes

The ServiceNow host URL.

username

String

Yes

The username for authentication. This is required for basic authentication and OAuth authentication.

password

String

Yes

The password for authentication. This is required for basic authentication and OAuth authentication.

client-id

String

Required only for OAuth based authentication.

The unique identification number of the client.

client-secret

String

Required only for OAuth based authentication.

The client secret for authentication.

short-description

String

No

A short title about the ticket for easy identification.

description:

String

No

Additional information about the ticket, if any.

cr-type

String

No

The criticality of the change request: normal or emergency. The default value is normal.

state

String

No

The current status of the change request.

priority

String

No

The priority of the change request ticket.

risk

String

No

The risk involved in the ticket.

impact

String

No

The impact of the ticket.

category

String

No

The ticket category.

requested-by

String

No

The type of change request initiated by the user.

assignment-group

String

No

The assignment group to which the CR ticket must be mapped.

assigned-to

String

No

The user to whom the change request ticket must be assigned in the assignment group.

additional-parameters

JSON String

No

Any additional parameters apart from the list provided above.

Usage example

The following is an example change request payload with mandatory fields for the create change request:

- name: ServiceNow Action with Basic Auth uses: cloudbees-io/service-now@v1 with: url: ${{ vars.SERVICENOW_URL }} username: "username" password: "password" action-type: "create" cr-type: "Normal|Emergency" short-description: "Title of the CR ticket"

A unique change request number and sys_id are generated for the change request when the ticket is successfully created.

  • The sys_id is used to update the ticket.

  • The change request number is used to retrieve the ticket’s status.