Solved

Ho to do a TQL search via ToscaCommander REST API

  • 27 November 2023
  • 1 reply
  • 56 views

Userlevel 2
Badge

The /Search endpoint expects tqlString as a name parameter.

It is visible when we get the list of tasks by following request:

GET {{host-tc}}/{{project}}/object/<id>/task

The response is


{
"Name": "Search",
"Parameters": [
{
"Name": "tqlString",
"Type": "String"
}
]
}

Then, if try to request a search by passing tqlString as a name parameter to the /Seach endpoint, the response is 404. I tested tqlString =>SUBPARTS:TestCase which works in ToscaCommand search where it returns a list of nested testcase items but 404 though the API.

Following requests were tested with urlencoded but both return 404. 

GET {{host-tc}}/{{project}}/object/<id>/task/Search?name==>SUBPARTS:TestCase

GET {{host-tc}}/{{project}}/object/<id>/task/Search?name=->SUBPARTS:TestCase

or

GET {{host-tc}}/{{project}}/object/<id>/task/Search?name=%3D%3ESUBPARTS%3ATestCase

 

The question is, how to do a TQL search in the mentioned way, or how to pass TQL search expression as a parameter to the /Search endpoint?

icon

Best answer by nissyan 7 December 2023, 13:06

View original

1 reply

Userlevel 2
Badge

This is how it works

 

{{host-tc}}/{{project}}/object/<id>/task/search?tqlString=->SUBPARTS[(IsTemplate=?"True")]

Reply