How can I trigger Allure 2 jira-plugin without using Maven?

Viewed 113

I am trying to get my test results visible in Jira using Allure 2.13.8. The test results are visible but are not displayed as links back to the report, so called backlinks.

Here is my situation.

When I generate an Allure report with maven using allure-maven:

mvn clean test allure:report

an executor.json is created with maven build info inside allure-results dir.

environment {
    ALLURE_JIRA_LAUNCH_ISSUES = 'xxx-9'
    ALLURE_JIRA_ENABLED = 'true'
    ALLURE_JIRA_ENDPOINT = 'http://localhost:8080/rest/'
    ALLURE_JIRA_USERNAME = 'xxx'
    ALLURE_JIRA_PASSWORD = 'xxxx'
}

    stage('Test Execution') {
         steps {
         
         withMaven(options: [artifactsPublisher(disabled: true)],
             maven: 'MAVEN_HOME')  {
             sh "mvn clean test -Dtest=ApplyForCreditCardTestsDE,_FailedTests* -Denv=qa-de"
             }
        }
    }

The above env variables trigger the jira-plugin within Allure to export test results and launch to Jira. This works, but this executor.json do not contain links needed to create these backlinks. Just some limited info such as project name, that's it.

When I generate an Allure report with Jenkins Allure plugin:

stage('Generate Test Report') {
        steps {
            script {
                allure([
                    includeProperties: true,
                    jdk: '',
                    properties: [
                        [key: 'ALLURE_JIRA_LAUNCH_ISSUES',value: 'xxx-9'],
                        [key: 'ALLURE_JIRA_ENABLED',value: 'true'],
                        [key: 'ALLURE_JIRA_ENDPOINT',value: 'http://localhost:8080/rest/'],
                        [key: 'ALLURE_JIRA_USERNAME',value: 'xxx'],
                        [key: 'ALLURE_JIRA_PASSWORD',value: 'xxxx']
                    ],
                    reportBuildPolicy: 'ALWAYS',
                    results: [[path: 'target/allure-results']]
                ])
            }
        }    
     }

an executor.json is created with jenkins build info inside allure-results dir.

{"buildName":"test #35","buildOrder":"35","reportName":"AllureReport","name":"Jenkins","buildUrl":"http://localhost:8085/job/test/35/","reportUrl":"http://localhost:8085/job/test/35/allure","type":"jenkins","url":"http://localhost:8085/"} 

This is what I need to be pushed to Jira.

For some reason I cannot figure out how the jira-plugin can be triggered from this plugin? Or do I need to use Allure Command Line Interface to do this? I'm lost.

If you can help me out that would be much appreciated.

0 Answers
Related