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.
snDevOpsArtifact
: ServiceNow DevOps - Register Artifact stepsnDevOpsChange
: ServiceNow DevOps - Change Control stepsnDevOpsConfig
: ServiceNow DevOps - DevOps Configuration PipelinesnDevOpsConfigExport
: ServiceNow DevOps - DevOps Configuration ExportsnDevOpsConfigGetSnapshots
: ServiceNow DevOps - Get latest and validated snapshotssnDevOpsConfigPublish
: ServiceNow DevOps - DevOps Configuration PublishsnDevOpsConfigRegisterPipeline
: ServiceNow DevOps - DevOps Configuration Register PipelinesnDevOpsConfigUpload
: ServiceNow DevOps - DevOps Configuration UploadsnDevOpsConfigValidate
: ServiceNow DevOps - DevOps Configuration ValidatesnDevOpsGetChangeNumber
: ServiceNow DevOps - get Change Number stepsnDevOpsPackage
: ServiceNow DevOps - Register Package stepsnDevOpsSecurityResult
: ServiceNow DevOps - Register Security StepsnDevOpsStep
: ServiceNow DevOps - Mapping stepsnDevOpsUpdateChangeInfo
: ServiceNow DevOps - Update Change Request Infostep([$class: 'DevOpsCreateArtifactPackageBuildStep'])
: ServiceNow DevOps - Register Package stepstep([$class: 'DevOpsFreestyleRegisterSecurityStep'])
: ServiceNow DevOps - Register Security Stepstep([$class: 'DevOpsRegisterArtifactBuildStep'])
: ServiceNow DevOps - Register Artifact stepsnDevOpsArtifact
: 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)
configurationName : String
(optional)
enabled : boolean
(optional)
ignoreErrors : boolean
(optional)
snDevOpsChange
: ServiceNow DevOps - Change Control stepsnDevOpsChange
Enables change control for each root-level stage that is mapped to a DevOps step.
abortOnChangeCreationFailure : boolean
(optional)
abortOnChangeStepTimeOut : boolean
(optional)
applicationName : String
(optional)
changeCreationTimeOut : Object
(optional)
Timeout value in seconds. Upon timeout, Jenkins checks the Change creation status in ServiceNow and if it failed to create the CHG, it resumes or aborts the pipeline based on the flag abortOnChangeCreationFailure. By default it aborts, when timeout is specified.
changeRequestDetails : String
(optional)
{ "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> }
changeStepTimeOut : Object
(optional)
Timeout value in seconds. Upon timeout, if the Change step is still in progress, it resumes or aborts the pipeline based on the flag abortOnChangeStepTimeout. By default it aborts, when timeout is specified.
configurationName : String
(optional)
enabled : boolean
(optional)
ignoreErrors : boolean
(optional)
pollingInterval : Object
(optional)
snapshotName : String
(optional)
snDevOpsConfig
: ServiceNow DevOps - DevOps Configuration PipelineapplicationName : String
target : String
namePath : String
configFile : String
autoCommit : String
(optional)
autoDelete : String
(optional)
autoPublish : String
(optional)
autoValidate : String
(optional)
changesetNumber : String
(optional)
collectionName : String
(optional)
continueWithLatest : boolean
(optional)
convertPath : boolean
(optional)
dataFormat : String
(optional)
deployableName : String
(optional)
enabled : boolean
(optional)
ignoreErrors : boolean
(optional)
isValidated : boolean
(optional)
markFailed : boolean
(optional)
showResults : boolean
(optional)
testResultFormat : String
(optional)
snDevOpsConfigExport
: ServiceNow DevOps - DevOps Configuration ExportsnDevOpsConfigExport( applicationName: 'PaymentDemo', deployableName: 'Production', snapshotName: 'Production-v23.dpl', exporterFormat: 'yaml', exporterName: 'returnAllData-now', exporterArgs: '', fileName: 'exported_file-Production-20220302.yml' )
applicationName : String
deployableName : String
exporterName : String
exporterFormat : String
fileName : String
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 snapshotsWhen config files are uploaded to an application data model, the system will create snapshots for any deployables determined to be impacted by the upload. Following along the CI flow, assuming the last Upload call had validation enabled, the next step would be to iterate through the list of snapshots and ensure they all passed validation.
Following the CD flow, a specific snapshot is retrieved so it can be published and then exported to be consumed downstream (for example, to provision out infrastructure or application).
View policy validation results as test results on the Jenkins build tests results page, including compliant with exception, when getting a snapshot.
$snapshots = snDevOpsConfigGetSnapshots( applicationName: 'PaymentDemo', deployableName: 'Production', changesetNumber: 'Chset-16' )
$snapshots = snDevOpsConfigGetSnapshots( applicationName: 'PaymentDemo', deployableName: 'Production', isValidated: 'true' )
$snapshots = snDevOpsConfigGetSnapshots( applicationName: 'PaymentDemo', changesetNumber: 'Chset-16', )
stage('Validate') { steps { script { changeSetResults = snDevOpsConfigGetSnapshots( … ) if (!changeSetResults) { echo "No snapshots were created" } else { def changeSetResultsObject = readJSON text: changeSetResults changeSetResultsObject.each { snapshotName = it.name snapshotObject = it } // STEP 1 validationResultsPath = "${snapshotName}_${currentBuild.projectName}_${currentBuild.number}.xml" } } } } post { always { // STEP 2 junit testResults: "${validationResultsPath}", skipPublishingChecks: true } }
applicationName : String
deployableName : String
(optional)
changesetNumber : String
(optional)
continueWithLatest : boolean
(optional)
enabled : boolean
(optional)
ignoreErrors : boolean
(optional)
isValidated : boolean
(optional)
markFailed : boolean
(optional)
outputFormat : String
(optional)
showResults : boolean
(optional)
snDevOpsConfigPublish
: ServiceNow DevOps - DevOps Configuration PublishsnDevOpsConfigPublish( applicationName: 'PaymentDemo', deployableName: 'Production', snapshotName: 'Production-v23.dpl', )
applicationName : String
deployableName : String
snapshotName : String
enabled : boolean
(optional)
ignoreErrors : boolean
(optional)
markFailed : boolean
(optional)
showResults : boolean
(optional)
snDevOpsConfigRegisterPipeline
: ServiceNow DevOps - DevOps Configuration Register PipelineThis action ties a changeset and/or snapshot to the pipeline so that it can be tracked during the pipeline execution. In DevOps Change Velocity, this is shown in the Pipeline UI.
See Accelerating your DevOps change process for more information regarding the DevOps Change Acceleration feature.
Example:Here is an example of the snDevOpsConfigRegisterPipeline action. For the sake of illustration, we’ll assign the response to a variable, changeSetRegResult, which could be echoed out to our console log for debugging scenarios.
changeSetRegResult = snDevOpsConfigRegisterPipeline( applicationName: "PaymentDemo", changesetNumber: "Chset-122" ) echo "Pipeline registration result: ${changeSetRegResult}"
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 UploadThis action uploads a configuration file to a given location within an application data model.
It is meant to be used in an iterative nature for all config files to upload to the application data model during the pipeline run.
Here is an example of the snDevOpsConfigUpload action. For the sake of illustration, we’ll assign the response to a variable, changeSetId, which could be echoed out to our console log for debugging scenarios.
changeSetId = snDevOpsConfigUpload( applicationName: "PaymentDemo", target: 'component', namePath: "web-api-v1.0", configFile: "k8s/helm/values.yml", dataFormat: "json", autoCommit: 'true', autoDelete: 'true', autoValidate: 'true' ) echo "Changeset: $changeSetId created"
$changeset = snDevOpsConfigUpload( applicationName: 'PaymentDemo', target: 'component', namePath: 'wep-api-v1.0', configFile: 'k8s/helm/values.yml', dataFormat: 'yaml', autoCommit: 'false', autoDelete: 'false', autoValidate: 'false' )
snDevOpsConfigUpload( applicationName: 'PaymentDemo', target: 'component', namePath: 'wep-api-v1.0', configFile: 'infra/*.json', dataFormat: 'json', autoCommit: 'false', autoDelete: 'false', autoValidate: 'false', changesetNumber: ”${changeset}” )
snDevOpsConfigUpload( applicationName: 'PaymentDemo', target: 'component', namePath: 'wep-api-v1.0', configFile: 'featureToggles/set1.ini', dataFormat: 'ini', autoCommit: 'true', autoDelete: 'true', autoValidate: 'true', changesetNumber: ”${changeset}” )
$changeset = snDevOpsConfigUpload( applicationName: 'PaymentDemo', target: 'collection', collectionName: 'release-v1.0', namePath: 'v1-common-configs', configFile: 'infra/v1/config.xml', dataFormat: 'xml', autoCommit: 'false', autoDelete: 'false', autoValidate: 'false' )
snDevOpsConfigUpload( applicationName: 'PaymentDemo', target: 'deployable', deployableName: 'Production', namePath: 'vars/dbSettings', configFile: 'infra/prod/dbConfig.json', dataFormat: 'json', autoCommit: 'true', autoDelete: 'true', autoValidate: 'true', changesetNumber: ”${changeset}” )
applicationName : String
target : String
namePath : String
configFile : String
autoCommit : boolean
autoDelete : boolean
autoValidate : boolean
autoPublish : boolean
changesetNumber : String
(optional)
collectionName : String
(optional)
convertPath : boolean
(optional)
dataFormat : String
(optional)
deployableName : String
(optional)
enabled : boolean
(optional)
ignoreErrors : boolean
(optional)
markFailed : boolean
(optional)
showResults : boolean
(optional)
snDevOpsConfigValidate
: ServiceNow DevOps - DevOps Configuration ValidatesnDevOpsConfigValidate( applicationName: 'PaymentDemo', deployableName: 'Production', snapshotName: 'Production-v23.dpl', )
$changeset = snDevOpsConfigValidate( applicationName: 'PaymentDemo', deployableName: 'Production' )
applicationName : String
deployableName : String
enabled : boolean
(optional)
ignoreErrors : boolean
(optional)
markFailed : boolean
(optional)
showResults : boolean
(optional)
snapshotName : String
(optional)
snDevOpsGetChangeNumber
: ServiceNow DevOps - get Change Number stepsnDevOpsGetChangeNumber
Returns the DevOps change request number based on the inputs provided.
For more information, see click here
changeDetails : String
(optional)
{ "pipeline_name": "Test Pipeline", "build_number": "1", "stage_name": "ChangeStage", "branch_name": "master" }
configurationName : String
(optional)
snDevOpsPackage
: ServiceNow DevOps - Register Package stepArtifact package creation
Configure artifact package creation in a scripted pipeline or freestyle job using the DevOps API /package/registration endpoint.
name : String
(optional)
artifactsPayload : String
(optional)
configurationName : String
(optional)
snDevOpsSecurityResult
: ServiceNow DevOps - Register Security Step
snDevOpsSecurityResults - Retrieves and stores the security scan results
securityResultAttributes : String
(optional)
configurationName : String
(optional)
snDevOpsStep
: ServiceNow DevOps - Mapping stepconfigurationName : String
(optional)
enabled : boolean
(optional)
ignoreErrors : boolean
(optional)
snDevOpsUpdateChangeInfo
: ServiceNow DevOps - Update Change Request InfosnDevOpsUpdateChangeInfo
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)
{ "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>" }
changeRequestNumber : String
(optional)
configurationName : String
(optional)
step([$class: 'DevOpsCreateArtifactPackageBuildStep'])
: ServiceNow DevOps - Register Package stepname : String
(optional)
artifactsPayload : String
(optional)
step([$class: 'DevOpsFreestyleRegisterSecurityStep'])
: ServiceNow DevOps - Register Security StepsecurityResultAttributes : String
(optional)
securityTool : String
(optional)
securityToolId : String
(optional)
step([$class: 'DevOpsRegisterArtifactBuildStep'])
: ServiceNow DevOps - Register Artifact stepartifactsPayload : String
(optional)
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.