Feature #19828

Rest API for projects - filter on project status.

Added by Ryan Eberly over 6 years ago. Updated over 2 years ago.

Status:ClosedStart date:
Priority:LowDue date:
Assignee:-% Done:

0%

Category:REST API
Target version:-
Resolution:Duplicate

Description

Our company uses redmine to track projects for a period of time, and then close them. We have a few hundred projects in redmine - most of them closed.

Rest_Projects

It would be good to be able to return only open projects via the rest API.

For example:
/projects.xml?status=1
or
/projects.json?status=1

rest-api-filter-on-project-status.diff Magnifier (1.81 KB) naoki takaesu, 2019-07-03 07:30

19828-reset-api-filter-on-project-status-v2.diff Magnifier (1.85 KB) naoki takaesu, 2019-07-06 04:24


Related issues

Duplicates Redmine - Feature #12921: REST-API: filter projects by status New

History

#1 Updated by Toshi MARUYAMA over 6 years ago

  • Description updated (diff)

#2 Updated by Go MAEDA over 5 years ago

  • Status changed from New to Closed
  • Resolution set to Duplicate

Closing as a duplicate of #12921.

#3 Updated by Go MAEDA over 5 years ago

  • Duplicates Feature #12921: REST-API: filter projects by status added

#4 Updated by naoki takaesu over 2 years ago

I wrote a patch.

#5 Updated by Seiei Miyagi over 2 years ago

naoki takaesu wrote:

I wrote a patch.

all? returns true for [], so you need to put assert json['projects'].any? before assert json['projects'].all? {|p| p['status'] == 1} to confirm filtering projects.

#6 Updated by naoki takaesu over 2 years ago

Seiei Miyagi wrote:

all? returns true for [], so you need to put assert json['projects'].any? before assert json['projects'].all? {|p| p['status'] == 1} to confirm filtering projects.

Hi Seiei,
Thank you for the review.
I am glad to know it.
I will attach the second patch.

Also available in: Atom PDF