ServiceNow (PDK) plugin procedures

10 minute readExtensibilityDeveloper productivity

Plugin procedures can be used in procedure steps, process steps, and pipeline tasks, allowing you to orchestrate third-party tools at the appropriate time in your component, application process, or pipeline.

Depending on your plugin configuration and how you run procedures, the Input parameters  Configuration name field may behave differently in the CloudBees CD/RO UI. For more information, refer to Differences in plugin UI behavior.

AddRecord

Add a record in Service now

Input parameters

Table 1. AddRecord input parameters
Parameter Description

Configuration name

Required. The previously defined configuration for the plugin.

Record ID

Required. Universal field for ServiceNow records identification. SysID, Number, or Table may be specified. For AddRecord procedure you can only specify table name. All others identifiers for record addition are restricted.

Content

Required. JSON representation of the request content. Will be used as content. To add short_description you may use next JSON: {"short_description" : "New Short Description"}

PropertySheet for procedure result

Property sheet where procedure results should be saved

Approve Or Reject Pipeline Gate

Approves or rejects pipeline gate.

Input parameters

Table 2. Approve Or Reject Pipeline Gate input parameters
Parameter Description

Correlation ID

Required. null

Action

Required. null

Attach Change Tasks To Change Request

Attaches one or more change tasks to a change request.

Input parameters

Table 3. Attach Change Tasks To Change Request input parameters
Parameter Description

Configuration name

Required. The previously defined configuration for the plugin.

Change Request Record ID

Required. A Change Request Record ID to which previously existing Change Tasks should be linked.

Change Tasks Record IDs

Required. A comma-separated Change Task Record IDs of existing Change Tasks that should be linked to existing Change Request.

Output parameters

Table 4. Attach Change Tasks To Change Request output parameters
Parameter Description

Change Tasks

List of change tasks.

Change Request Number

Record number of change request.

Change Request Id

Record ID of change request.

Call ServiceNow API

Call any ServiceNow API.

Input parameters

Table 5. Call ServiceNow API input parameters
Parameter Description

Configuration name

Required. The previously defined configuration for the plugin.

Request type

Required. Includes the following options: GET, POST, PUT, PATCH or DELETE.

Path URL

Relative URL Path. For example, /api/now/table/incident/516460ae1ouc62x0e472ffc13803dxx1.

Content

Provide the body content required for the request. For example: {"description" : "Test data"}

Output parameters

Table 6. Call ServiceNow API output parameters
Parameter Description

Response

Response of ServiceNow API Request

Check Approval Status

Checks the status of one or more approvals. By checking the parameter 'Check All' all the approvals are retrieved, and by providing any of the other parameters specific approvals can be retrieved. 'Approval For' and 'Approver' are joined when searching, that means that if both are provided the approvals retrieved will be the ones that match both parameters. If 'System IDs' provided are also retrieved from 'Approval For' and 'Approver' filters, they will be only searched and displayed once.

Input parameters

Table 7. Check Approval Status input parameters
Parameter Description

Configuration name

Required. The previously defined configuration for the plugin.

Check All

If checked retrieves all approvals.

Approval For

Specify the identifier for what is the approval for. An example for a change request would be CHG0000009.

Approver

Specify the Approval approver.

System ID(s)

Specify the Approval unique identifier. You can specify more than one ID just by separating them by comas.

Check Change Request Status

Sets the status of one or more change requests.

Input parameters

Table 8. Check Change Request Status input parameters
Parameter Description

Configuration name

Required. The previously defined configuration for the plugin.

Check All

If checked retrieves all the change requests.

Number(s)

Specify the Change Request number or sys_id. You can specify more than one Change Request number just by separating them by commas. You can use sys_id and number in one request. For example: CHG00001, CHG00002, d1552ef84f0e4200a94bdd211310c79f

Requested By

Specify the sys_id of user that requested the Change Request.

Assigned To

Specify the sys_id of user that requested the Change Request.

Configuration Item

Specify the sys_id of configuration item associated with the Change Request.

Category

Specify the category assigned with the Change Request.

Priority

