Skip to content

TestPlanJunofilter

Filter test plan

Attempt to filter a test plan specified by an id

Request

post /testplan/junofilter

Parameters

Parameter Type Required Notes
page query yes page number that the filter returns
size query yes size number that the filter returns
order query yes definition of the sorting for filter (asc/desc)
by query yes definition of the sorting for filter (id)

Request body

Attribute                                 Type Required Notes
navbar object no object containing substring (type: string)
testPlanFilter array no array of objects containing nameOfTheField, operator and value. nameOfTheField is a string (example= assignedId), operator defines if filter works with "=" or "!=" and value is an integer that defines what is being filtered
labelFilter array no array of objects containing operator and value. operator defines if filter works with "=" or "!=" and value is an integer that defines what is being filtered
testPlanStatus object no contains projectId, archived, deleted and type
testSpaceFilter array no array of objects containing operator and value. operator defines if filter works with "=" or "!=" and value is an integer that defines what is being filtered

Request body example

{
  "navbar": {
    "substring": "string"
  },
  "testPlanFilters": [
    {
      "nameOfTheField": "ownerId",
      "operator": "=",
      "value": 1
    }
  ],
  "labelFilters": [
    {
      "operator": "=",
      "value": 1
    }
  ],
  "testPlanStatus": {
    "archived": false,
    "deleted": false,
    "projectId": 1,
    "type": 2
  },
  "testSpaceFilter": [
    {
      "operator": "=",
      "value": 2
    }
  ]
}
curl --location 'https://example.juno.one/testplan/junofilter/?size=10&page=1&order=DESC&by=id' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0QGp1bm8ub25lIiwidGVuYW50SUQiOiJkZXZlbG9wbWVudCIsImV4cCI6MTY4NDQ4MzYyNn0.cYdUo4oiHnkdAywSAb7EFus9PFg-2FYHZPj4gdMML-mKgUVZw9fewOo4QK6U3PqCzGWjFVksz8HULzyKMnV8AA' \
--header 'X-tenantID: example' \
--header 'Content-Type: application/json' \
--data '{
    "testPlanFilters":[
        {
            "nameOfTheField":"creatorId",
            "operator": "=",
            "value": 13
        }
    ],
    "labelFilters":[
        {
            "operator": "=",
            "value": 128
        }
    ],
    "testPlanStatus":{
        "archive": false,
        "deleted": false,
        "projectId": 13

    },
    "navbar": null,
    "testSpaceFilter":[
        {
            "operator": "=",
            "value": 27
        }
    ]

}'
import requests
import json

url = "https://example.juno.one/testplan/junofilter/?size=10&page=1&order=DESC&by=id"

