This is sample QAS + maven project in Java. It shows how to upload test result file on JIRA instance using QMetry for JIRA - Test Management.
please update these details in pom.xml file.
<build><plugins><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-surefire-plugin</artifactId><version>2.22.0</version><configuration><properties><property><name>listener</name><value>com.qmetry.automation.QASResultUploader</value></property></properties></configuration></plugin></plugins></build>
<dependencies><dependency><groupId>com.qmetry</groupId><artifactId>automation</artifactId><version>1.0.2</version></dependency></dependencies>
<repositories><repository><id>qmetrytestmanager-mvn-repo</id><name>QMetry Test Manager Maven Repository</name><url>https://raw.github.com/qmetry/qtm4j-maven-uploader/mvn-repo/</url></repository></repositories>
automation.qmetry.enabled = trueautomation.qmetry.url = https://importresults.qmetry.com/prod/importresults-qtm4jautomation.qmetry.apikey = {{your API key}}automation.qmetry.testrunname = Test Runautomation.qmetry.labels = lbl1,lbl2automation.qmetry.components = com1,com2automation.qmetry.version = v1,v2automation.qmetry.sprint = sprint1automation.qmetry.platform = chromeautomation.qmetry.comment = this is test run commentautomation.qmetry.testrunkey =automation.qmetry.testassethierarchy = TestCase-TestStepautomation.qmetry.jirafields =automation.qmetry.debug = trueautomation.qmetry.attachfile=trueautomation.qmetry.testcaseupdatelevel=0
Once the file is configured, the automation test results will get uploaded automatically whenever the user executes the automation project (e.g. using 'mvn test').automation.qmetry.authorization=Basic YWRtaW46YWRtaW4=ORautomation.qmetry.username = adminautomation.qmetry.password = admin
After providing these details, you are ready to start test.
mvn test
It will generate surefile-reports.
Addionally, right after test completion, test result file will be uploaded on your JIRA instance if you have provided correct details in properties file.