Specify the priority assigned with the Change Request.

Risk

Specify the risk assigned with the Change Request.

Type

Specify the type assigned with the Change Request.

Create Change Request

Creates new change request by provided data.

Input parameters

Table 9. Create Change Request input parameters
Parameter Description

Configuration name

Required. The previously defined configuration for the plugin.

Short Description

Required. null

Correlation ID

Correlation Display

Change Request Detail

Result Property Sheet

Property sheet where procedure results should be saved.

Create Change Request From Template

Creates a new change request using a ServiceNow standard change template.

Input parameters

Table 10. Create Change Request From Template input parameters
Parameter Description

Configuration name

Required. The previously defined configuration for the plugin.

Template ID

Required. ServiceNow standard change template ID(sys_id) or name. Use "Get Change Request Templates" procedure to discover available templates.

Template Type

Type of change request template. Standard change templates use the Change Management API for automated approval workflows.

Template Variables

JSON object containing template-specific variables and their values. For example: {"short_description": "Custom description", "server_name": "web01", "maintenance_window": "2025-01-15 02:00:00"}. Available variables depend on the specific template.

Additional Fields

JSON object containing additional ServiceNow change request fields to set or override. For example: {"priority": "2", "risk": "3", "category": "Software"}.

Correlation ID

Used only for bi-directional integration with native ServiceNow plugin "CloudBees CD". This will be used to correlate CloudBees CD with ServiceNow. For bi-directional integration this is mandatory information. This would be used as a context for the appropriate CloudBees CD REST API that ServiceNow needs to call. For example, enter /flowRuntime/$[/myPipelineRuntime/id]/stage/%stage_name%/gate/PRE/taskName/%task_name% to call to approve a Gate, where %stage_name% and %task_name% should be replaced with user’s data. In addition to previous parameters, proper Gate type should be specified. Only PRE and POST are allowed as Gate types. For more information, see ServiceNow Plugin Help documentation.

Correlation Display

This will be used to correlate CloudBees CD with ServiceNow. For bi-directional integration this is mandatory information. For example, this field would have value "ElectricFlow Pipeline Gate" for Gate approval use-case. For additional flexibility and options, see ServiceNow Plugin Help documentation.

Result Property Sheet

Property sheet where procedure results should be saved.

Output parameters

Table 11. Create Change Request From Template output parameters
Parameter Description

Change Request Number

Change Request Number

Change Request Id

Change Request Sys ID

Change Request Link

Direct link to the change request in ServiceNow

Template Name

Name of the template used

Template Type

Type of template used (standard/normal/emergency)

Create Change Task

Creates a new Change Task in the ServiceNow instance.

Input parameters

Table 12. Create Change Task input parameters
Parameter Description

Configuration name

Required. The previously defined configuration for the plugin.

Short Description

Required. Short description of the change task.

Correlation ID

Used only for bi-directional integration with native ServiceNow plugin "CloudBees CD". This will be used to correlate CloudBees CD with ServiceNow. For bi-directional integration this is mandatory information. This would be used as a context for the appropriate CloudBees CD REST API that ServiceNow needs to call. For example, enter /flowRuntime/$[/myPipelineRuntime/id]/stage/%stage_name%/gate/PRE/taskName/%task_name% to call to approve a Gate, where %stage_name% and %task_name% should be replaced with user’s data. In addition to previous parameters, proper Gate type should be specified. Only PRE and POST are allowed as Gate types. For more information, see ServiceNow Plugin Help documentation.

Correlation Display

Used only for bi-directional integration with native ServiceNow plugin "CloudBees CD". This will be used to correlate CloudBees CD with ServiceNow. For bi-directional integration this is mandatory information. For example, this field would have value "ElectricFlow Flow Pipeline Task" for Gate approval use-case. For additional flexibility and options, see ServiceNow Plugin Help documentation.

Change Task Details

Specify values for various ServiceNow Change Task fields using JSON format. For e.g. {"description": "This is change task description", "comments":"This is a comment"}

Change Request ID

A change request where new change task will be assigned. Accepts sys_id and change request number.