payload = json.dumps({
  "testPlanFilters": [
    {
      "nameOfTheField": "creatorId",
      "operator": "=",
      "value": 13
    }
  ],
  "labelFilters": [
    {
      "operator": "=",
      "value": 128
    }
  ],
  "testPlanStatus": {
    "archive": False,
    "deleted": False,
    "projectId": 13
  },
  "navbar": None,
  "testSpaceFilter": [
    {
      "operator": "=",
      "value": 27
    }
  ]
})
headers = {
  'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0QGp1bm8ub25lIiwidGVuYW50SUQiOiJkZXZlbG9wbWVudCIsImV4cCI6MTY4NDQ4MzYyNn0.cYdUo4oiHnkdAywSAb7EFus9PFg-2FYHZPj4gdMML-mKgUVZw9fewOo4QK6U3PqCzGWjFVksz8HULzyKMnV8AA',
  'X-tenantID': 'example',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
val client = OkHttpClient()
val mediaType = "application/json".toMediaType()
val body = "{\n    \"testPlanFilters\":[\n        {\n            \"nameOfTheField\":\"creatorId\",\n            \"operator\": \"=\",\n            \"value\": 13\n        }\n    ],\n    \"labelFilters\":[\n        {\n            \"operator\": \"=\",\n            \"value\": 128\n        }\n    ],\n    \"testPlanStatus\":{\n        \"archive\": false,\n        \"deleted\": false,\n        \"projectId\": 13\n        \n    },\n    \"navbar\": null,\n    \"testSpaceFilter\":[\n        {\n            \"operator\": \"=\",\n            \"value\": 27\n        }\n    ]\n\n}".toRequestBody(mediaType)
val request = Request.Builder()
  .url("https://example.juno.one/testplan/junofilter/?size=10&page=1&order=DESC&by=id")
  .post(body)
  .addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0QGp1bm8ub25lIiwidGVuYW50SUQiOiJkZXZlbG9wbWVudCIsImV4cCI6MTY4NDQ4MzYyNn0.cYdUo4oiHnkdAywSAb7EFus9PFg-2FYHZPj4gdMML-mKgUVZw9fewOo4QK6U3PqCzGWjFVksz8HULzyKMnV8AA")
  .addHeader("X-tenantID", "example")
  .addHeader("Content-Type", "application/json")
  .build()
val response = client.newCall(request).execute()

Response

Successful response of test plan junofilter has the status 200 with following response body:

{
  "data": [
    {
      "id": 1,
      "name": "test",
      "creatorId": {
        "id": 2,
        "firstname": "test",
        "lastname": "test",
        "email": "test@juno.one",
        "avatar": "9",
        "deleted": false
      },
      "editorId": 0,
      "projectId": {
        "id": 13,
        "name": "test",
        "test_case_robust": true
      },
      "description": "test",
      "features_tested": "test",
      "features_not_tested": "test",
      "start_date": "2020-06-03T00:00:00.000Z",
      "end_date": "2020-06-03T00:00:00.000Z",
      "deleted": false,
      "deleted_at": "2023-03-16T10:17:04.000Z",
      "created_at": "2023-03-16T10:17:04.000Z",
      "updated_at": "2023-03-16T10:17:04.000Z",
      "estimated_from_children": 1,
      "labels": {
        "id": 22,
        "name": "test",
        "color": "#c0507e",
        "projectId": 13
      },
      "collaborators": {
        "id": 2,
        "firstname": "test",
        "lastname": "test",
        "email": "test@juno.one",
        "avatar": "9",
        "deleted": false
      },
      "testSpaces": {
        "id": 1,
        "name": "test",
        "creatorId": {
          "id": 2,
          "firstname": "test",
          "lastname": "test",
          "email": "test@juno.one",
          "avatar": "9",
          "deleted": false
        },
        "projectId": {
          "id": 13,
          "name": "test",
          "test_case_robust": true
        },
        "deleted": true,
        "deleted_at": "2023-03-16T10:17:04.000Z",
        "created_at": "2023-03-16T10:17:04.000Z",
        "updated_at": "2023-03-16T10:17:04.000Z"
      },
      "summary": {
        "plannedStatus": 1,
        "currentStatus": 1,
        "difference": 1,
        "tcCountDifference": 1,
        "statistics": [
          {
            "status": {
              "id": 0,
              "name": "test",
              "projectId": {
                "id": 13,
                "name": "test",
                "test_case_robust": true
              },
              "state": 0,
              "color": "#29a745"
            },
            "count": 0
          }
        ]
      }
    }
  ],
  "first": true,
  "last": true,
  "totalPages": 1,
  "totalElements": 1,
  "numberOfElements": 1,
  "limit": 10,
  "pageNumber": 1
}

400 Bad Request

{
    "timestamp": "2022-02-16T17:11:34.422+00:00",
    "status": 400,
    "error": "Bad Request",
    "message": "The request is missing test plan id",
    "path": "/testplan/junofilter"
}

404 Not found

{
    "timestamp": "2022-02-16T17:11:34.422+00:00",
    "status": 404,
    "error": "Not Found",
    "message": "Test plan with id 2 was not found.",
    "path": "/testplan/junofilter"
}

406 Insufficient permision

{
    "timestamp": "2022-02-16T17:11:34.422+00:00",
    "status": 406,
    "error": "Missing permission for action",
    "message": "You do not have a permission for this action",
    "path": "/testplan/junofilter"
}

412 Precondition failed

{
    "timestamp": "2022-02-16T17:11:34.422+00:00",
    "status": 412,
    "error": "Precondition failed",
    "message": "You do not have permission for this action",
    "path" : "/testplan/junofilter"
}

500 Unknown error

{
    "timestamp": "2022-02-16T17:11:34.422+00:00",
    "status": 500,
    "error": "Unknown",
    "message": "There was a problem with your request. Please contact your administrator.",
    "path" : "/testplan/junofilter"
}