The following plugin provides functionality available through Pipeline-compatible steps. Read more about how to integrate steps into your Pipeline in the Steps section of the Pipeline Syntax page.

For a list of other such plugins, see the Pipeline Steps Reference page.

ServiceNow DevOps Plugin

snDevOpsArtifact: ServiceNow DevOps - Register Artifact step

Artifact registration
Configure artifact registration in a scripted pipeline or freestyle job using th DevOps API/artifact/registration endpoint. Multiple artifact versions are supported.

  • artifactsPayload : String (optional)
    ArtifactPayload
    "name" --> Artifact name for which different builds (artifact versions) are generated.
    "version" --> Specific version of the artifact. Deployable component of an application generated by a CI build. When provided, semantic version is used.
    "semanticVersion" --> Optional attribute of an artifact version that, when provided, is used to determine commits for a change. Semantic version format is (MAJOR.MINOR.PATCH).
    "repository" --> Target for artifacts generated in a build, and also a source of artifacts required by a build.


    Example:
    {"artifacts":[{"name": "sa-web.jar", "version": "1.9", "repositoryName": "services-1031"}, {"name": "sa-db.jar", "version": "1.3.2", "repositoryName": "services-1032"}], "branchName": "master"}
  • enabled : boolean (optional)
    Enabled specifies the setting for build notifications property (true/false)
  • ignoreErrors : boolean (optional)
    ignoreErrors specifies the setting to prevent job failure if there is an error (true/false)

snDevOpsChange: ServiceNow DevOps - Change Control step

snDevOpsChange
Enables change control for each root-level stage that is mapped to a DevOps step.

  • applicationName : String (optional)
  • changeRequestDetails : String (optional)
    changeRequestDetails specifies closure code and change request fields from within the pipeline (starting with version 1.24).

    Example:

    { "attributes": { "short_description": "Test description", "priority": "1", "start_date": "2021-02-05 08:00:00", "end_date": "2022-04-05 08:00:00", "justification": "test justification", "description": "test description", "cab_required": <true/false>, "comments": "This update for work notes is from jenkins file", "work_notes": "test work notes", "assignment_group": "<SYS_ID>" }, "setCloseCode": <true/false> }

  • enabled : boolean (optional)
    Enabled specifies the setting for build notifications property (true/false)
  • ignoreErrors : boolean (optional)
    ignoreErrors specifies the setting to prevent job failure if there is an error (true/false)
  • snapshotName : String (optional)

snDevOpsConfigExport: ServiceNow DevOps - DevOps Configuration Export

  • applicationName : String (optional)
  • deployableName : String (optional)
  • exporterName : String (optional)
  • exporterFormat : String (optional)
  • fileName : String (optional)
  • enabled : boolean (optional)
  • exporterArgs : String (optional)
  • ignoreErrors : boolean (optional)
  • markFailed : boolean (optional)
  • showResults : boolean (optional)
  • snapshotName : String (optional)

snDevOpsConfigGetSnapshots: ServiceNow DevOps - Get latest and validated snapshots

  • deployableName : String
  • changesetNumber : String
  • applicationName : String (optional)
  • enabled : boolean (optional)
  • ignoreErrors : boolean (optional)
  • isValidated : boolean (optional)
  • markFailed : boolean (optional)
  • outputFormat : String (optional)
  • showResults : boolean (optional)

snDevOpsConfigPublish: ServiceNow DevOps - DevOps Configuration Publish

  • applicationName : String
  • deployableName : String
  • snapshotName : String
  • enabled : boolean (optional)
  • ignoreErrors : boolean (optional)
  • markFailed : boolean (optional)
  • showResults : boolean (optional)

snDevOpsConfigRegisterPipeline: ServiceNow DevOps - DevOps Configuration Register Pipeline

  • applicationName : String (optional)
  • changesetNumber : String (optional)
  • enabled : boolean (optional)
  • ignoreErrors : boolean (optional)
  • markFailed : boolean (optional)
  • showResults : boolean (optional)
  • snapshotName : String (optional)

snDevOpsConfigUpload: ServiceNow DevOps - DevOps Configuration Upload

  • applicationName : String
  • target : String (optional)
  • namePath : String (optional)
  • configFile : String (optional)
  • autoCommit : boolean (optional)
  • autoValidate : boolean (optional)
  • dataFormat : String (optional)
  • appliactionName : String (optional)
  • changesetNumber : String (optional)
  • collectionName : String (optional)
  • convertPath : boolean (optional)
  • deployableName : String (optional)
  • enabled : boolean (optional)
  • ignoreErrors : boolean (optional)
  • markFailed : boolean (optional)
  • showResults : boolean (optional)

snDevOpsConfigValidate: ServiceNow DevOps - DevOps Configuration Validate

  • applicationName : String (optional)
  • deployableName : String (optional)
  • enabled : boolean (optional)
  • ignoreErrors : boolean (optional)
  • markFailed : boolean (optional)
  • showResults : boolean (optional)
  • snapshotName : String (optional)

snDevOpsGetChangeNumber: ServiceNow DevOps - get Change Number step

