{
    "componentChunkName": "component---src-templates-page-jsx",
    "path": "/docs/test-management/ci-cd-integrations/jenkins/",
    "result": {"data":{"markdownRemark":{"html":"<br>\n<p><strong>Integrate Jenkins with Test Management by Testsigma and automate your test runs and generate test reports.</strong></p>\n<hr>\n<p>Integrate Jenkins with Test Management by Testsigma to automate test executions and generate test reports through CI/CD pipelines. This article discusses integrating Jenkins with Test Management by Testsigma.</p>\n<hr>\n<blockquote>\n<h2 id=\"prerequisites\" style=\"position:relative;\"><a href=\"#prerequisites\" aria-label=\"prerequisites permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>Prerequisites</strong></h2>\n<p>Before you begin, ensure:</p>\n<ul>\n<li>You have a <strong>Project</strong> in Test Management by Testsigma and <strong>Test Runs</strong> are available.</li>\n<li>You have an API token from Test Management by Testsigma.</li>\n<li>You have a <strong>Jenkins</strong> account.</li>\n</ul>\n</blockquote>\n<hr>\n<h2 id=\"configuring-credentials-in-jenkins\" style=\"position:relative;\"><a href=\"#configuring-credentials-in-jenkins\" aria-label=\"configuring credentials in jenkins permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>Configuring Credentials in Jenkins</strong></h2>\n<ol>\n<li>On the <strong>Jenkins</strong> dashboard, click <strong>Manage Jenkins</strong>.</li>\n<li>Under <strong>Security</strong>, click <strong>Credentials</strong>.</li>\n<li>Under <strong>Stores scoped to Jenkins</strong>, click <strong>(global)</strong> in the <strong>Domain</strong> column.</li>\n<li>On the <strong>Global credentials</strong> page, click <strong>Add Credentials</strong>.</li>\n<li>In the <strong>Kind</strong> dropdown menu, select <strong>Secret text</strong>.</li>\n<li>In the <strong>Secret</strong> box, enter your API Token from Test Management by Testsigma.</li>\n<li>In the <strong>ID</strong> box, enter <code class=\"language-text\">TESTSIGMA_API_TOKEN</code>.</li>\n<li>Click <strong>Create</strong>.</li>\n</ol>\n<hr>\n<h2 id=\"steps-to-configure-pipeline\" style=\"position:relative;\"><a href=\"#steps-to-configure-pipeline\" aria-label=\"steps to configure pipeline permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>Steps to Configure Pipeline</strong></h2>\n<ol>\n<li>On the <strong>Jenkins</strong> dashboard, click <strong>New Item</strong>.</li>\n<li>In the <strong>Enter an item name</strong> box, enter a name for the pipeline.</li>\n<li>Select <strong>Pipeline</strong>, and click <strong>OK</strong>.</li>\n<li>On the <strong>Configuration</strong> page, scroll to the <strong>Pipeline</strong> section.</li>\n<li>In the <strong>Definition</strong> list, select <strong>Pipeline script</strong>.</li>\n<li>\n<p>In the <strong>Script</strong> box, paste the following script:</p>\n<div class=\"gatsby-highlight\" data-language=\"groovy\"><pre class=\"language-groovy\"><code class=\"language-groovy\">pipeline <span class=\"token punctuation\">{</span>\n    agent any\n    environment <span class=\"token punctuation\">{</span>\n        TESTSIGMA_API_TOKEN <span class=\"token operator\">=</span> <span class=\"token function\">credentials</span><span class=\"token punctuation\">(</span><span class=\"token string\">'TESTSIGMA_API_TOKEN'</span><span class=\"token punctuation\">)</span>\n    <span class=\"token punctuation\">}</span>\n    stages <span class=\"token punctuation\">{</span>\n        <span class=\"token function\">stage</span><span class=\"token punctuation\">(</span><span class=\"token string\">'Run Tests'</span><span class=\"token punctuation\">)</span> <span class=\"token punctuation\">{</span>\n            steps <span class=\"token punctuation\">{</span>\n                <span class=\"token comment\">// Run your test script here</span>\n                sh <span class=\"token string\">'./run-tests.sh'</span>\n            <span class=\"token punctuation\">}</span>\n        <span class=\"token punctuation\">}</span>\n        <span class=\"token function\">stage</span><span class=\"token punctuation\">(</span><span class=\"token string\">'Upload to Testsigma TMS'</span><span class=\"token punctuation\">)</span> <span class=\"token punctuation\">{</span>\n            steps <span class=\"token punctuation\">{</span>\n                <span class=\"token comment\">// Ensure the test result file exists at the specified path</span>\n                sh <span class=\"token string\">'''\n                curl --location 'https://test-management.testsigma.com/api/v1/projects/{Project_ID}/junit-import/test-run/{Run_ID}' \\\n                --header \"Authorization: Bearer $TESTSIGMA_API_TOKEN\" \\\n                --form \"junit_xml=@target/test-results/test-report.xml\"\n                '''</span>\n            <span class=\"token punctuation\">}</span>\n        <span class=\"token punctuation\">}</span>\n    <span class=\"token punctuation\">}</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n</li>\n</ol>\n<div class=\"custom-block alert alert-info\"><div class=\"custom-block-heading\"><strong>NOTE</strong>:</div><div class=\"custom-block-body\"><ul>\n<li>Replace <code class=\"language-text\">&lt;Project_ID></code> in the curl command with your Project ID, which you can retrieve using the Test Management by Testsigma APIs.</li>\n<li>Replace <code class=\"language-text\">&lt;Run_ID></code> in the curl command with the Run ID, which is available in the URL when viewing a test run in the format: <a href=\"https://test-management.testsigma.com/ui/test_runs/%7BRun_ID%7D/\">https://test-management.testsigma.com/ui/test_runs/{Run_ID}/</a></li>\n</ul></div></div>\n<ol start=\"7\">\n<li>Click <strong>Apply</strong>, and then click <strong>Save</strong>.</li>\n</ol>\n<hr>\n<h2 id=\"trigger-a-build-in-jenkins\" style=\"position:relative;\"><a href=\"#trigger-a-build-in-jenkins\" aria-label=\"trigger a build in jenkins permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>Trigger a Build in Jenkins</strong></h2>\n<ol>\n<li>On the <strong>Jenkins</strong> dashboard, click the configured pipeline.</li>\n<li>In the left navigation bar, click <strong>Build Now</strong>.</li>\n<li>Once the build completes successfully, the test case statuses in the associated test run are updated automatically in Test Management by Testsigma.</li>\n</ol>\n<hr>","frontmatter":{"title":"Jenkins Integration with Test Management by Testsigma","page_title":"Jenkins Integration with Test Management by Testsigma","metadesc":"Integrate Jenkins with TMS by Testsigma to automate test executions & generate test reports through CI/CD pipelines | Jenkins Integration with TMS by Testsigma","noindex":false,"contextual_links":[{"type":"section","name":"Contents","url":null},{"type":"link","name":"Prerequisites","url":"#prerequisites"},{"type":"link","name":"Configuring Credentials in Jenkins","url":"#configuring-credentials-in-jenkins"},{"type":"link","name":"Steps to Configure Pipeline","url":"#steps-to-configure-pipeline"},{"type":"link","name":"Trigger a Build in Jenkins","url":"#trigger-a-build-in-jenkins"}]},"fields":{"slug":"/docs/test-management/ci-cd-integrations/jenkins/"}}},"pageContext":{"slug":"/docs/test-management/ci-cd-integrations/jenkins/","prev":{"fields":{"slug":"/docs/test-management/api-reference/modules/"},"frontmatter":{"title":"API Modules for Test Management by Testsigma","metadesc":"Use API Reference for Test Management by Testsigma to manage all modules like projects, test cases, test runs, test plans, folders, step groups, & settings","canonical":null,"keywords":null,"social_share_summary":null,"social_share_desc":null,"social_share_image":null,"noindex":false}},"next":{"fields":{"slug":"/docs/test-management/ci-cd-integrations/azure-devops/"},"frontmatter":{"title":"Azure DevOps Integration with Test Management by Testsigma","metadesc":"Integrate Azure DevOps with TMS by Testsigma to automate test executions & generate test reports through CI/CD pipelines | Azure DevOps Integration with TMS by Testsigma","canonical":null,"keywords":null,"social_share_summary":null,"social_share_desc":null,"social_share_image":null,"noindex":false}}}},
    "staticQueryHashes": ["2855385900","63159454"]}