如何通过redmine API正确获取新问题列表?
我正在创建一个小工具,它将从我们的 redmine 存储库中获取新问题并对它们执行一些实用任务。我计划该工具在后台运行,并每分钟轮询 redmine 是否有新问题。
我可以通过 GET /issues.xml
API 获取所有问题,但我不知道如何正确轮询自上次调用以来的新问题。我建议的唯一方法是使用 updated_on
字段并获取更新时间 > 的问题。上次投票时间。正确吗?如果这是正确的,我如何解决更新时间问题>指定时间?
API 文档页面 有诸如 GET /issues.xml?project_id=2 之类的示例
,但这是相等比较,我需要比较“update_time”是否大于指定时间。
当然,GET /issues.xml?update_time>'01.10.10 12:08:41'
,我建议它必须是特殊的语法来进行比较。
有关我可以使用的正确 API 请求的任何提示吗?
I'm creating a small tool that will fetch new issues from our redmine repository and do some utility task on them. I'm planning the tool to run in background and to poll redmine for new issues ~ every minute.
I have no problems getting all issues via GET /issues.xml
API, but I don't know how to correctly poll new issues since last call. The only way i can suggest is to use updated_on
field and get issues that has update time > last poll time. Is it correct? And if this is correct, how I can get issues with update time > specified time?
The API documentation page has examples like GET /issues.xml?project_id=2
, but this is equality comparison and i need to compare if "update_time" is GREATER THAN specified time.
Of course, GET /issues.xml?update_time>'01.10.10 12:08:41'
, and I suggest that it must be special syntax for comparison.
Any hints on correct API request I can use?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
经过与开发者沟通后我发现正确的API请求是:
After communication with developers i have found that correct API request will be:
这对我获取最新更新的问题很有帮助。找不到仅在时间 x 之后更新问题的解决方案。如果您需要的话,使用 &offset=100 ... &offset=200 等可以得到以下问题。
This worked for me to get the most recently updated issues. Could not find a solution to only get issues updated after time x. Use &offset=100 ... &offset=200 and so on to get the following issues if you need them.