---
sourceDocument: Brazil Workflow Data Fabric
sourceDocumentLink: https://www.servicenow.com/docs/r/integrate-applications

 Release :

    - brazil

ft:locale :

    - en-US

ft:publication_title :

    - Brazil Workflow Data Fabric

ft:clusterId :

    - crint

bundleId :

    - crint

workflow :

    - Creator


---

# Set up a webhook for the Jenkins spoke

# Set up a webhook for the Jenkins spoke {#ariaid-title1}

Release version: Brazil  
Updated March 12, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 3 minutes to read  
Set up a webhook application to receive the required updates from Jenkins at your ServiceNow instance.

## Before you begin

Role required: admin

## Create authorization key for the Jenkins v2 spoke {#ariaid-title2}

Create a authorization key to authorise requests from Jenkins.

### Before you begin

Role required: admin.

### Procedure

1. Navigate to AllSystem DefinitionScripts - Background.
2. Enter this command in the Run script (JavaScript executed on server) text field:  
   `gs.info(GlideSecureRandomUtil.getSecureRandomString(32));`
3. Click Run Script.
4. Copy and record the generated value for later use.  
{#create-secret__steps_p3c_zbc_hlb}

## Provide authorization key for webhook {#ariaid-title3}

Authorise requests from Jenkins by providing authorization key for webhook in your
ServiceNow instance.

### Before you begin

Role required: admin

### Procedure

1. Navigate to AllJenkins v2Webhook Client Details.
2. Click New.
3. On the form, fill these values:  
   {#provide-authkey__table_ddb_ndc_hlb__entry__2}{#provide-authkey__sec-info}

   | Field | Description |
   |-|-|
   | Authorization Key | Authorization key you had generated. See [Create authorization key for the Jenkins v2 spoke](https://www.servicenow.com/docs/dvCeltyIIBvfrolmP2jq9A#create-secret "Create a authorization key to authorise requests from Jenkins.") for more information. |
   | Name | Name to identify the webhook client record. |
   [Table 1. Jenkins Webhook Client Details form]

   {#provide-authkey__table_ddb_ndc_hlb}
4. Click Submit.

## Provide authorization key in Jenkins {#ariaid-title4}

Receive updates from Jenkins by providing the authorization key in
Jenkins.

### Before you begin

Role required: admin.

### Procedure

1. Log in to your Jenkins account.
2. Click and open the job for which you want to configure your webhook.
3. Click Configure.
4. In the Bindings tab, click Add and select Jenkins.  
   For more information about the using the plugin, see [Credentials Binding](https://plugins.jenkins.io/credentials-binding/).
5. On the form, fill in the fields.  
   {#authkey-jenkins__table_rzp_ygc_hlb__entry__2}

   | Field | Description |
   |-|-|
   | Kind | Select Secret text. |
   | Secret | Enter authorization key. See [Create authorization key for the Jenkins v2 spoke](https://www.servicenow.com/docs/dvCeltyIIBvfrolmP2jq9A#create-secret "Create a authorization key to authorise requests from Jenkins.") for more information. |
   | ID | Provide unique identifier to identify the record. |
   [Table 2. Jenkins Credential Provider form]

   {#authkey-jenkins__table_rzp_ygc_hlb}
6. Click Add.
7. In the Post-build Actions tab, configure task and specify script to receive updates at your ServiceNow instance.  
   * Sample Windows Script: `curl
     "https://<instance-name>.service-now.com/api/sn_jenkinsv2_spoke/jenkins_v2_webhook/build_status"
     -X POST -H "content-type:application/json" -H "jenkinsKey:
     %<ID>%" -d
     "{\"Job_Name\":\"%JOB_NAME%\",\"Job_Path\":\"%JOB_URL%\",\"Build_Number\":\"%BUILD_NUMBER%\"}"`
   * Sample Shell Script: `curl
     "https://<instance-name>.service-now.com/api/sn_jenkinsv2_spoke/jenkins_v2_webhook/build_status"
     -X POST -H "content-type:application/json" -H "jenkinsKey:
     ${<ID>}" -d
     "{\"Job_Name\":\"${JOB_NAME}\",\"Job_Path\":\"${JOB_URL}\",\"Build_Number\":\"${BUILD_NUMBER}\"}"`

   {#authkey-jenkins__ul_prg_wmc_hlb}  
   Note:  
   ID in the script is the ID you had provided in the Jenkins Credential Provider form.
   For more information about the using the plugin, see [Post build task](https://plugins.jenkins.io/postbuild-task/).
8. Click Apply.

## Provide description to subflow {#ariaid-title5}

Provide user friendly descriptions to the subflows in the Jenkins v2 spoke.

### Before you begin

Role required: admin.

### Procedure

1. Navigate to AllJenkins v2Webhook Answer Subflows.
2. Click New.
3. On the form, fill these values:  
   {#ans-subflow__table_jg5_3rc_hlb__entry__2}

   | Field | Description |
   |-|-|
   | Description | Description about the subflow. |
   | Subflow | Required subflow in the Jenkins v2 spoke. |
   [ ]

   {#ans-subflow__table_jg5_3rc_hlb}
4. Click Submit.

## Provide answers to the decision table {#ariaid-title6}

Provide subflows as answers to the conditions mentioned in the decision table. When
the specified conditions are met, the associated subflow is triggered.

### Before you begin

Role required: admin

### Procedure

1. Navigate to AllSystem DefinitionDecision Tables.
2. Open the record for the Jenkins v2 spoke.
3. In the Decisions tab, click New.
4. On the form, fill these values:  
   {#dec-table-ans__table_awj_xgv_z3b__entry__2}

   | Field | Description |
   |-|-|
   | Label | Unique label to identify the routing policy. |
   | Default answer | Option to specify if this is the default answer. The default answer is applicable when the conditions are not met. |
   | Condition | Conditions to be met when the required events occur in Jenkins. See [Jenkins v2 Spoke](https://www.servicenow.com/docs/EhTOF_xtnlBufutdbwal1g "Manage builds, users, settings, and jobs on the Jenkins server. Retrieve Jenkins data to use in a flow.") for information about the supported fields. |
   | Answer | Subflow that must be triggered when the specified conditions are met. 1. Click the Lookup icon (![Lookup icon]()). 2. Select the required subflow from the Document list. Note: Ensure that the Table name is <kbd class="ph userinput">Jenkins v2 Webhook Answer Subflow [sn_jenkinsv2_spoke_webhook_answer_subflow]</kbd>. {#dec-table-ans__ol_sdf_ftb_1jb} |
   [Table 3. Decision form]

   {#dec-table-ans__table_awj_xgv_z3b}
5. Click Submit.

## Customize a webhook {#ariaid-title7}

Create a webhook routing policy and customize subflow as per your
requirement.

### Before you begin

Role required: admin

### Procedure

1. Navigate to AllFlow DesignerDesigner.
2. Click Subflows.
3. Create a copy of the required default subflow.
4. Customize the Jenkins Webhook Answer Subflow: Process build information subflow as per your requirement and publish it.  
   See [Building subflows](https://www.servicenow.com/docs/access?context=subflows&version=brazil&pubname=brazil-build-workflows&ft:locale=en-US) for more information about creating and using subflows and [Jenkins v2 Spoke](https://www.servicenow.com/docs/EhTOF_xtnlBufutdbwal1g "Manage builds, users, settings, and jobs on the Jenkins server. Retrieve Jenkins data to use in a flow.") for information about the fields that the routing policies and subflows support.
5. Navigate to Jenkins v2WebHook Answer Subflows.
6. Click New.
7. On the form, fill in the fields.  
   {#cust-subflow-jenkins__table_m34_52d_hlb__entry__2}

   | Field | Description |
   |-|-|
   | Description | Description about the subflow. |
   | Subflow | Required subflow in the Jenkins v2 spoke. |
   [ ]

   {#cust-subflow-jenkins__table_m34_52d_hlb}
8. Click Submit.  
   Note:  
   These routing policies are saved in the Decision tables. Users are cautioned against directly updating or modifying data in these tables.
9. Navigate to System DefinitionDecision Tables.
10. Open the record for the Jenkins v2 spoke.
11. In the Decisions tab, click New.
12. On the form, fill these fields:  
    {#cust-subflow-jenkins__table_zhp_k2d_hlb__entry__2}

    | Field | Description |
    |-|-|
    | Label | Unique label to identify the routing policy. |
    | Default answer | Option to specify if this is the default answer. The default answer is applicable when the conditions are not met. |
    | Condition | Conditions to be met when the required events occur in Jenkins. See [Jenkins v2 Spoke](https://www.servicenow.com/docs/EhTOF_xtnlBufutdbwal1g "Manage builds, users, settings, and jobs on the Jenkins server. Retrieve Jenkins data to use in a flow.") for information about the supported fields. |
    | Answer | Subflow that must be triggered when the specified conditions are met. 1. Click the Lookup icon (![Lookup icon]()). 2. Select the required subflow from the Document list. Note: Ensure that the Table name is <kbd class="ph userinput">Jenkins v2 Webhook Answer Subflow [sn_jenkinsv2_spoke_webhook_answer_subflow]</kbd>. {#cust-subflow-jenkins__ol_sdf_ftb_1jb} |
    [Table 4. Decision form]

    {#cust-subflow-jenkins__table_zhp_k2d_hlb}
13. Click Submit.

*[\>]: and then


