How to get all records from Reportable REST API?
I've this REST API : https://xyx:8085/ccm/rpt/repository/workitem?fields=workitem/workItem[projectArea/name='Defect Management']/(id|summary|allExtensions[displayName='External ID']/(displayName|displayValue)) and it only returns limited number of recrods. However, I need all. What changes do I need to make to the mentioned url to get all the records.
2nd question: is it possbile to apply filter and get only the records where 'External ID' is NOT NULL?
showing 5 of 7
show 2 more comments
|
One answer
Only a limited number of basic XPath filters are implemented in the Reportable REST API. This is how you can apply further filters on the returned data - this code returns all team members with a specific role in a team area:
var getTeamMembersWithRole = function(team, role) {
if (!team || !role) { console.log('getTeamMembersWithRole: Error! team = ' + team + ', role = ' + role); return null; } var xhrArgs = { url : '/ccm/rpt/repository/foundation?fields=foundation/teamArea[itemId=' + team + ']/roleAssignments/(contributor/itemId|contributorRoles/name)', headers : { 'Accept' : 'application/xml' }, handleAs : 'xml' }; return jazzClient.xhrGet(xhrArgs).then( function(data) { var memberIds = data.evaluate( 'foundation/teamArea/roleAssignments[contributorRoles/name/text()="' + role + '"]/contributor/itemId', data, null, XPathResult.ANY_TYPE, null); var members = 0 || []; var id = memberIds.iterateNext(); while (id !== null) { members.push(id.textContent); id = memberIds.iterateNext(); } return members; }); }; |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.
Comments
Davyd Norris any idea?
Probably need to know how many records it's returning before this question can be answered
100 records by default
Does appending size parameter (ex. size=5000) help?
actually, I'm looking for all records.
all I could undestand from there, that change the max feed setting entries in Advanced properties. But then how do we determine what the max feed limit should be?