Rally Software

 View Only

 Unexpected results when using comparison operators in calls to Rally API

Jessica Tonda's profile image
Broadcom Employee Jessica Tonda posted Jan 06, 2022 11:17 AM
I'm seeing some oddities when using comparison operators in my calls to the Rally API that I suspect may be a bug or perhaps a time zone difference when comparing dates.  I'm not certain how to proceed so hopefully someone can help shed some light on this.  Examples of what I'm seeing are below w/ queries used:
For the below query, I expect user story US704118 to be within the data returned but it's not.  This story has an accepted date of 4/30/21 ("AcceptedDate": "2021-04-30T19:00:11.050Z").
https://........query=((AcceptedDate >= "2021-02-01") AND (AcceptedDate <= "2021-04-30"))&fetch=true&start=1&pagesize=200

If I modify the start of the date range to be >"2021-04-30" through a later date (shown below), the story shows up in the data returned even though I would expect it not to.

https://.........query=((AcceptedDate > "2021-04-30") AND (AcceptedDate <= "2021-12-30"))&fetch=true&start=1&pagesize=200
Sagi Gabay's profile image
Broadcom Employee Sagi Gabay
Hi Jessica,

It's a very good point you're raising. I feel this is a problem and needs to be fixed.

It seems that the query is comparing strings and not actual date objects. When using (ActualDate <= "2021-04-30") it's essentially running a query (ActualDate <= "2021-04-30T00:00:00.000Z") , so it's concatenating the midnight hour (Mountain Time) but that does indeed skews the results.  The equal operator i.e: =  is the problem here. When expressing something like (ActualDate <= "2021-04-30") you will expect to include the 04.30, but it actually excludes that day. Surely you can include it if you were to query (ActualDate < "2021-05-01") (the next day) , but that doesn't change that it isn't behaving correctly when the equal operator is being used.

My suggestion will be for you to open a support case. Is that something you can do?

Jessica Tonda's profile image
Broadcom Employee Jessica Tonda
Thank you, Sagi.  I just opened up a support case.