简体   繁体   English

Jama REST Api-向GET注入where子句

[英]Jama REST Api - Injecting a where clause to GET

I'm using the REST API of Jama, detailed here: 我正在使用Jama的REST API,在这里进行详细说明:

https://dev.jamasoftware.com/rest#operation_getItems https://dev.jamasoftware.com/rest#operation_getItems

Using this allows me to get a JSON object of all the items in a given project. 使用此功能,我可以获取给定项目中所有项目的JSON对象。

However what is returned is limited to just 20 results, to get all the results I need to loop through using pagination. 但是,返回的结果仅限于20个结果,要获得我需要使用分页遍历的所有结果。

There is a field in the returned data which is itemType. 返回的数据中有一个字段是itemType。 Is there anyway of injecting a 'where' clause into the GET request so that only items of certain type is returned? 无论如何,是否要在GET请求中注入“ where”子句,以便仅返回某些类型的项目?

All I'm after is the total number of matching items, seems unnecssary to have to grab everything and then loop through to extract the items of a certain type? 我所需要的只是匹配项的总数,似乎不必抓住所有内容然后循环进行以提取特定类型的项?

Not sure which version of Jama you are using but in 8.25 we have the abstractitems endpoint, which optionally takes an itemType [array] parameter in the query. 不确定使用的是哪个版本的Jama,但在8.25中,我们具有abstractitems端点,该端点可以在查询中选择使用itemType [array]参数。 See https://dev.jamasoftware.com/rest#operation_getAbstractItems 参见https://dev.jamasoftware.com/rest#operation_getAbstractItems

the GET request looks like this: https://myjamahost.com/rest/latest/abstractitems?project=23&itemType=60&itemType=67&...&maxResults=50 unfortunately the response size here is also default 20 and max. GET请求看起来像这样: https : //myjamahost.com/rest/latest/abstractitems? project =23& itemType = 60 & itemType = 67 &...& maxResults =50不幸的是,这里的响应大小也是默认的20,最大。 50 50

Hope that helps 希望能有所帮助
S. S.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM