View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0025102||mantisbt||api rest||public||2018-12-20 08:00||2019-03-16 20:20|
|Target Version||2.20.0||Fixed in Version||2.20.0|
|Summary||0025102: /api/rest/issues endpoint supposedly returns *all* issues, but doesn't|
Both for a specific project, as well as for all projects, the issues returned are based on some sort of filter, instead of returning, as expected, all issues (resolved, unresolved, closed, acknowledged, new, etc)
When calling this API, I expected to receive all issues for either all projects, or a specified project, not only a subset of them.
However, not all issues are returned, only a subset of them, presumably based on either a set filter in Mantis, or some other criteria.
Currently, I don't see a way to receive, for example, closed or new issues - I only ever receive assigned ones. I can't even receive resolved issues this way.
Since I can specify a filter with these calls (filter_id = <id of filter or unassigned, assigned, monitored, etc>), not specifying a specific filter (omitting the field entirely) should return all issues, unfiltered.
|Tags||No tags attached.|
or am I using the API in a wrong way?
The output is paged, you have to submit multiple requests
Does this fix your issue?
is there a limit to page_size? for testing purposes, I just use page_size=100000 - might that be the issue?
I didn't try, but I assume you might get issues depending on various PHP settings when fetching a lot of issues in one go, e.g. http://php.net/manual/en/ini.core.php#ini.memory-limit
I just did some more testing - I do strongly believe it has to do with the Filter I've set in the Web UI.
I do use the project_id parameter, though - does that change anything? are issues for projects based on the filter the user has set up for that project?
I recommend to upgrade to 2.19.0 as a first step.
Independent from that, do you have installed any plugins or did you change any original source of Mantis?
my install of MantisBT is vanilla - no plugins.
upgraded to 2.19.0 today, same issue.
the expected result would be that all issues are returned (from closed to new), however, in the case of the screenshot, only issues below resolved status are returned.
no plugins, no custom code.
Strange, not sure what I tried before, but I am now able to reproduce the issue
That's because the call chain is:
$t_issues = mc_project_get_issues('', '', $t_project_id, $t_page_number, $t_page_size );
So issue retrieval always returns filtered results. And if no custom filter is supplied, a default/current is used.
A 'hotfix' (1) might be:
 IMHO a 'bugs_api' (with applied filters, if requested) would be a better approach.
alternate suggestion (I'm not at all familiar with the MantisBT code base, this is just food for thought) :
I am a bit astonished as the function is also used in SOAP API since many years.
we can look. I think that changes in that function were made to keep the same behaviour, but let's make sure.
Seems like the relevant changes in filter_api predates the rest api, and i can't easily test soap api at the moment.
I think that the intention of this function has always been that. See filter_get_bug_rows(), filter_get_bug_rows_filter()
However, there is some point where filter related changes fixed the retrieval of persistent filters, so it actually gets the "currently applied" filter for each project, instead of failing in most cases (and fallback to a default)
But rest/soap has an explicit param 'filter_id' to request a filtered issue list. So internally using 'filter_get_bug_rows', which implicitly
Is a established code procedure, when requesting a filter to get explicitly all issues, to reset the hide-status property. This is done in my-view, summary, etc to work around that "default". I think it is not an ideal workflow, but needs time and care to be redesigned.
MantisBT: master 4cc687a9
Committer: vboctor Details Diff
|Fix not all issues returned via REST API
- Add FILTER_STANDARD_ANY
- Add filter_create_any() to filter_api
- Handle FILTER_STANDARD_ANY in filter_standard_get
- Use in issues_rest, if the request doesn't contain a filter_id
|mod - api/rest/restcore/issues_rest.php||Diff File|
|mod - api/soap/mc_filter_api.php||Diff File|
|mod - core/constant_inc.php||Diff File|
|mod - core/filter_api.php||Diff File|
|2018-12-20 08:00||eternalstorms||New Issue|
|2019-01-21 13:54||eternalstorms||Note Added: 0061261|
|2019-01-21 15:57||atrol||Status||new => feedback|
|2019-01-21 15:57||atrol||Note Added: 0061265|
|2019-01-21 15:58||atrol||Note Edited: 0061265||View Revisions|
|2019-01-21 15:58||atrol||Note Edited: 0061265||View Revisions|
|2019-01-22 07:38||eternalstorms||Note Added: 0061270|
|2019-01-22 07:38||eternalstorms||Status||feedback => new|
|2019-01-22 08:14||atrol||Status||new => feedback|
|2019-01-22 08:14||atrol||Note Added: 0061271|
|2019-01-23 11:26||eternalstorms||Note Added: 0061278|
|2019-01-23 11:26||eternalstorms||Status||feedback => new|
|2019-01-28 17:38||eternalstorms||Note Added: 0061314|
|2019-01-30 14:44||atrol||Status||new => feedback|
|2019-01-30 14:44||atrol||Note Added: 0061334|
|2019-01-31 03:30||eternalstorms||Note Added: 0061347|
|2019-01-31 03:30||eternalstorms||Status||feedback => new|
|2019-01-31 03:32||atrol||Status||new => feedback|
|2019-02-06 13:51||eternalstorms||File Added: Screenshot of Safari (06-02-2019, 19-49-30).png|
|2019-02-06 13:51||eternalstorms||Note Added: 0061424|
|2019-02-06 13:51||eternalstorms||Status||feedback => new|
|2019-02-06 13:56||eternalstorms||Note Edited: 0061424||View Revisions|
|2019-02-06 13:57||eternalstorms||Note Edited: 0061424||View Revisions|
|2019-02-06 15:30||atrol||Relationship added||related to 0021996|
|2019-02-06 15:31||atrol||Status||new => confirmed|
|2019-02-06 15:39||atrol||Note Added: 0061425|
|2019-02-06 18:52||obmsch||Note Added: 0061426|
|2019-02-07 02:02||eternalstorms||Note Added: 0061427|
|2019-02-07 02:02||eternalstorms||Note Edited: 0061427||View Revisions|
|2019-02-07 02:30||atrol||Note Added: 0061429|
|2019-02-07 02:46||cproensa||Note Added: 0061430|
|2019-02-07 04:18||cproensa||Note Added: 0061432|
|2019-02-07 05:08||obmsch||Note Added: 0061433|
|2019-02-07 05:46||cproensa||Note Added: 0061434|
|2019-02-11 17:18||obmsch||Note Added: 0061480|
|2019-02-13 09:30||atrol||Assigned To||=> community|
|2019-02-13 09:30||atrol||Status||confirmed => assigned|
|2019-02-24 16:00||vboctor||Changeset attached||=> MantisBT master 4cc687a9|
|2019-02-24 16:00||vboctor||Assigned To||community => vboctor|
|2019-02-24 16:00||vboctor||Status||assigned => resolved|
|2019-02-24 16:00||vboctor||Resolution||open => fixed|
|2019-02-24 16:00||vboctor||Fixed in Version||=> 2.20.0|
|2019-02-24 16:37||vboctor||Assigned To||vboctor => community|
|2019-02-24 16:37||vboctor||Target Version||=> 2.20.0|
|2019-03-05 17:08||cproensa||Relationship added||related to 0025515|
|2019-03-16 20:20||vboctor||Status||resolved => closed|