You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- sndevopscli create change -p '{"changeStepDetails":{"timeout":3600,"interval":100},"attributes":{"short_description":"Automated Software Deployment","description":"Automated Software Deployment.","assignment_group":"XXXXXXX","implementation_plan":"Software update is tested and results can be found in Test Summaries Tab.","backout_plan":"When software fails in production, the previous software release will be re-deployed.","test_plan":"Testing if the software was successfully deployed or not"}}'
127
147
148
+
149
+
-p: [optional]
150
+
Change Attributes payload in JSON format
151
+
152
+
-ctx: [optional]
153
+
Additional context parameters in JSON format. These details will be used to build the request for the DevOps Change API
154
+
155
+
-w: [optional]
156
+
Specify for the pipeline to wait for change creation and approval. By default, the pipeline will be waiting until the change creation and it's approval
This specifies the branch on which the Sonar scan was executed. By default, it matches the branch for which the build was run. Note, for Harness, the branch option is required if CI_COMMIT_BRANCH is not provided.
196
+
197
+
```
198
+
199
+
**Example of Registring Security scan results in ServiceNow via commandline**
200
+
```yaml
201
+
202
+
This custom step needs to be added at job level to register security scan results in ServiceNow instance.
It the payload of security result attributes. The payload will have attributes as follows:
216
+
buildNumber: CI_PIPELINE_ID (mandatory)
217
+
pipelineExecutionUrl: CI_PIPELINE_URL (mandatory)
218
+
scanner: Scanning tool and is required e.g. Checkmarx One.
219
+
projectName/projectId: Name/Id of your Checkmarx One project and is required. This attribute is applicable only for Checkmarx One.
220
+
applicationName: Name of your Veracode application and is required. This attribute is applicable only for Veracode.
221
+
buildVersion": Veracode Scan name / build version and is optional. This attribute is applicable only for Veracode.
222
+
scanId: Checkmarx One scan id and is optional. This attribute is applicable only for Checkmarx One.
223
+
securityToolId: Security tool onboarded in ServiceNow (sys_id of the onboarded security tool) and is optional.
224
+
164
225
```
165
226
166
227
**Example of get change for ServiceNow via commandline**
@@ -173,7 +234,7 @@ stages:
173
234
174
235
ServiceNow DevOps Get Change:
175
236
stage: DevOpsGetChange
176
-
image: servicenowdocker/sndevops:4.0.0
237
+
image: servicenowdocker/sndevops:5.1.0
177
238
script:
178
239
- sndevopscli get change -p "{\"buildNumber\":${CHG_JOB_ID},\"stageName\":\"ServiceNow DevOps Change Step\",\"pipelineName\":\"GitlabDockerGetAndUpdateChange\"}"
179
240
@@ -209,9 +270,9 @@ stages:
209
270
210
271
ServiceNow DevOps Update Change:
211
272
stage: DevOpsUpdateChangeStage
212
-
image: servicenowdocker/sndevops:4.0.0
273
+
image: servicenowdocker/sndevops:5.1.0
213
274
script:
214
-
- sndevopscli update change -n 'CHGXXXXXX' -p "{\"short_description\":\"G Venkata12345 Automated Software Deployment\",\"description\":\"Automated Software Deployment.\",\"assignment_group\":\"XXXXX\",\"implementation_plan\":\"Software update is tested and results can be found in Test Summaries Tab.\",\"backout_plan\":\"When software fails in production, the previous software release will be re-deployed.\",\"test_plan\":\"Testing if the software was successfully deployed or not\"}"
275
+
- sndevopscli update change -n 'CHGXXXXXX' -p "{\"short_description\":\"Automated Software Deployment\",\"description\":\"Automated Software Deployment.\",\"assignment_group\":\"XXXXX\",\"implementation_plan\":\"Software update is tested and results can be found in Test Summaries Tab.\",\"backout_plan\":\"When software fails in production, the previous software release will be re-deployed.\",\"test_plan\":\"Testing if the software was successfully deployed or not\"}"
215
276
216
277
-n [Not mandatory if we have sndevopschg.json in our pipeline yml]: It stands for changeRequestNumber. The change request number to identify a unique change request.
217
278
Precedence of choosing changeRequestNumber:
@@ -236,9 +297,9 @@ stages:
236
297
237
298
ServiceNow DevOps Change Step:
238
299
stage: changeapproval
239
-
image: servicenowdocker/sndevops:4.0.0
300
+
image: servicenowdocker/sndevops:5.1.0
240
301
script:
241
-
- sndevopscli create change -p "{\"changeStepDetails\":{\"timeout\":3600,\"interval\":100},\"autoCloseChange\":true,\"attributes\":{\"short_description\":\"G Venkata Automated Software Deployment\",\"description\":\"Automated Software Deployment.\",\"assignment_group\":\"xxxxxxxx\",\"implementation_plan\":\"Software update is tested and results can be found in Test Summaries Tab.\",\"backout_plan\":\"When software fails in production, the previous software release will be re-deployed.\",\"test_plan\":\"Testing if the software was successfully deployed or not\"}}"
302
+
- sndevopscli create change -p "{\"changeStepDetails\":{\"timeout\":3600,\"interval\":100},\"autoCloseChange\":true,\"attributes\":{\"short_description\":\"Automated Software Deployment\",\"description\":\"Automated Software Deployment.\",\"assignment_group\":\"xxxxxxxx\",\"implementation_plan\":\"Software update is tested and results can be found in Test Summaries Tab.\",\"backout_plan\":\"When software fails in production, the previous software release will be re-deployed.\",\"test_plan\":\"Testing if the software was successfully deployed or not\"}}"
sndevopscli create change -p "{\"changeStepDetails\":{\"timeout\":3600,\"interval\":10},\"autoCloseChange\":true,\"attributes\":{\"short_description\":\"G Venkata Automated Software Deployment\",\"description\":\"Automated Software Deployment.\",\"assignment_group\":\"a715cd759f2002002920bde8132e7018\",\"implementation_plan\":\"Software update is tested and results can be found in Test Summaries Tab.\",\"backout_plan\":\"When software fails in production, the previous software release will be re-deployed.\",\"test_plan\":\"Testing if the software was successfully deployed or not\"}}"
46
+
47
+
ServiceNowUpdateDevOpsChange:
48
+
runs-on: ubuntu-latest
49
+
needs: ServiceNowDevOpsChange
50
+
container:
51
+
image: servicenowdocker/sndevops:5.1.0
52
+
env:
53
+
CI_JOB_NAME: "ServiceNowDevOpsChange"
54
+
55
+
steps:
56
+
- name: update change
57
+
run: |
58
+
sndevopscli update change -p "{\"short_description\":\"Updated Automated Software Deployment\",\"description\":\"Automated Software Deployment.\",\"assignment_group\":\"a715cd759f2002002920bde8132e7018\",\"implementation_plan\":\"Software update is tested and results can be found in Test Summaries Tab.\",\"backout_plan\":\"When software fails in production, the previous software release will be re-deployed.\",\"test_plan\":\"Testing if the software was successfully deployed or not\"}"
0 commit comments