Nexus · test management for Jira
Menu
Get started

Connect your CI pipeline to Nexus

Configure Nexus once, add an upload step to your existing pipeline, then check the first result in Jira. Your tests continue to run in your CI environment. No Nexus plugin needs to be installed on your CI server.

You will need: a configured Nexus project, permission to manage its CI keys, access to your pipeline settings, and an existing test job. The upload examples use a Linux runner with Node.js 22 available. Keep your existing checkout, dependency installation and test steps.

If your tests do not produce a results file yet, use the automation setup guide first. If you already use the Nexus Playwright reporter or pytest plugin, give that test job the Nexus environment variables below; do not add a second upload for the same results.

Configure Nexus

  1. Open your Jira project, then Project settings → Nexus → CI.
  2. Create an API key with a recognisable label, such as GitHub staging. Choose the ingest permission for result uploads if the scope selector is available. Copy the key now: it is shown only once.
  3. Copy the results URL from the same page. This is the complete endpoint, not your Jira site address. Do not use the separate CI API URL for a results-file upload.
  4. Open an existing Test Case and copy its Automation Key. Put that key in the automated test's name, for example NEX-123: customer can sign in. Use a case in this project that is ready to run, rather than an obsolete case.
  5. Note your Jira project key and the environment you want the results associated with. The examples use NEX and staging; replace them with your values.
Setting in your CI platform Value to use Where it comes from
NEXUS_URL The complete results URL Nexus project CI settings
NEXUS_API_KEY The key you just created; store it as a secret Nexus project CI settings
--project NEX in the command Your Jira project key Your Jira project
--environment staging in the command Your target environment name or configured alias Your test environment
results.xml in the command The report file your job actually writes Your test tool's reporter configuration

The project key and report filename are ordinary configuration. The API key is a secret: never commit it, put it in a URL or print it in job logs.

Prepare your test report

Run one small test locally or in your existing pipeline. Configure its reporter to write a supported report file, and check that the file exists after the run. The automation guide gives the commands for each framework and shows where to place the Automation Key.

The snippets below upload results.xml. For Cucumber or Mocha JSON, replace that filename with your actual .json report. The upload CLI detects supported formats. If tests produce several XML files, upload each file separately; do not concatenate XML documents.

Download the upload CLI, save it as nexus-upload.mjs in the root of your test repository, and commit that file with your pipeline change. It has no package dependencies. Check the download against the published checksums if your organisation requires download verification.

Ready to continue: the pipeline checks out nexus-upload.mjs, has Node.js available, and produces a report with at least one test whose key matches an existing Nexus Test Case. Use fresh report output for each job so you cannot accidentally upload a stale file from an earlier run.

Configure your CI platform

Open the instructions for your platform. These are additions to an existing working test pipeline, not replacement pipelines. Run the uploader in the same job and working directory as the report; if you use a separate job, transfer the report as an artifact first.

GitHub Actions

Store the two secrets

In the repository, open Settings → Secrets and variables → Actions and create repository secrets named NEXUS_URL and NEXUS_API_KEY. Use the values copied from Nexus. Secrets may not be available to workflows from forked pull requests; start with a trusted branch in your own repository.

Add the upload step

Edit the workflow under .github/workflows/. Add this item to the existing job's steps, immediately after the test step. The job must already check out the repository and provide Node.js.

- name: Send test results to Nexus
  if: ${{ always() }}
  env:
    NEXUS_URL: ${{ secrets.NEXUS_URL }}
    NEXUS_API_KEY: ${{ secrets.NEXUS_API_KEY }}
  run: node nexus-upload.mjs results.xml --project NEX --environment staging

always() allows the upload step to run after a test failure. An upload error fails this step; it does not convert a failed test job into a pass. If an earlier setup error prevented report creation, the uploader reports the missing file.

See GitHub's secret configuration and status conditions. Prefer the packaged action? Its installation instructions include where to place the downloaded action files.

GitLab CI

Store the two variables

Open Settings → CI/CD → Variables. Add NEXUS_URL and NEXUS_API_KEY; mask the key and hide it where that option is available. If you mark a variable protected, test from a protected branch or tag that is allowed to receive it.

Add the upload command

In .gitlab-ci.yml, add after_script to your existing test job. If it already has an after_script, append this command instead of creating a second block. Keep the existing job image, test script and dependency setup, and make sure Node.js is installed in that image.

after_script:
  - node nexus-upload.mjs results.xml --project NEX --environment staging

GitLab runs after_script in a fresh shell, so define secrets in the CI/CD settings rather than relying on variables exported by the test script. The report remains in the job's working directory.

Check this job's upload log: an after_script failure does not change a successful job's exit status. A green pipeline is therefore not proof of successful delivery. Test failures remain failures. Timeouts and runner failures may prevent the upload from running.

See GitLab's after_script behaviour.

Jenkins

Store the credentials

In the Jenkins credential store accessible to your pipeline, add two Secret text credentials. Set their IDs to nexus-url and nexus-api-key, containing the results URL and API key respectively.

Add the post-build upload

