[API] Creating a test Run with 'plan_id' ignores the provided cases and includes all cases from that plan
J
Juozas M
Creating a Run with 'plan_id' field while including specific cases from that plan doesn't work properly, as the run created has all of the cases from that plan, instead of having only specified cases.
This is an API issue, as the same scenario works fine when done via UI.
---------------------------------------------
Endpoint: https://api.qase.io/v1/run/{code}
---------------------------------------------
Body:
{
"cases": [
609,
610
],
"plan_id": 5,
"configurations": [
7
],
"title": "Test Title",
"description": "Test description",
"include_all_cases": false
}
---------------------------------------------
Response:
{
"status": true,
"result": {
"id": 62
}
}
---------------------------------------------
Vikas Naithani
Hi Juozas M
Thank you for sharing the details. Based on how our system currently works:
When you provide a plan ID + test case IDs that are part of the plan, the run will include all test cases in the plan.
When you provide a plan ID + test case IDs not in the plan, the run will include all test cases in the plan plus the additional test cases you’ve specified.
If you only want to include specific test cases from a plan in your run, the correct method is to omit the plan ID and provide only the desired test case IDs. Using the plan ID will always bring in the full plan.
J
Juozas M
Hi Vikas Naithani
Thank you for the answer.
When creating a run via UI, it is possible to select a plan and specific cases from that plan. So I'm not sure why this can not be achieved via API? It would make sense to support the same features for both UI and API.
Having this functionality gives us more control over test cases, as we can have plans as a "template" for specific runs. And nesting runs under a plan is our preferred structure. But this can not be achieved in any other way, as currently, you can not attach a plan to an already created run or vice versa.
Vikas Naithani
Hi Juozas M
In the UI, when you select a plan, Qase allows you to:
* Select test cases from the entire repository (not just from the plan).
* De-select test cases that are part of the plan.
* Add new test cases that are not included in the plan.
This same behavior is reflected in the API. Even if you provide a plan ID, you can still add additional test cases that are not part of the plan. Conversely, if you want to include only specific test cases (rather than the whole plan), you don’t need to provide the plan ID — you can simply pass the case IDs when creating the run.
You mentioned that when creating a run via the UI it’s possible to select a plan and then choose specific cases from that plan. Could you please share a video of this behavior with support@qase.io? As far as we’re aware, it’s currently not possible to select only specific test cases from a plan directly. Instead, you can:
* Create a run that includes all test cases from the plan, or
* Manually modify the run by selecting/deselecting test cases from the entire repository (including those in the plan) to add or remove them.
J
Juozas M
Vikas Naithani,
You are correct.
The UI behavior I'm interested in is "* De-select test cases that are part of the plan" and you can't do that via API.
It is possible to add a few specific test cases to the run, but only without providing "plan_id".
I want the run to be connected to the plan in some way, and that's how it can be achieved via UI.
Vikas Naithani
HI Juozas M,
Thank you for explaining your use case.
The behavior you’re seeing is due to the fundamental difference between the UI and the API:
The UI is interactive — it allows you to select, deselect, or add test cases dynamically before creating a run. That’s why you can choose a subset of cases from a plan in the UI.
The API is not interactive — it expects a complete set of values in a single request. When you provide a plan_id, the API automatically includes all cases from that plan, and there’s no way to deselect specific cases while keeping the run linked to the plan.
Because of this, it is not possible to select only specific cases from a plan via the API while linking the run to that plan. This difference is by design, and this behavior cannot be changed.
J
Juozas M
Vikas Naithani
The problem is that the same results for the Run configuration that was created via UI can NOT be achieved via the API.
It would make sense to have the same functionality in both UI and API. This is very confusing and should be looked at again.
Please clarify with your manager or product owner regarding this.
Vikas Naithani
Thank you for sharing your perspective, Juozas M. While this isn’t a defect in the current API, we recognize it as an area for potential improvement. I’ve submitted your feedback as an enhancement request to our engineering team.