snDevOpsGetChangeNumber
Returns the DevOps change request number based on the inputs provided.
For more information, see click here

  • changeDetails : String (optional)
    Pipeline Name, Build Number, Stage Name are mandatory input parameters to retrieve the change request number. If these input field parameters are not provided, the change request number for the current Pipeline Name, Build Number, Stage Name will be retrieved. For multi-branch pipelines, you must provide the Branch Name as an input parameter as well. (starting with version 1.37).

    Example:

    { "pipeline_name": "Test Pipeline", "build_number": "1", "stage_name": "ChangeStage", "branch_name": "master" }

snDevOpsPackage: ServiceNow DevOps - Register Package step

Artifact package creation
Configure artifact package creation in a scripted pipeline or freestyle job using the DevOps API /package/registration endpoint.

  • name : String (optional)
    Collection of artifact versions used as input to a CD pipeline, or for associating test results.
  • artifactsPayload : String (optional)
    ArtifactPayload
    "name" --> Artifact name for which different builds (artifact versions) are generated.
    "version" --> Specific version of the artifact. Deployable component of an application generated by a CI build. When provided, semantic version is used.
    "semanticVersion" --> Optional attribute of an artifact version that, when provided, is used to determine commits for a change. Semantic version format is (MAJOR.MINOR.PATCH).
    "repository" --> Target for artifacts generated in a build, and also a source of artifacts required by a build.


    Example:
    {"artifacts":[{"name": "sa-web.jar", "version": "1.9", "repositoryName": "services-1031"}, {"name": "sa-db.jar", "version": "1.3.2", "repositoryName": "services-1032"}], "branchName": "master"}

snDevOpsStep: ServiceNow DevOps - Mapping step

  • enabled : boolean (optional)
  • ignoreErrors : boolean (optional)

snDevOpsUpdateChangeInfo: ServiceNow DevOps - Update Change Request Info

snDevOpsUpdateChangeInfo
Updates the details of the DevOps change request number provided. Returns true/false based on the status of Update (true if update is successful, else false).
For more information, see click here

  • changeRequestDetails : String (optional)
    Change request details to be updated must be provided as Key:Value pairs in the following format:
    Example:

    { "short_description": "Test description", "priority": "1", "start_date": "2021-02-05 08:00:00", "end_date": "2022-04-05 08:00:00", "justification": "test justification", "description": "test description", "cab_required": <true/false>, "comments": "This update for work notes is from jenkins file", "work_notes": "test work notes", "assignment_group": "<SYS_ID>", "state":"<STATE_CODE>", "close_code":"<successful/successful_issues/unsuccessful>", "reason":"<As per Choice List>" }

    • Key:Value pairs provided as input parameters must match with the Change_request table's field column values.
    • For choice type of fields, the field value must match with the appropriate choice value (Ex: close_code)
    • For State Transition to 'Close' of Change, 'close_code' and 'close_notes' are mandatory, and to 'Cancel' of Change, 'reason' is mandatory.

  • changeRequestNumber : String (optional)
    Change request number to be updated.

step([$class: 'DevOpsCreateArtifactPackageBuildStep']): ServiceNow DevOps - Register Package step

  • name : String (optional)
    Collection of artifact versions used as input to a CD pipeline, or for associating test results.
  • artifactsPayload : String (optional)
    ArtifactPayload
    "name" --> Artifact name for which different builds (artifact versions) are generated.
    "version" --> Specific version of the artifact. Deployable component of an application generated by a CI build. When provided, semantic version is used.
    "semanticVersion" --> Optional attribute of an artifact version that, when provided, is used to determine commits for a change. Semantic version format is (MAJOR.MINOR.PATCH).
    "repository" --> Target for artifacts generated in a build, and also a source of artifacts required by a build.


    Example:
    {"artifacts":[{"name": "sa-web.jar", "version": "1.9", "repositoryName": "services-1031"}, {"name": "sa-db.jar", "version": "1.3.2", "repositoryName": "services-1032"}], "branchName": "master"}

step([$class: 'DevOpsRegisterArtifactBuildStep']): ServiceNow DevOps - Register Artifact step

  • artifactsPayload : String (optional)
    ArtifactPayload
    "name" --> Artifact name for which different builds (artifact versions) are generated.
    "version" --> Specific version of the artifact. Deployable component of an application generated by a CI build. When provided, semantic version is used.
    "semanticVersion" --> Optional attribute of an artifact version that, when provided, is used to determine commits for a change. Semantic version format is (MAJOR.MINOR.PATCH).
    "repository" --> Target for artifacts generated in a build, and also a source of artifacts required by a build.


    Example:
    {"artifacts":[{"name": "sa-web.jar", "version": "1.9", "repositoryName": "services-1031"}, {"name": "sa-db.jar", "version": "1.3.2", "repositoryName": "services-1032"}], "branchName": "master"}

Was this page helpful?

Please submit your feedback about this page through this quick form.

Alternatively, if you don't wish to complete the quick form, you can simply indicate if you found this page helpful?

    


See existing feedback here.