Inside your existing Declarative pipeline { ... }, add this post block after stages. If there is already a post { always { ... } } block, merge these steps into it. This example needs a Unix/Linux agent, Node.js and Jenkins Credentials Binding.

post {
  always {
    withCredentials([
      string(credentialsId: 'nexus-url', variable: 'NEXUS_URL'),
      string(credentialsId: 'nexus-api-key', variable: 'NEXUS_API_KEY')
    ]) {
      sh 'node nexus-upload.mjs results.xml --project NEX --environment staging'
    }
  }
}

For Maven Surefire, replace the sh line with the following block. It checks that reports exist and uploads each XML file; it stops on an upload error.

sh '''
  set -e
  for report in target/surefire-reports/TEST-*.xml; do
    test -f "$report" || { echo "No Surefire XML reports found"; exit 2; }
    node nexus-upload.mjs "$report" --project NEX --environment staging
  done
'''

Single-quoted Groovy strings let the uploader read credentials from the environment. Keep the test stage's original failure status; do not add || true to hide test failures. For Windows agents, use the corresponding bat or PowerShell step rather than sh.

See Jenkins credentials and pipeline guidance.

Azure Pipelines

Store the variables

In your pipeline's Variables, add NEXUS_URL and NEXUS_API_KEY. Mark the key secret. If using a variable group, link it to the pipeline and authorise the pipeline to use it.

Add the upload step

In azure-pipelines.yml, append this item to the existing job's steps after the test step. Use a Linux agent with Node.js, and keep your current checkout and test setup.

- bash: node nexus-upload.mjs results.xml --project NEX --environment staging
  displayName: Send test results to Nexus
  condition: succeededOrFailed()
  env:
    NEXUS_URL: $(NEXUS_URL)
    NEXUS_API_KEY: $(NEXUS_API_KEY)

Azure secret variables must be explicitly mapped into the script's environment. succeededOrFailed() runs the upload after success or failure, but not after cancellation. An upload error fails the step.

See Azure's variable and secret settings.

Bitbucket Pipelines

Store the repository variables

Open Repository settings → Pipelines → Repository variables. Add NEXUS_URL and NEXUS_API_KEY, marking the key Secured. If you use deployment variables instead, make sure the step is assigned to that deployment environment.

Add the upload command

In bitbucket-pipelines.yml, add this after-script to the same step that runs your tests, alongside its existing script. Append to an existing after-script block if it has one. The step image must have Node.js installed.

after-script:
  - node nexus-upload.mjs results.xml --project NEX --environment staging

Bitbucket runs the command after the test script succeeds or fails. A failure in after-script does not change the step's status, so inspect its output and the Nexus delivery log. A green build alone is not delivery confirmation. Runner failures can prevent the command from running.

See Bitbucket's step and after-script options.

Verify the first delivery

  1. Run a small pipeline on a branch that can access the configured secrets.
  2. Confirm the test job produced the expected report. Open the Nexus upload step and check for an accepted response. HTTP 202 means queued for processing, not that every result has been recorded.
  3. Return to Project settings → Nexus → CI and refresh the delivery log. Check the processed outcome: matched, unmatched or skipped results.
  4. Open the matched Test Case's execution history. Check its status, duration and target environment against your test output.
  5. In a safe test branch, run a deliberately failing test and confirm that its failure is also delivered. The CI test result must remain failed.

You are finished when: one known case has the expected recorded result, an intentional failure also reaches Nexus, and the team knows where to investigate delivery errors.

Troubleshooting

What you see What to check
NEXUS_API_KEY missing Exact variable name, secret access for this branch/job, and the explicit env mapping on Azure or GitHub.
401 or rejected key The key belongs to this project, has not been revoked and has the required permission. Create a replacement if necessary.
Cannot find results.xml The report path, working directory and reporter setting. If tests never started, there may be no report. Transfer artifacts when uploading from another job.
HTTP 202, but no execution Wait for processing, refresh the delivery log and inspect its matched/unmatched/skipped outcome.
Unmatched tests The reported test names contain Automation Keys that exist in this Nexus project. Check the report itself, not just your source code.
Duplicate runs Choose one uploader: reporter/plugin or a pipeline upload. Do not send the same report through both.
400 The file is a supported report, not HTML, console output or several XML documents concatenated together.
413 Check payload/result limits in the API reference. Split large reports; if the project is being rate-limited, reduce the upload rate.
Pipeline is green but no results arrive Inspect upload output, especially GitLab and Bitbucket post-test commands, whose failures do not fail an otherwise successful job.

For help, contact support with the platform, upload timestamp and error message. Do not include the API key.

Optional settings and next steps

Start with the project and environment. Once the first delivery works, add --test-set NEX-25 to record against a specific cycle, or --component web to identify a component. Replace example keys with your own. The CLI reads build/commit metadata from common CI environment variables; --build and --commit can override them.

Keep result-file ingestion separate from CI API operations such as recording a deployment: those use the CI API URL, an appropriate key scope and a JSON operation body. See the API reference for that configuration, request limits and all supported formats.