Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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?

0 votes

Comments

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.

I found an existing question that may give you some ideas - this is for RQM but I would assume it is also relevant for the others

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?

showing 5 of 7 show 2 more comments


One answer

Permanent link
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;
        });
  };


0 votes

Your answer

Register or log in to post 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,948

Question asked: Jun 26 '19, 8:39 a.m.

Question was seen: 2,615 times

Last updated: Jul 03 '19, 9:52 a.m.

Confirmation Cancel Confirm