It's all about the answers!

Ask a question

RQM API - querying for records updated in a given range


Kevin Murphy (9621317) | asked Sep 16 '14, 6:32 p.m.
The RQM API has a great function called modifiedSince. It'll let you specify a dateTime and return all records modified since that date.

What if I only want to return artifacts from a given date range? Something like, return all recirds updated between 2014-08-01T00:00:00 and 2014-09-01T00:00:00?

The modifiedSince function says to consider using fields instead, and this implies that the functionality I want is possible. But unfortunately, the greater than and less than operators don't appear to work with a filter on updated.

This works:
executionresult?fields=/feed/entry/content/executionresult[updated='2014-08-03T00:27:24.612Z']

This does not:
executionresult?fields=/feed/entry/content/executionresult[updated>='2014-08-03T00:27:24.612Z']
(it returns all results)

Here's the documentation for modifiedSince. Am I missing something? Why would I use fields filtering if I had to know the milliseconds I was looking for?

modifiedSince

<feedUrl> only.

Value Meaning
<XML dateTime> Resources modified after (or greater than) the date time.

In addition, see note 15 on the labresource resource.

As an alternative, use fields filtering.


Accepted answer


permanent link
Paul Slauenwhite (8.4k12) | answered Sep 17 '14, 6:52 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
Hi Ken,

You could use a field filter like:

?fields=feed/entry/content/executionresult[updated>= '2014-08-03T00:00:00.000Z' and updated<= '2014-08-04T00 :00:00.000 Z'] ]/*

For more information, see https://jazz.net/wiki/bin/view/Main/RqmApi#fields.

If the inequality operators are not working, please open a RQM defect.
Kevin Murphy selected this answer as the correct answer

Comments
Kevin Murphy commented Sep 17 '14, 1:48 p.m.

Hey Paul,

Thank you for your response. I wasn't trying to use the "and" operator. I knew to do that, but didn't state so specifically. What I was trying to show was that the inequality operators don't appear to work, so of course, an and operation using them won't work.

I was hoping I was just missing something. I guess I'll open a defect.

Kevin


Kevin Murphy commented Sep 17 '14, 2:08 p.m.

Get this -- I messed with Paul's suggestion while entering the defect (but before submitting it) and it worked! I am not sure what was not working yesterday.

This got me what I wanted:

/executionresult?fields=feed/entry/content/executionresult[updated>='2014-08-01T00:00:00.000Z' and updated<'2014-08-31T00:00:00.000Z']/*

I'm not sure why this wasn't working yesterday but I hope this helps someone else!


Paul Slauenwhite commented Sep 17 '14, 2:30 p.m.
FORUM MODERATOR / JAZZ DEVELOPER

Kevin, the only difference appears to be < versus <= operators.  Can you try the <= operator?

Your answer


Register or 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.