Post

2 followers Follow
0
Avatar

can we use Date functions in CZQL query ?

Hi,
When i am querying for startdate and duedate using Rest API , i am getting both date and time values.But I want to fetch only date value from StartDate and DueDate fields .

Can we use Date functions in CZQL query ?
How can i achieve that?

Regards,
Ravikanth A

Ravikanth Answered

Please sign in to leave a comment.

2 comments

0
Avatar

Hi Ravikanth,
StartDate & DueDate are DateTime fields.
As the time used with the API is on UTC time zone, the date part alone may be incorrect (for example, you'll get Sep 20 23:00 UTC for Sep 21 8:00Am on UTC-9:00).
Also, the time part is significant when work items have a non integer duration (e.g. 1.5 days, 4 hours etc.).

You cannot remove or ignore the time part with the API, but obviously you can figure out the date from the returned times and build conditions for DateTime fields that would include whole days (e.g. "Start date is Sep 21" condition should be

Start Date >= Sep 21 0:00Am &&
Start Date < Sep 22 0:00Am. You may need to shift those times according to the organizational time zone).
Hope this helps,
Ophir

Ophir Kenig 0 votes
Comment actions Permalink
0
Avatar

Hi Ophir,
Thanks. I will do as you suggest.

Regards
Ravikanth A.

Ravikanth 0 votes
Comment actions Permalink