{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":21272,"path":"integrate-applications/integration-hub/jenkinsv2-triggers.md","title":"Set up triggers for the Jenkins spoke","bundle":null,"doc_type":null,"release":"australia","body":"\n# Set up triggers for the Jenkins spoke\n\nSet up triggers for the Jenkins spoke for the required events. The endpoint enables webhooks to connect with your ServiceNow instance.\n\n## Before you begin\n\nRole required: admin\n\n## Configure triggers in ServiceNow instance\n\nConfigure endpoint for webhooks in the Jenkins that support the token authentication.\n\n### Before you begin\n\nRole required: flow\\_designer and connection\\_admin\n\n### Procedure\n\n1.  Navigate to **All** &gt; **Process Automation** &gt; **Workflow Studio**.\n\n2.  Click the **Integrations** tab.\n\n3.  Toggle and enable the **Inbound** connections.\n\n4.  Locate the **JenkinsV2 Spoke** endpoint and click **View Details**.\n\n    \\[Omitted image \"jenkinsv2-ext-triggers1.jpg\"\\] Alt text:\n\n5.  For the **JenkinsV2 External Trigger** end point, click **Configure**.\n\n    \\[Omitted image \"jenkinsv2-ext-triggers2.jpg\"\\] Alt text:\n\n6.  Select the user who can trigger the endpoint and click **Activate**.\n\n    \\[Omitted image \"jenkinsv2-ext-trig3.jpg\"\\] Alt text:\n\n7.  Copy the generated endpoint URL.\n\n    \\[Omitted image \"jenkinsv2-ext-trig4.jpg\"\\] Alt text:\n\n\n## Create a pipeline project in Jenkins\n\nCreate a pipeline projects in Jenkins to add the endpoint URL in `Jenkinsfile` that is generated in your ServiceNow instance and enable webhooks to connect with your ServiceNow instance.\n\n### Before you begin\n\n-   Ensure that you install Jenkin in the local environment.\n-   Ensure that Maven and GitHub are installed in the Jenkins account.\n-   Ensure that these plugins are installed in the Jenkins account.\n    -   Pipeline\n    -   Git plugin\n    -   Git client\n    -   Http request\n    -   Credentials\n    -   Warnings\n    -   Coverage\n-   In GitHub, generate a classic personal access token and copy the value.\n\n    Ensure that you select the scopes for the personal access token.\n\n    -   repo\n        -   repo:status\n        -   repo\\_deployment\n        -   public\\_repo\n        -   repo:invite\n        -   security\\_events\n    -   write:packages\n        -   read:packages\n    For more information about creating a classic personal access token, see [Creating a personal access token \\(classic\\)](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic) in [GitHub Docs](https://docs.github.com/en).\n\n    For the list of supported events, see the [Spoke triggers](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/integrate-applications/integration-hub/jenkins-spoke.md) section.\n\n-   Role required: admin\n\n### Procedure\n\n1.  From the Jenkins Dashboard, select **+ New Item**.\n\n2.  On the form, enter a name to identify the pipeline and select **Pipeline**.\n\n3.  Click **OK**.\n\n    The pipeline is created and its configuration options are displayed.\n\n4.  Under **Configure**, click **Pipeline**.\n\n5.  On the form, fill these values.\n\n<table id=\"table_yn5_yld_t3c\"><thead><tr><th>\n\nField\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nDefinition\n\n</td><td>\n\nSelect **Pipeline script from SCM**.\n\n</td></tr><tr><td>\n\nSCM\n\n</td><td>\n\nSelect **Git**.\n\n</td></tr><tr><td>\n\nRepository URL\n\n</td><td>\n\nProvide GitHub repository URL.\n\n</td></tr><tr><td>\n\nCredentials\n\n</td><td>\n\nCreate the GitHub credential record and select it.1.  Click **+Add**.\n2.  Select **Username with password** and click **Next**.\n3.  For **Username**, enter the GitHub username.\n4.  For **Password**, paste the personal access token that is generated in GitHub.\n5.  For **ID**, provide a unique ID to identify the credentials.\n6.  For **Description**, enter a description for the credentials.\n7.  Click **Create**.\n8.  Select this record for **Credentials**.\n\n\n</td></tr><tr><td>\n\nBranch Specifier \\(blank for 'any'\\)\n\n</td><td>\n\nSpecify the required branch.\n\n</td></tr><tr><td>\n\nScript path\n\n</td><td>\n\nRelative location within the checkout of your Pipeline script.**Important:** In `Jenkinsfile`, paste the endpoint URL that was generated after you configured triggers in your ServiceNow instance. For more information, see [Configure triggers in ServiceNow instance](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/integrate-applications/integration-hub/jenkinsv2-triggers.md).\n\n\\[Omitted image \"jenkinsv2-file.jpg\"\\] Alt text:\n\n</td></tr></tbody>\n</table>6.  Click **Save**.\n\n\n"}}