Forum Discussion
vinniew
Staff
Hi Alan,
Did the other thread solve this issue?
Just dbl checking for reference?
KR
Vinnie
Claddaghduff
3 years agoOccasional Contributor
No, it uses a different way. As I'm using Zephyr Scale Cloud I access that via https://api.zephyrscale.smartbear.com/v2 and append the appropriate endpoint e.g. /testcases or /testcycles etc. (https://support.smartbear.com/zephyr-scale-cloud/api-docs/)
For accessing the API, you must generate an access key in Jira. To generate an access token, click on your profile picture at the page bottom left, and choose the option “Zephyr Scale API keys". support.smartbear.com |

This code here adds a test execution into Zephyr Scale for the test case however I've hard coded the values (just to make sure it will work) as I can't figure out how to get them via the api.
function createPostRequest(endpoint="/testcases")
{
let address = "https://api.zephyrscale.smartbear.com/v2" + endpoint;
let request = aqHttp.CreatePostRequest(address)
request.SetHeader("Content-Type", "application/json");
request.SetHeader("Authorization", "Bearer <zephyr scale api token>")
return request;
}
function createTestExecution()
{
let test = getLastTest();
let request = createPostRequest("/testexecutions")
let requestBody = {
"projectKey": "VRTWB",
"testCaseKey": "VRTWB-T6",
"testCycleKey": "VRTWB-R1",
"statusName": "PASS",
"testScriptResults": [
{
"statusName": "PASS",
"actualEndDate": "2022-01-20T13:15:13.000Z",
"actualResult": "User logged in successfully"}]
}
let str = JSON.stringify(requestBody)
let response = request.send(str);
Log.Message(response);
}Related Content
- 4 years ago
- 7 years ago
- 2 years ago
- 2 years ago
Recent Discussions
- 8 days ago