Content
You are here:
time_entries API do not work with eprops
Added by Frédéric MAZUR over 1 year ago
Hello,
I am trying to retrieve some data with the API, and especially the time entries.
I have coded this in python, and I have some difficulties. When I get time entries with a filter, the filter don't work if I use the "eprops" method, while it works with the "filter" method .
Here are my two urls :
- http://xxx.com:8080/api/v3/time_entries?eprops=eJyrVkrLzClJLSpWslJQiq6OUSouSM0ric/PiwEKALn5BalFiSX5RSBujFJJjJIOkCpLzClNLQYJRcfW1sYq1QIASHwXVA%3D%3D
- http://xxx.com:8080/api/v3/time_entries?filters=%5B%7B%22spent_on%22%3A%20%7B%22operator%22%3A%20%22t%22%2C%20%22values%22%3A%20%5B%5D%7D%7D%5D
The first don't work, while the second works well. The first always return all the time entries as if it was not filtered.
The decoding eprops can be done with this python code :
import json
import urllib
import base64
import zlib
def eprops_to_dict( string ):
result = ""
unquoted = urllib.parse.unquote(string)
decoded = base64.b64decode(unquoted)
decompressed = zlib.decompress( decoded)
result = decompressed.decode("utf-8")
return result
Result is :
{"filters": "[{\"spent_on\": {\"operator\": \"t\", \"values\": []}}]"}
If I use the same method for another API query, for example work_packages, it works well. I don't understand what happens ?
Thanks a lot for your help.
F. MAZUR.