{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":32239,"path":"it-service-management/devops-change-velocity/update-jenkins-change-reject-reason.md","title":"Notify change request rejection or cancellation reason to Jenkins pipeline","bundle":null,"doc_type":null,"release":"australia","body":"\n# Notify change request rejection or cancellation reason to Jenkins pipeline\n\nSend change request rejection or cancellation reason along with approver name and the change request number to Jenkins pipeline logs.\n\n## Before you begin\n\n-   Ensure that you have upgraded to ServiceNow DevOps version 1.28 or later.\n-   Have an active Jenkins integration.\n\nRole required: sn\\_devops.admin\n\n## About this task\n\nYou can send change request rejection or cancellation reasons or comments to the Jenkins pipeline logs.\n\n-   Ensure that you enter appropriate reasons or comments when rejecting or canceling a Change Request manually.\n-   If you have loaded demo data during upgrade, and are using the DevOps Demo Change Automation flow or a custom flow based on it, a notification with default message values is sent to the Jenkins pipeline logs.\n\n**Note:**\n\n-   The Change request number is also automatically sent to the Jenkins pipeline logs \\(for both scripted and freestyle pipelines\\) as soon as the change is created.\n-   The **Approver name** and time stamp of the cancellation/rejection is also automatically sent to the Jenkins pipeline logs.\n\n## Procedure\n\n1.  To manually reject or cancel change requests, follow these steps:\n\n    1.  Navigate to **DevOps** &gt; **Orchestrate** &gt; **Pipeline Change Requests** &gt; **Change Request record**.\n\n    2.  Open the required Change Request record.\n\n    -   From the context menu, click **Cancel Change**. In the **Cancel Change Request &gt; Reason** field, enter an appropriate reason for cancelling the change, and click **Save**.\n    -   In the Approvers related list, provide your inputs in the **Comment** field, right-click the record, and click **Reject**.\n    The change request is canceled/rejected and the reason for canceling the change is added to the **Comments** field and sent to the Jenkins pipeline log.\n\n2.  To send custom messages \\(from auto-rejected change requests\\) to Jenkins, follow these steps:\n\n    1.  Navigate to **Flow Designer** &gt; **DevOps Demo Change Automation flow** &gt; **DevOps Demo Change Policy**.\n\n    2.  Navigate to the **DevOps Auto Reject** decision &gt;**DevOps Apply Change Approval Definition** subflow &gt; **Devops Create Auto Approval Record** action.\n\n    3.  Modify the action's input script for the `approval.comments` attribute value.\n\n    By default, the auto-rejected change requests stores and sends the `approval.comments = 'Auto ' + state + ' via Change Policy';` variables as messages to the Jenkins pipeline as notifications.\n\n3.  In Jenkins, navigate to the pipeline \\(that is corresponding to the rejected change request\\), and then select **Console Output**.\n\n    The Change Request's rejection or cancellation comments that are stored as part of the step execution reflect in the Jenkins Console Output.\n\n\n"}}