ChiliProject is not maintained anymore. Please be advised that there will be no more updates.

We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.

short operator api filters c and o (Bug #500)


Added by Chris Woerle at 2011-06-30 06:12 pm. Updated at 2011-07-11 08:01 pm.


Status:Open Start date:2011-06-30
Priority:Normal Due date:
Assignee:Chris Woerle % Done:

0%

Category:Issue tracking
Target version:-
Remote issue URL: Affected version:master

Description

an api call with

issues.xml?my_field=cstartingvalue

will be filtered

  @@operators = { "="   => :label_equals,
                  "!"   => :label_not_equals,
                  "o"   => :label_open_issues,
                  "c"   => :label_closed_issues,
                  "!*"  => :label_none,
                  "*"   => :label_all,
                  ">="  => :label_greater_or_equal,
                  "<="  => :label_less_or_equal,
                  "<t+" => :label_in_less_than,
                  ">t+" => :label_in_more_than,
                  "t+"  => :label_in,
                  "t"   => :label_today,
                  "w"   => :label_this_week,
                  ">t-" => :label_less_than_ago,
                  "<t-" => :label_more_than_ago,
                  "t-"  => :label_ago,
                  "~"   => :label_contains,
                  "!~"  => :label_not_contains }

  def add_short_filter(field, expression)
    return unless expression
    parms = expression.scan(/^(c|o|!\*|!|\*)?(.*)$/).first
    add_filter field, (parms[0] || "="), [parms[1] || ""]
  end

possible solutions:

  • use c= and o= instead.
  • add = parameter to the list (will work) and tell everybody to use my_fields==cstartingvalue

History

Updated by Chris Woerle at 2011-07-01 03:57 pm

I did this as redmine plugin (sorry) :
https://github.com/suung/redmine_short_operators_fix

Should be working, but you may find some issues.

  • Status changed from Open to Ready for review

Updated by Chris Woerle at 2011-07-02 07:29 pm

  • Assignee deleted (Chris Woerle)

Updated by Felix Schäfer at 2011-07-08 09:39 pm

Chris, I guess I like the c=/o= solution better because it doesn't change the API, whereas forcing everyone to use == would only be doable in a major ChiliProject release. Could you make a pull request with the updated filter and a few tests?

  • Category set to Issue tracking
  • (deleted custom field) set to master
  • Status changed from Ready for review to Open

Updated by Chris Woerle at 2011-07-11 08:01 pm

Felix, yes, I will do this soon.

Currently I don't have a clean chiliproject base and this will cost me a minute.

Updated by Chris Woerle at 2011-07-11 08:01 pm

  • Assignee set to Chris Woerle

Also available in: Atom PDF