English

How do you get JUnit test results into Jira from CI?

On this page

To get JUnit test results into Jira from CI, create a project token in your test management app and post the JUnit XML file to the upload address with one curl command. ProbeTest for Jira works this way: no CLI, no plugin in your pipeline, and each upload becomes a run in a test cycle.

Why use plain curl to send JUnit results?

JUnit XML is the common output of Playwright, pytest, Jest, Maven, Gradle, TestNG and Cucumber. A plain HTTP post keeps the pipeline free of extra tooling to install, update and review. The first release of ProbeTest uploads JUnit XML this way, and the automation and CI guide keeps the full set of provider snippets.

Diagram From CI job to coverage on the story

  1. Test runPlaywright, pytest, Jest, Maven and others write JUnit XML
  2. curlPOST the file with a project token
  3. 202 or 200Accepted, or already done
  4. Matchclassname#name, or an explicit test id
  5. Cycle rowFeeds history and requirement coverage
One HTTPS post carries the report; matching by name or id does the rest.

How do you create a token?

  1. Open CI results → Setup → Create token. You need the Administer projects permission.
  2. Choose a label and, if you want one, an expiry.
  3. Copy the secret now. It starts with ptk_ and is shown once.
  4. Store three CI secrets: PROBETEST_URL (the upload address on the Setup tab), PROBETEST_STATUS_URL and PROBETEST_TOKEN.

A project can hold up to 10 tokens. Treat the URL as a secret as well.

What does the curl command look like?

RUN_ID=build-123 REF_NAME=main          # your CI's run id and branch, as environment variables
RUN_Q=$(printf %s "$RUN_ID" | tr -c "A-Za-z0-9._:-" _ | cut -c1-128)
STREAM_Q=$(printf %s "$REF_NAME" | tr -c "A-Za-z0-9._/-" _ | cut -c1-128)
curl -sS --fail --proto =https -X POST "$PROBETEST_URL?runRef=$RUN_Q&stream=$STREAM_Q" \
  -H "Authorization: Bearer $PROBETEST_TOKEN" -H "Content-Type: application/xml" \
  --data-binary @reports/junit.xml

The tr -c lines keep only characters the service accepts, so a branch name such as x&y=1;echo pwned #z cannot change the request. Never paste a CI expression for a branch name or pull request title into the script body. Map it to an environment variable first, as in this GitHub Actions step:

- name: Upload results to ProbeTest
  if: always()
  env:
    RUN_ID: ${{ github.run_id }}
    REF_NAME: ${{ github.ref_name }}
    PROBETEST_URL: ${{ secrets.PROBETEST_URL }}
    PROBETEST_TOKEN: ${{ secrets.PROBETEST_TOKEN }}
  run: |
    RUN_Q=$(printf %s "$RUN_ID" | tr -c "A-Za-z0-9._:-" _ | cut -c1-128)
    STREAM_Q=$(printf %s "$REF_NAME" | tr -c "A-Za-z0-9._/-" _ | cut -c1-128)
    curl -sS --fail --proto =https -X POST "$PROBETEST_URL?runRef=$RUN_Q&stream=$STREAM_Q" \
      -H "Authorization: Bearer $PROBETEST_TOKEN" -H "Content-Type: application/xml" \
      --data-binary @reports/junit.xml

Snippets for GitLab CI, Jenkins, Azure DevOps, CircleCI and Bitbucket Pipelines are on the documentation page.

How do you produce JUnit XML?

Tool How
Playwright reporter: [['junit', { outputFile: 'reports/junit.xml' }]]
pytest pytest --junitxml=reports/junit.xml
Jest jest-junit in reporters
Maven or Gradle Surefire target/surefire-reports/*.xml, Gradle build/test-results/test/*.xml
TestNG built in: test-output/junitreports/*.xml
Cucumber --plugin junit:reports/junit.xml (JVM) or --format junit:reports/junit.xml (JS)

How does a result find its test?

For JUnit, the key is classname#name. An explicit id works too: a probetest property, or [KEY-T12] in the test name. A requirement link comes from a requirements property or [SHOP-12] in the name.

The first upload to a project creates the automated tests, so you start with history. After that, a result with an unknown key goes to the Unmatched inbox. You map it to an existing test, and ProbeTest remembers the alias, so a rename does not create a duplicate. Results also feed each test’s history, and a test that passes only on a later attempt is flagged as flaky.

What do the response codes mean?

Code Meaning What to do
200 Done: the run is a cycle row Nothing
202 Accepted and queued; the result appears within a minute Nothing
401 Missing, wrong, expired or revoked token Check the token or create a new one
429 Rate limit: 20 uploads a minute per site, 10 per token Wait 30 seconds and retry
503 Temporarily unavailable Retry after 30 seconds

Open CI results → Pipelines to see one row per upload with new failures, fixed tests and rejected rows.

Doing this inside Jira with an app

ProbeTest for Jira is built on Atlassian Forge and hosted by Atlassian. The upload address is an Atlassian-hosted address on your own Jira site, so results do not pass through a Probeflow server. Coverage from CI feeds the same traceability view as manual runs. If you are still choosing an approach, start with how to choose Jira test management.

ProbeTest is coming soon to the Atlassian Marketplace. Read the automation and CI guide, the troubleshooting page or the ProbeTest page.

Sources

  • ProbeTest documentation, Automation and CI, checked 2026-11-25.
  • Probeflow makes ProbeTest for Jira.

Frequently asked questions

Can I upload JUnit results to Jira without a plugin in my pipeline?

Yes. ProbeTest for Jira accepts a JUnit XML file posted with plain curl and a project token, so the pipeline needs no extra package. Any CI tool that can run a shell command and write JUnit XML can do it.

How does ProbeTest know which test a result belongs to?

It matches on an explicit test key in the name or a property first, then on the class and test name, then on an alias you saved earlier. Results that match nothing wait in the Unmatched inbox until you map them or create a test.

What happens if my pipeline retries the upload?

The same run reference and attempt number sent twice counts once. A higher attempt number for a CI re-run joins the same cycle, and a test that passes on a later attempt is recorded as passed on retry.

How large can an upload be?

A body can be up to 4 MB as it is. Larger files can be gzipped and base64 encoded with one extra header, and an upload can hold up to 50,000 results.