xml2jira

The xml2jira tool offers a simple way to automate creation/updating of JIRA issue tickets based on result output generated by Squish tests. It is feature-frozen and deprecated now that Squish Test Center offers a Jira Integration that is more powerful and flexible.

xml2jira creates a JIRA ticket corresponding to a Squish test suite. When it got passed a new result.xml file, it connects to JIRA and (related to the test suite which has generated the result) creates a ticket there, or (if a related ticket already exists) it updates the already existing ticket with these new gathered, actual test results.

To make ticket creation and updating possible for xml2jira, your JIRA system needs to be configured so that 'labels' field is settable from within a project's default ticket creation dialog. xml2jira needs the 'labels' field to 'mark' a ticket, so it later can identify it as being the right ticket, corresponding to exactly that test suite which new gathered results are going to be updated.

The JIRA issue Description contains the Test suite status describing when the executed test cases passed or failed last and the test execution duration. If a corresponding issue already exists its description will be updated accordingly.

{}

Test suite status

In addition, on every invocation of xml2jira, a comment containing an overview (Test suite summary) of the test cases executions mentioned in the specified Squish XML report file, will be added to the respective JIRA issue.

{}

Test suite summary

Optionally the Squish XML report file can be added as file attachment to the JIRA issue for later analysis.

The xml2jira tool changes the JIRA issue status to Open if the Squish XML report file may contain any failure. If the report file does not contain failures, the status is set to Closed.

Usage

xml2jira --server <url> --user <name> --password <password> --project <project key> --reportfile <filename> --issueType <name> --component <name> --transitions <workflow> --customField <field=content> --commandFile <filename> --attachSquishReport --deleteIssue

Options

OptionDescription
--server <url>The URL of the JIRA server including the port, e.g. http://jira:8080.
--user <name>Indicates the name of the JIRA user used to authenticate against the JIRA server.
--password <password>Indicates the password for the JIRA user.
--project <project key>Specifies the JIRA project by taking project key as argument.
--component <name>Optionally specifies the name of the JIRA project component.
--issueType <name>Optionally specifies issue type for the JIRA ticket. When given, the parameter must match one of the issue types defined in JIRA, or ticket creation will fail. When the option is omitted, issue type Bug will be used per default.
--reportfile <filename>Specifies the absolute path to the Squish XML report file for which a JIRA issue will be created or updated, e.g. C:\reports\squishreport.xml. Supported result formats are: xml2, xml2.1, xml2.2, xml3, xml3.1, xml3.2, xml3.3
--commandfile <filename>Specifies an optional UTF-8 encoded file containing command-line options used in addition to the options passed to the xml2jira tool. For more information, see command file.
--attachSquishReportOptionally indicates to attach the Squish XML report file to the JIRA issue.
--customField <fieldname=fieldcontent>Optionally defines customfields on JIRA tickets for being updated by <fieldcontent>. Also it is used for filling fields with <fieldcontent> within the ticket creation dialog, which have been set 'required' for ticket creation. This option can be given several times, for each field which may need update. Also 'CustomOptionFields' (as Dropdown-fields or Combo-boxes) can be filled. In this case, <fieldcontent> must exactly match one of the field's selectable options.
--transitions <workflow endpoint definitions>Optionally defines custom workflow endpoint states and transitions between them. When your Jira platform is configured to use non-standard workflow definitions, this option can be used to let xml2jira know about them.
--deleteIssueDeletes a Jira-ticket related to the test result given by --reportfile option. (for this, reporting --user need to have admin rights enabled on the JIRA server.)

Workflow Endpoint Definitions

The --transitions option always needs 4 comma-separated parameters, given in this order, otherwise ticket creation will fail: Active=<meta-id>, AtransD=<meta-id>, Disabled=<meta-id>, DtransA=<meta-id>.

  • For Active and Disabled, give the names of the states which xml2jira should use when updating results. In JIRA standard workflow, these would be called Open=1 and Closed=6. A PASSED update would lead to a ticket being Disabled and a FAILED update would lead to a ticket being Activated.
  • For AtransD and DtransA names of the transitions leading from Active to Disabled state and vice versa must be given. In JIRA standard workflow, these would be called CloseIssue=2 and ReopenIssue=3.
  • For each of these names also the <meta-id> must be given, separated by the equals sign (=).

A --transitions option with parameters that match the JIRA predefined standard states and transitions would look as follows:

xml2jira ... --transitions "Open=1,CloseIssue=2,Closed=6,ReopenIssue=3" ... --reportfile C:\report.xml

Examples

Here is an example invocation of the xml2jira tool which imports the Squish XML report file C:\report.xml into the specified JIRA server using the user alice and password al1ce for the project SampleProject and the component tests.

xml2jira --server http://jira:8080 --user alice --password al1ce --project SampleProject --component tests --reportfile C:\report.xml

Here is an example of using a command file called mycmd.txt:

# mycmd.txt
--reportfile C:\report.xml

You can use the command file with the xml2jira tool as follows:

xml2jira --server http://jira:8080 --user alice --password al1ce --project SampleProject --component tests --commandfile C:\mycmd.txt

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners.
The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.
Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.