SearchWsResponse.Builder response = SearchWsResponse.newBuilder();
formatPaging(paging, response);
- formatEffortTotal(data, response);
+ ofNullable(data.getEffortTotal()).ifPresent(response::setEffortTotal);
response.addAllIssues(formatIssues(fields, data));
response.addAllComponents(formatComponents(data));
formatFacets(data, facets, response);
return response.build();
}
- private static void formatEffortTotal(SearchResponseData data, SearchWsResponse.Builder response) {
- Long effort = data.getEffortTotal();
- if (effort != null) {
- response.setDebtTotal(effort);
- response.setEffortTotal(effort);
- }
- }
-
private static void formatPaging(Paging paging, SearchWsResponse.Builder response) {
response.setP(paging.pageIndex());
response.setPs(paging.pageSize());
// Response of GET api/issues/search
message SearchWsResponse {
+ reserved 5;
optional int64 total = 1;
optional int64 p = 2;
optional int32 ps = 3;
// Total amount of effort, only when the facet "total" is enabled
optional int64 effortTotal = 13;
- // Deprecated since 5.5, replaced by effortTotal
- optional int64 debtTotal = 5;
repeated Issue issues = 6;
repeated Component components = 7;