Issues with Xray Maven Plugin - Test Plan, Fix Version, and Environment Fields Not Populating in Jira

I’m currently using Serenity version 4.0.1 to generate a cucumber.json report and employing the Xray Maven plugin to upload the results to Jira.

While most functions are working seamlessly, such as the creation of Test Executions and the display of results, I’m facing issues with three particular fields that aren’t being populated:

  • The test plans aren’t linking as expected
  • The environment field is not getting filled
  • The fix version field remains empty

I’ve attempted two different approaches to set these fields:

  1. Using command line parameters, similar to how I provide Jira credentials
  2. Configuring these values directly in the plugin setting within my pom.xml

In both cases, other configurations are applied correctly, but these three fields still do not populate.

Below is my plugin configuration:

<plugin>
    <groupId>app.getxray</groupId>
    <artifactId>xray-maven-plugin</artifactId>
    <version>0.7.3</version>
    <configuration>
        <cloud>false</cloud>
        <jiraBaseUrl>https://jira.test.com</jiraBaseUrl>
        <projectKey>E2E</projectKey>
        <testEnvironment>UAT</testEnvironment>
        <fixVersion>1.0</fixVersion>
        <testPlanKey>E2E-577</testPlanKey>
        <reportFormat>cucumber</reportFormat>
        <reportFile>target/cucumber.json</reportFile>
    </configuration>
    <executions>
        <execution>
            <id>import-results</id>
            <phase>post-integration-test</phase>
            <goals>
                <goal>import-results</goal>
            </goals>
        </execution>
    </executions>
</plugin>

And here is the Maven command I’m using:

clean verify -e -X -Dcucumber.filter.tags="@E2E_Regression" -Dxray.testPlanKey="E2E-577" -Dxray.fixVersion=1.0 -Dxray.testEnvironment=UAT -Dxray.jiraUsername=xxx -Dxray.jiraPassword=xxx

The output I receive from the plugin suggests it runs successfully:

{"testExecIssue":{"id":"16065764","key":"E2E-583","self":"https://jira.test.com/rest/api/2/issue/16065764"},"testIssues":{"success":[{"id":"16037818","key":"E2E-576","self":"https://jira.test.com/rest/api/2/issue/16037818","testVersionId":1433450}]},"infoMessages":[]}

I’m curious why these specific fields are not being filled at all?

Your parameter names might not match what the plugin expects. I ran into this same issue last year with version 0.7.3 - the plugin sometimes needs different parameter names than what’s in the docs. Try -Dxray.testEnvironments (plural) instead of -Dxray.testEnvironment. Also double-check that your fixVersion “1.0” actually exists in your Jira project. The plugin won’t tell you if the version name doesn’t match exactly. For test plan linking, make sure your Test Execution type allows automatic linking - some project setups force you to link manually. Run it with debug output to see the actual REST calls hitting Jira.

I encountered a similar issue with the Xray Maven plugin 0.7.3 previously. The problem arises because the plugin successfully creates the Test Execution, but it fails to populate custom fields during the same process. These fields need to be set after the initial creation, not at the time of import.

To resolve this, first, consider upgrading your plugin, as version 0.7.3 has known issues with field population. Additionally, ensure your Jira user has permission to modify those fields in the project, as the plugin does not report errors if permissions are incorrectly set. In my case, updating the fields via the REST API after the plugin’s execution worked effectively, or alternatively, migrating to the latest Xray cloud integration, if that’s an option for you.

Same headache with 0.7.3! Those fields get ignored when importing cucumber results - they only work with manual test execution creation. Use the create-test-execution goal first to set up the execution with all your fields, then import-results to upload the test results to that existing execution. Fixed it for me after weeks of frustration