In this very simple scenario, we'll implement a rule, triggered manually, that will trigger a Bamboo plan build. The action will be available from the "Automation" panel, in all issues of the selected project.
We're assuming that:
In a Bamboo Plan Configuration we will use the Script task to import the results back to Xray. We have defined internal Bamboo variables for the CLIENT_ID, CLIENT_SECRET, that are required for authentication and the TESTPLAN to associate on the Xray side.
token=$(curl -H "Content-Type: application/json" -X POST --data '{ "client_id": "${bamboo.CLIENT_ID}","client_secret": "${bamboo.CLIENT_SECRET}" }' https://xray.cloud.getxray.app/api/v1/authenticate| tr -d '"'); curl -H "Content-Type: text/xml" -X POST -H "Authorization: Bearer $token" --data @"/home/jira/bamboo-home/xml-data/build-dir/XRAY-JAV-JOB1/java-junit-Bookstore/target/surefire-reports/TEST-com.xpand.java.BookstoreTest.xml" https://xray.cloud.getxray.app/api/v1/import/execution/junit?projectKey=XT&testPlanKey=${bamboo.TESTPLAN} |
2. define an action (i.e. the "Then") as "Send web request" and configure it as follows
the Webhook HTTP POST body content, defined in the "Custom data" field, will be used to identify the stages to run and other parameters
default&ExecuteAllStages=true |
After publishing the rule, you can go to the screen of an issue and trigger the Bamboo plan build.
In this case, since Bamboo was configured to report results back to Xray, a new Test Execution would be created in Jira/Xray.
In this simple scenario, we'll implement a rule, triggered manually, that will trigger a Bamboo's plan build. The action will be available from the "Automation" panel, for all Test Plan issues of the selected project.
We're assuming that:
The project itself is a normal one; the only two things relevant to mention are:
token=$(curl -H "Content-Type: application/json" -X POST --data '{ "client_id": "${bamboo.CLIENT_ID}","client_secret": "${bamboo.CLIENT_SECRET}" }' https://xray.cloud.getxray.app/api/v1/authenticate| tr -d '"'); curl -H "Content-Type: text/xml" -X POST -H "Authorization: Bearer $token" --data @"/home/jira/bamboo-home/xml-data/build-dir/XRAY-JAV-JOB1/java-junit-Bookstore/target/surefire-reports/TEST-com.xpand.java.BookstoreTest.xml" https://xray.cloud.getxray.app/api/v1/import/execution/junit?projectKey=XT&testPlanKey=${bamboo.TESTPLAN} |
2. define the condition so that this rule can only be executed from Test Plan issue; this can also be done on the previous step
3. define an action (i.e. the "Then") as "Send web request" and configure it as follows
the Webhook HTTP POST body content, defined in the "Custom data" field, will be used to identify the stages to run and other parameters
default&ExecuteAllStages=true&bamboo.TESTPLAN={{issue.key}} |
After publishing the rule, you can go to the screen of an issue and trigger the Bamboo plan.
In this case, since Bamboo was configured to report results back to Xray, a new Test Execution would be created and linked back to the source Test Plan where the automation was triggered from