A new step to integrate with ServiceNow Change Management has been added to the marketplace
The original version was explained in detail in the blog post but in short:
- Create a Change request
- Add a pending approval to your pipeline
- The pipeline will be unblocked (approved or denied) based on the status of the Change Request"
- implement state: pipeline is approved
- Change Request cancelled: pipeline denied
The new version 1.1.0 adds also the following:
- new action to update a Change Request
- new action to close a Change Request
- all parameters are now in upper case.
- rename a few parameters for consistency
- URL to the created Change Request is added to the step
Create Change Request:
createCR:
type: service-now:${{VERSION}}
title: Create Service Now Change Request
stage: deploy
arguments:
CR_ACTION: createCR
SN_USER: admin
SN_PASSWORD: '${{SN_PASSWORD}}'
SN_INSTANCE: https://INSTANCE.service-now.com
TOKEN: ${{CF_TOKEN}}
CR_DATA: >-
{
"short_description": "Application deployment to Prod",
"description": "Change for build ${{CF_BUILD_ID}}\nThis change was created by the Codefresh plugin",
"justification": "I do not need a justification\nMy app is awesome",
"cmdb_ci":"tomcat"
}
approval:
stage: deploy
description: "Approval to deploy to PROD"
type: pending-approval
timeout:
duration: 2
finalState: denied
Update an existing Change Request
modifyCR:
stage: deploy
title: "Modify the implementation plan"
type: service-now:${{VERSION}}
fail_fast: false
arguments:
CR_ACTION: updateCR
CR_SYSID: ${{CR_SYSID}}
SN_USER: admin
SN_PASSWORD: '${{SN_PASSWORD}}'
SN_INSTANCE: https://INSTANCE.service-now.com
CR_DATA: '{"implementation_plan":"The implementation has been approved."}'
Close an existing Change Request
closeCR:
type: service-now:${{VERSION}}
title: Close Service Now Change Request
stage: post
arguments:
CR_ACTION: closeCR
CR_SYSID: ${{CR_SYSID}}
SN_USER: admin
SN_PASSWORD: '${{SN_PASSWORD}}'
SN_INSTANCE: https://INSTANCE.service-now.com
CR_CLOSE_CODE: "successful"
CR_CLOSE_NOTES: "Closed automatically by Codefresh build ${{CF_BUILD_ID}}"
CR_DATA: '{"work_notes":"this is a message for the work notes"}'