Ask a Question

Add tests to cycle via API

SOLVED
apuna12
Occasional Contributor

Add tests to cycle via API

Hello all,

 

I am so sorry to bother you every day. Today I want to add a tests into a test cycle via API. I tried to use the following link

https://zfjcloud.docs.apiary.io/#reference/execution/get-execution/add-tests-to-cycle

 

I created a JWT for the endpoint, used the body which is included on the mentioned link, adjusted the values, but I am getting the error "method field is required.". 

 

If I saw correctly it is not included in the body.

 

Can you help me with this? As always I am including some screen shots.

 

Thanks for the tips,

Tibor

 

apuna12_0-1613641696805.pngapuna12_1-1613641731111.pngapuna12_2-1613641774905.png

 

6 REPLIES 6
BibekBehera
SmartBear Alumni (Retired)

Hello @apuna12 ,

 

Please use the cycleID in the URL itself where you are sending the request. I can see that you have copied the complete request as it is in the document. You need to provide the input data based on the IDs that you have in your Jira.

 

Regards,

Bibek

apuna12
Occasional Contributor

Hello @BibekBehera ,

 

as you can see in the image from Postman, I used it as you mentioned. It is defined as environment variable, thus it is used in the url(even for the JWT generator).

 

Thanks,

Tibor

BibekBehera
SmartBear Alumni (Retired)

Hi @apuna12 

So we have to use 2 api to add test cases to cycle .

1.To generate the JOB progress token id

API https://prod-api.zephyr4jiracloud.com/connect/public/rest/api/1.0/executions/add/cycle/cycleid

method - POST

response - We will get the job progress token id - for example - 0001608711762447-242ac112-0001-



2. Use the above job progress token id in the api

API - https://prod-api.zephyr4jiracloud.com/connect/public/rest/api/1.0/jobprogress/ (https://prod-api.zephyr4jiracloud.com/connect/public/rest/api/1.0/jobprogress/job) token id

Method - GET

https://prod-api.zephyr4jiracloud.com/connect/public/rest/api/1.0/jobprogress/0001608711762447-242ac...


I tried at my end and it is working fine.

Attaching screenshot for your reference

apuna12
Occasional Contributor

Hello @BibekBehera,

 

that worked like a charm. It seems there are more APIs which are not included in https://zfjcloud.docs.apiary.io/#reference/execution/get-execution/add-tests-to-cycle

 

Is there a documentation or something which could help me not bother you fine people with this scholar issues?

 

Not promising that I stop asking 🙂 

 

Thanks a lot,

Tibor

Hi I like your recent post 

I am writing test script Zephyr Scale, I wanted to records API testing result along with API details , pl. help us best practices in this regards 

Regards 

Nitin  

florentinaC
Occasional Contributor

Hi, 

 

I just tried your solution for adding test cases to a cycle via API, and when I make the second call to Get Job progress, the request is successfully but I receive the following message and the test case is not created in the Jira

{
    "timeTaken": "0 min, 0 sec",
    "stepMessage": "",
    "summaryMessage": "",
    "errorMessage": "",
    "progress": 1.0,
    "message": "{\"error\":[\"We encountered some problems during processing this request. Please try again!: BAR_4\"]}",
    "stepLabel": "",
    "stepMessages": []
}
Do you know what can be the cause of that message?
 
Thank you,
Florentina
cancel
Showing results for 
Search instead for 
Did you mean: