Defect #19088
closedfrom or updated_on filters not working on issues Rest API ?
0%
Description
On redmine 2.5.1 stable, but also on 2.4.2, I try to filter issues on their updated_date.
I saw #8842 and tried ?from>= but no change.
Other element about my environment is : use of mysql.
eg :
/issues.json?from<=2014-02-12 /issues.json?from>=2014-02-12 /issues.json?updated_on>2016-02-12 /issues.json?updated_on<2014-02-12 /issues.json?updated_on%3C2014-02-12T00:00:00Z
All return the same payload : all issues, which have a similar updated_on date : "updated_on":"2015-02-10T14:56:02Z"
{"issues":[{"id":18,"project":{"id":52,"name":"Google Plus API"},"tracker":{"id":3,"name":"Support"},"status":{"id":1,"name":"New"},"priority":{"id":2,"name":"Normal"},"author":{"id":16,"name":"Talia Greenfelder"},"assigned_to":{"id":5,"name":"Jaskolski Inc (00000000-0000-0000-0000-000000000002)"},"subject":"Esse est perferendis porro et","description":"Nam possimus quaerat velit aperiam nobis quia autem. Quisquam perspiciatis quia est.","start_date":"2015-02-10","done_ratio":0,"created_on":"2015-02-10T14:56:01Z","updated_on":"2015-02-10T14:56:02Z"},...],"total_count":18,"offset":0,"limit":25 }
Extract fromp mysql dump :
-- MySQL dump 10.13 Distrib 5.5.41, for debian-linux-gnu (x86_64) -- -- Host: localhost Database: redmine_default -- ------------------------------------------------------ -- Server version 5.5.41-0+wheezy1 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; INSERT INTO `issues` VALUES (1,3,54,'Quod laboriosam sed aut aut','Et ex molestiae aspernatur dolorum hic sit. Sint placeat nobis et reiciendis. Qui magnam quia sit aut id ea qui. Qui voluptatem adipisci ex id enim.',NULL,NULL,1,4,2,NULL,9,2,'2015-02-10 15:55:34','2015-02-10 15:55:35','2015-02-10',0,NULL,NULL,1,1,2,0,NULL) /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `issues` ( `id` int(11) NOT NULL AUTO_INCREMENT, `tracker_id` int(11) NOT NULL, `project_id` int(11) NOT NULL, `subject` varchar(255) NOT NULL DEFAULT '', `description` text, `due_date` date DEFAULT NULL, `category_id` int(11) DEFAULT NULL, `status_id` int(11) NOT NULL, `assigned_to_id` int(11) DEFAULT NULL, `priority_id` int(11) NOT NULL, `fixed_version_id` int(11) DEFAULT NULL, `author_id` int(11) NOT NULL, `lock_version` int(11) NOT NULL DEFAULT '0', `created_on` datetime DEFAULT NULL, `updated_on` datetime DEFAULT NULL, `start_date` date DEFAULT NULL, `done_ratio` int(11) NOT NULL DEFAULT '0', `estimated_hours` float DEFAULT NULL, `parent_id` int(11) DEFAULT NULL, `root_id` int(11) DEFAULT NULL, `lft` int(11) DEFAULT NULL, `rgt` int(11) DEFAULT NULL, `is_private` tinyint(1) NOT NULL DEFAULT '0', `closed_on` datetime DEFAULT NULL, PRIMARY KEY (`id`), KEY `issues_project_id` (`project_id`), KEY `index_issues_on_status_id` (`status_id`), KEY `index_issues_on_category_id` (`category_id`), KEY `index_issues_on_assigned_to_id` (`assigned_to_id`), KEY `index_issues_on_fixed_version_id` (`fixed_version_id`), KEY `index_issues_on_tracker_id` (`tracker_id`), KEY `index_issues_on_priority_id` (`priority_id`), KEY `index_issues_on_author_id` (`author_id`), KEY `index_issues_on_created_on` (`created_on`), KEY `index_issues_on_root_id_and_lft_and_rgt` (`root_id`,`lft`,`rgt`) ) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */;
Same things happens with .xml serialisation
/issues.xml?updated_on<2014-02-12T00:00:00Z
Is the bug mysql-related ? I am convinced by the test test_index_should_allow_timestamp_filtering that it should work.
Updated-on for related tickets¶
Another related thing, but I think it is an usage issue from my part : updated_on for issues that are related to other issues is not updated when new related issues are connected.
Eg my use case is : I would like to list "Macro" issues by desc date, with my "macro" Issue date depending on when a ticket was added as related to my Macro issue, and not when the macro Issue was last edited.
Updated by fabien otafcc almost 10 years ago
- Status changed from New to Resolved
My bad or bad documentation : retested
updated_on needs an equal sign to note it as a parameter (?updated_on=)
Good syntax is /issues.xml?updated_on=<2014-02-12T00:00:00Z or tidbits like these
?created_on=%3E%3C2014-03-01|2014-03-07
&updated_on=%3E%3C2015-08-01|2015-08-05
Noticed that after a Recheck on Rest_Issues
- to note : the Rest issues API has a logical "onscreen" approach, so it is filtering by default only "active" or "Open" status_id. (I don't know whether this depends on our redmine setup)
This is not really documented in the doc page : so in order to get all Issues, &status_id=* parameter is mandatory.
Updated by Toshi MARUYAMA over 9 years ago
- Status changed from Resolved to Closed