Hello there,
I try to make autoamtion sending messages to MS Teams webhook once test automation is created.
I would like to see test count, number of passed and failed test.
There is a documentation from Xray:
https://docs.getxray.app/display/XRAYCLOUD/Integration+with+Microsoft+Teams
However my messages are still without number regarding tests.
I don't know how to verify what is inside these variables like:
{{webResponse.body.data.getTestExecution.testRuns.results.status.name.match(
".*(PASSED).*"
).size|
0
}}
{'data': {'getTestExecution': {'issueId': '1028525', 'jira': {'key': 'CTB-4977', 'customfield_10033': None}, 'testRuns': {'results': [{'status': {'name': 'PASSED'}, 'test': {'jira': {'key': 'CTB-4847'}}}, {'status': {'name': 'PASSED'}, 'test': {'jira': {'key': 'CTB-4848'}}}, {'status': {'name': 'PASSED'}, 'test': {'jira': {'key': 'CTB-4849'}}}, {'status': {'name': 'PASSED'}, 'test': {'jira': {'key': 'CTB-4873'}}}, {'status': {'name': 'PASSED'}, 'test': {'jira': {'key': 'CTB-4850'}}}, {'status': {'name': 'PASSED'}, 'test': {'jira': {'key': 'CTB-4615'}}}, {'status': {'name': 'PASSED'}, 'test': {'jira': {'key': 'CTB-4972'}}}, {'status': {'name': 'PASSED'}, 'test': {'jira': {'key': 'CTB-4678'}}}]}, 'testEnvironments': [], 'testPlans': {'results': []}}}}
Automation log also confirm all my posts were successful ( so token etc should be correct )
So question is if these variables are up to date in xray documentation?
How can i check what is inside these variables?
Or do you have any other idea how to get information like test count, passed and failed tests?
There is better structured json file:
json_data = '''{
"data": {
"getTestExecution": {
"issueId": "1028525",
"jira": {"key": "CTB-4977", "customfield_10033": None},
"testRuns": {
"results": [
{"status": {"name": "PASSED"}, "test": {"jira": {"key": "CTB-4847"}}},
{"status": {"name": "PASSED"}, "test": {"jira": {"key": "CTB-4848"}}},
{"status": {"name": "PASSED"}, "test": {"jira": {"key": "CTB-4849"}}},
{"status": {"name": "PASSED"}, "test": {"jira": {"key": "CTB-4873"}}},
{"status": {"name": "PASSED"}, "test": {"jira": {"key": "CTB-4850"}}},
{"status": {"name": "PASSED"}, "test": {"jira": {"key": "CTB-4615"}}},
{"status": {"name": "PASSED"}, "test": {"jira": {"key": "CTB-4972"}}},
{"status": {"name": "PASSED"}, "test": {"jira": {"key": "CTB-4678"}}}
]
},
"testEnvironments": [],
"testPlans": {"results": []}
}
}
}'''
Hi @Vojtech Kalab -- Welcome to the Atlassian Community!
In your rule after the REST API call to get the test results from Xray, please try writing this to the audit log:
{{webResponse.body.data.getTestExecution.testRuns.results.status.name}}
That may confirm if the message is (or is not) being interpreted in a manner that can be parsed, or if it is plain text.
Kind regards,
Bill
Hi Bill,
thank you for the kind welcome.
Thank you for your suggestion. It helped me to find out, my variables are empty, because i didn't check option:
Delay execution of subsequent rule actions until we've received a response for this web request
Thank you very much.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register NowOnline forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.