Result Property Sheet

Property sheet where procedure results should be saved.

Output parameters

Table 13. Create Change Task output parameters
Parameter Description

Change Task Data

Data of the Change Task

Change Task Number

Change Task Number

Change Task Id

Id of the Change Task

Change Request Id

Id of the Change Request

Change Request Number

Change Request Number

Create Incident

Creates an incident in ServiceNow.

Input parameters

Table 14. Create Incident input parameters
Parameter Description

Configuration name

Required. The previously defined configuration for the plugin.

Short description

Required. Short description of the incident.

Assignee

User or group to which the incident is assigned.

Impact

Impact an incident has on business.

Urgency

Extent to which the incident’s resolution can be delayed.

Content

JSON representation of the request content. To add a description, use the following JSON: {"description" : "Sample Description"}

PropertySheet for procedure result

Property sheet where the procedure results should be saved.

Create Record NextGen

Input parameters

Table 15. Create Record NextGen input parameters
Parameter Description

Configuration name

Required. The previously defined configuration for the plugin.

Table:

Required. null

Short Description:

Use Input Display Values:

Content:

Required. null

Display Values:

Output parameters

Table 16. Create Record NextGen output parameters
Parameter Description

SysID

Sys Id of the created record

ResponseContent

response from the server

Delete Incident

Deletes Incident in ServiceNow.

Input parameters

Table 17. Delete Incident input parameters
Parameter Description

Configuration name

Required. The previously defined configuration for the plugin.

Sys ID

Required. Sys ID of the incident.

Delete Record NextGen

Input parameters

Table 18. Delete Record NextGen input parameters
Parameter Description

Configuration name

Required. The previously defined configuration for the plugin.

Table:

Required. null

Sys ID:

Required. null

Get Change Request Templates

Retrieves available change request templates from ServiceNow.

Input parameters

Table 19. Get Change Request Templates input parameters
Parameter Description

Configuration name

Required. The previously defined configuration for the plugin.

Template Type

Filter templates by type. Select "All Templates" to retrieve all available change request templates.

Result Property Sheet

Property sheet where procedure results should be saved.

Output parameters

Table 20. Get Change Request Templates output parameters
Parameter Description

Templates

JSON array of available templates with their details

Template Count

Total number of templates found

Get Change Tasks

Retrieve change tasks from ServiceNow Change Tasks table.

Input parameters

Table 21. Get Change Tasks input parameters
Parameter Description

Configuration name

Required. The previously defined configuration for the plugin.

Change Task Retrieval Type

Required. A type which will be used for change task retrieval.

Record ID

A Record Id of ServiceNow ChangeTask to retrieve.

Change Request Record ID

Get Change Tasks attached to provided Change Request.

ServiceNow QL

A ServiceNow QL query, that could be copied in ServiceNow instance table navigation by "Copy query" link. For example, change_request=b05c24bd1b2c6290e20e553f034bcb9f

Result Property Sheet

Property sheet where procedure results should be saved.

Output parameters

Table 22. Get Change Tasks output parameters
Parameter Description

Change Tasks

Change Tasks

Get Records NextGen

Get Records NextGen from ServiceNow.

Input parameters

Table 23. Get Records NextGen input parameters
Parameter Description

Configuration name

Required. The previously defined configuration for the plugin.

Table

Required. null

Retrieval Type

Required. null

Sys IDs

Numbers

ServiceNow QL

Get Display Values

Output parameters

Table 24. Get Records NextGen output parameters
Parameter Description

ResponseContent

Response from the server

SysID

Sys Id of the retrieved record

GetRecord

Get Records from ServiceNow.

Input parameters

Table 25. GetRecord input parameters
Parameter Description

Configuration name

Required. The previously defined configuration for the plugin.

Record ID

Required. null

Filter

PropertySheet for procedure result

Property sheet where procedure results should be saved.

Polling

Polling to check the status of a change request.

Input parameters

Table 26. Polling input parameters
Parameter Description

Configuration name

Required. The previously defined configuration for the plugin.

Change Request ID or number

