Project

General

Profile

Getting lists of issues based on custom conditions in plugins

Added by Martin Häusler over 11 years ago

Hi there,

this is my first post here :-) I am currently creating my second theme (I will publish this theme) for redmine. While I created the theme I wanted to have some enhancements for the project overview. I thought this would be a great start to get in touch with the plugin development.

Well, I created my first plugin based on the tutorials and documentations I found here. It was easier I thought ;) So now I have a plugin which adds a list of 15 open tickets to the project overview. Now I want to show a list of recently closed tickets. I did not found anything in the documentation to get a list of issues based on custom conditions. Also there is no "closed" scope of tickets.

So I'm asking the community: is there a documentation / guideline or anything else I can read to get familiar with the core redmine? Sure, I can use an controller hook and simply call something like

Issue.where(:is_closed => true)

but I don't think this is the proper way for it ;)

I have many ideas which I want to realize and contribute to the community as I'm using redmine everyday in my work as an freelancer! Great project, great software!

If anyone does know more or is willing to help, just let me know :-)

Regards,
Martin


Replies (2)

RE: Getting lists of issues based on custom conditions in plugins - Added by Dhanasingh Krishnapandian over 11 years ago

Martin,
This is what we do in the Weekly Timesheet plugin
cond =["#{IssueStatus.table_name}.is_closed = ?", true]
issues = Issue.find_all_by_project_id(params[:project_id],
:conditions => cond,
:include => :status, :order => 'project_id')

I actually found a good discussion around issue closed date, I couldn't locate it now.
If I find it I will let you know.
Dhanasingh

RE: Getting lists of issues based on custom conditions in plugins - Added by Martin Häusler over 11 years ago

Hi Dhanasingh,

thanks a lot for your answer! That helped me a lot! If you finde the discussion, let me know please!

Martin

    (1-2/2)