Required. Enter the Change Request record ID or number of an existing request to check its approval status.

Target state

Required. Change Request desired end state.

Termination condition

Required. Termination condition — the polling process stops when the desired Change Request state is reached, the polling count is exceeded, or the timeout is hit.

Polling count

Required. Maximum number of times to poll before stopping.

Polling timeout

Required. The maximum time before stopping the polling process, regardless of the result.

Polling interval unit

Required. Select the unit of time to wait between polling attempts.

Polling interval

Required. Interval to wait between polling based on Polling interval unit selected.

Set Change Request Status

Sets the status of one or more change requests.

Input parameters

Table 27. Set Change Request Status input parameters
Parameter Description

Configuration name

Required. The previously defined configuration for the plugin.

New State

Required. null

Number(s)

Required. Specify the Change Request number or sys_id. You can specify more than one Change Request number just by separating them by commas. You can use sys_id and number in one request. For example: CHG00001, CHG00002, d1552ef84f0e4200a94bdd211310c79f

Requested By

Specify the sys_id of user that requested the Change Request.

Assigned To

Specify the sys_id of user that requested the Change Request.

Configuration Item

Specify the sys_id of user that requested the Change Request.

Category

Priority

Risk

Type

Specify the type assigned with the Change Request.

Update Incident

Updates incident by given data.

Input parameters

Table 28. Update Incident input parameters
Parameter Description

Configuration name

Required. The previously defined configuration for the plugin.

Short description

Required. Short description of the incident.

Sys ID

Required. Sys ID of the incident.

Assignee

User or group assigned to the incident.

Impact

Effect an incident has on business.

Urgency

Extent to which the incident’s resolution can be delayed.

Content

JSON representation of the request content. To add a description, use the following JSON: {"description" : "Sample Description"}

PropertySheet for procedure result

Property sheet where the procedure results should be saved.

Update Record NextGen

Input parameters

Table 29. Update Record NextGen input parameters
Parameter Description

Configuration name

Required. The previously defined configuration for the plugin.

Sys ID:

Required. null

Table:

Required. null

Use Input Display Values:

Content:

Required. null

Display Values:

Output parameters

Table 30. Update Record NextGen output parameters
Parameter Description

ResponseContent

response from the server

Update Tasks Statuses

Sets the status of one or more tasks. 'Requested Item', 'Requested For', 'Assignment Group', 'Approval' are joined when searching, that means that if all are provided the tasks retrieved and updated will be the ones that match all parameters. If the 'Number(s)' provided retrieve tasks that are also retrieved from any of the other filters combinations, they will be only searched, updated and displayed once.

Input parameters

Table 31. Update Tasks Statuses input parameters
Parameter Description

Configuration name

Required. The previously defined configuration for the plugin.

New State

Required. Choose the new state for the changes request(s) that match the search criteria. Available states are - Pending, Open, Work in Progress, Closed Complete, Closed Incomplete and Closed Skipped.

Number(s)

Specify the Task number or sys_id. You can specify more than oneTask number just by separating them by commas.You can use sys_id and number in one request. For example: TASK00001, TASK00002, d1552ef84f0e4200a94bdd211310c79f

Requested Item

Specify the Requested Item’s sys_id associated with the task.

Requested for

Specify the sys_id of user whom is the request for.

Assignment Group

Specify the sys_id of Assignment Group associated with the task.

Approval

Choose the approval value that the task has.

UpdateRecord

Update a record in Service now

Input parameters

Table 32. UpdateRecord input parameters
Parameter Description

Configuration name

Required. The previously defined configuration for the plugin.

Record ID

Required. null

Filter

Filters must be written in JSON. For example: <code>{"number": "CR1938910"}</code>.<br/> <br/><b>NOTE:</b> All field names must be the actual field names from ServiceNow and not display names. There are references, descriptions, and use case examples for this field in the plugin documentation.

Content

Required. JSON representation of the request content. Will be used as content. To add short_description you may use next JSON: {"short_description" : "New Short Description"}

PropertySheet for procedure result

Property sheet where procedure results should be saved