Project

General

Profile

Actions

Feature #1828

closed

Default target version for new issues

Added by Digital Base about 16 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Low
Category:
Issues
Target version:
Start date:
2008-08-28
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed

Description

When creating issues the dropdown targets is empty. There should be a way to set the default selected target.


Files

0001-Adding-default-version.patch (3.46 KB) 0001-Adding-default-version.patch Patch to set a default version per project Eric Thomas, 2010-07-12 22:37
0002-Adding-default-version.patch (1.12 KB) 0002-Adding-default-version.patch Only set default version when creating new issue Eric Thomas, 2010-07-13 07:45
0003-Add-support-for-a-default-target-version-for-a-proje.patch (22.5 KB) 0003-Add-support-for-a-default-target-version-for-a-proje.patch Proper patch for supporting a default target version Eric Thomas, 2010-07-15 07:13
plugins.txt (2.56 KB) plugins.txt plugin list Ivan Rapekas, 2015-01-03 16:07

Related issues

Related to Redmine - Feature #4584: Require a Target Version and Category and provide a default version.Closed2010-01-14

Actions
Related to Redmine - Defect #33113: Default version and assignee are not exposed via projects APIClosedGo MAEDA

Actions
Has duplicate Redmine - Feature #2027: Default Target VersionClosed2008-10-13

Actions
Has duplicate Redmine - Feature #5277: configure default "target" versionClosed2010-04-08

Actions
Has duplicate Redmine - Feature #3324: Default version of a projectClosed2009-05-08

Actions
Has duplicate Redmine - Feature #7020: Auto assign default version on new issueClosed2010-12-02

Actions
Has duplicate Redmine - Feature #12784: preallocate target-version-fieldClosed

Actions
Has duplicate Redmine - Feature #16253: Default versionClosed

Actions
Actions #1

Updated by Digital Base about 16 years ago

An option would be to include a button, assign to next available target/version

Actions #2

Updated by Mischa The Evil about 16 years ago

  • Target version deleted (0.8)

You should first configure versions for the project ("Project" -> "<yourproject>" -> "Settings" -> "Tab: Versions") to see them when creating new issues.
Please report back if this issue should be closed.

Actions #3

Updated by Digital Base about 16 years ago

Mischa The Evil : i know

This ticket is mainly to help people when creating a ticket, if you have numerous versions, i would like the system to be smart enough to select the next upcoming version, or to allow me to set a "default" version on the version management page ("Project" -> "<yourproject>" -> "Settings" -> "Tab: Versions")

Actions #4

Updated by Jean-Philippe Lang almost 16 years ago

  • Tracker changed from Defect to Feature
Actions #5

Updated by Paul Hinze almost 16 years ago

+1

Actions #6

Updated by Thomas Pihl over 15 years ago

I am not sure i agree. Customers always want everything in the next buxfix release no matter what risks and size constraints that are connected to an issue. Even bigger problem when it comes to a Request for Change.

I would rather suggest a "default" checkbox for versions if needed. But then again, i would also like to be able to restrict some roles from using that field at all. When a user sets target version to next bugfix version, others might believe that. We see that all the time on this board as well.

/T

Actions #7

Updated by Steve Diver over 15 years ago

We are having continuing problems with reporters setting an inappropriate "Target version".

Having a default value would definitely be of use - as with several other fields, but the ability to restrict certain roles from assigning them on a per field basis would be of most use.

Actions #8

Updated by Vadim Epstein over 15 years ago

I also need target version not to be empty by default. It is simple and sensible request.

Actions #9

Updated by James Turnbull over 15 years ago

+1

Actions #10

Updated by Ashvin Savani over 15 years ago

+1

its really should be in core features :) Any patch will be helpful.

Actions #11

Updated by Jacob Moen about 15 years ago

I would be nice if a current default version could be set.

I have problems with email created tickets not showing up on the issues list because they don't have a target version set.
One has to log into Redmine and manually set the target version, and the assigned to.

Actions #12

Updated by Eric Thomas over 14 years ago

I created a patch for this. I tried to make it a plugin, but couldn't really do it, so I had to tweak the main core.
Basically, when you edit the project settings, it adds a field to set a default version (if there are any existing versions). Then when you set it, creating/editing an issue will be automatically set to that default version if they don't already have one.

Actions #13

Updated by Eric Thomas over 14 years ago

Here is a modified version of the above patch which only sets the default version when adding a new issue (not when editing an issue).

Actions #14

Updated by Eric Thomas over 14 years ago

Eric Thomas wrote:

Here is a modified version of the above patch which only sets the default version when adding a new issue (not when editing an issue).

Whoops, I screwed up making the patch. For this, in app/views/issues/_attributes.rhtml, apply the following diff.

diff --git a/app/views/issues/_attributes.rhtml b/app/views/issues/_attributes.rhtml
index 5dc401a..59bba5a 100644
--- a/app/views/issues/_attributes.rhtml
+++ b/app/views/issues/_attributes.rhtml
@@ -19,7 +19,7 @@
                      :tabindex => 199) if authorize_for('issue_categories', 'new') %></p>
 <% end %>
 <% unless @issue.assignable_versions.empty? %>
-<p><%= f.select :fixed_version_id, version_options_for_select(@issue.assignable_versions, @issue.fixed_version ||= @project.default_version), :include_blank => true %>
+<p><%= f.select :fixed_version_id, version_options_for_select(@issue.assignable_versions, @issue.new_record? ? @project.default_version : @issue.fixed_version), :include_blank => true %>
 <%= prompt_to_remote(image_tag('add.png', :style => 'vertical-align: middle;'),
                      l(:label_version_new),
                      'version[name]',
Actions #15

Updated by Alex Last over 14 years ago

who can test this and integrate into trunk?

Actions #16

Updated by Eric Thomas over 14 years ago

Alexey Skor wrote:

who can test this and integrate into trunk?

I've attached a proper patch that includes tests and all the config/locales updates. Can somebody please review this?

Actions #17

Updated by Slava Karg about 14 years ago

Does this patch work with Redmine 1.0.1?
I've tried it and got an internal error while trying to open "settings" of project. :(

So had to unpatch and everything works now...

Actions #18

Updated by Eric Thomas about 14 years ago

Slava Karg wrote:

Does this patch work with Redmine 1.0.1?
I've tried it and got an internal error while trying to open "settings" of project. :(

So had to unpatch and everything works now...

I am using the latest redmine and everything works fine. What is the output of your log?

Actions #19

Updated by Slava Karg about 14 years ago

Hi! First of all I used this patch 0003-Add-support-for-a-default-target-version-for-a-proje.patch

patch -p1 < 0003-Add-support-for-a-default-target-version-for-a-proje.patch
patching file app/models/project.rb
patching file app/views/issues/_attributes.rhtml
patching file app/views/projects/_form.rhtml
patching file config/locales/bg.yml
Hunk #1 succeeded at 211 (offset 5 lines).
patching file config/locales/bs.yml
Hunk #1 succeeded at 241 (offset 1 line).
patching file config/locales/ca.yml
Hunk #1 succeeded at 227 (offset 5 lines).
patching file config/locales/cs.yml
Hunk #1 succeeded at 226 (offset 5 lines).
patching file config/locales/da.yml
Hunk #1 succeeded at 239 (offset 1 line).
patching file config/locales/de.yml
Hunk #1 succeeded at 268 (offset 5 lines).
patching file config/locales/el.yml
Hunk #1 succeeded at 236 (offset 5 lines).
patching file config/locales/en.yml
Hunk #1 succeeded at 251 (offset 10 lines).
patching file config/locales/es.yml
Hunk #1 succeeded at 327 (offset 1 line).
patching file config/locales/eu.yml
Hunk #1 succeeded at 246 (offset 5 lines).
patching file config/locales/fi.yml
Hunk #1 succeeded at 252 (offset 1 line).
patching file config/locales/fr.yml
Hunk #1 succeeded at 261 (offset 1 line).
patching file config/locales/gl.yml
Hunk #1 succeeded at 304 (offset 1 line).
patching file config/locales/he.yml
Hunk #1 FAILED at 218.
1 out of 1 hunk FAILED -- saving rejects to file config/locales/he.yml.rej
patching file config/locales/hr.yml
Hunk #1 succeeded at 242 (offset 5 lines).
patching file config/locales/hu.yml
Hunk #1 succeeded at 249 (offset 2 lines).
patching file config/locales/id.yml
Hunk #1 succeeded at 240 (offset 1 line).
patching file config/locales/it.yml
Hunk #1 succeeded at 221 (offset 2 lines).
patching file config/locales/ja.yml
Hunk #1 succeeded at 276 (offset 4 lines).
patching file config/locales/ko.yml
Hunk #1 succeeded at 288 (offset 1 line).
patching file config/locales/lt.yml
Hunk #1 succeeded at 299 (offset 1 line).
patching file config/locales/mn.yml
Hunk #1 succeeded at 241 (offset 5 lines).
patching file config/locales/nl.yml
Hunk #1 succeeded at 270 (offset 5 lines).
patching file config/locales/no.yml
Hunk #1 succeeded at 220 (offset 1 line).
patching file config/locales/pl.yml
Hunk #1 succeeded at 291 (offset 1 line).
patching file config/locales/pt-BR.yml
Hunk #1 succeeded at 253 (offset 1 line).
patching file config/locales/pt.yml
Hunk #1 succeeded at 238 (offset 1 line).
patching file config/locales/ro.yml
Hunk #1 succeeded at 221 (offset 1 line).
patching file config/locales/ru.yml
Hunk #1 succeeded at 377 (offset 2 lines).
patching file config/locales/sk.yml
Hunk #1 succeeded at 220 (offset 1 line).
patching file config/locales/sl.yml
Hunk #1 succeeded at 225 (offset 2 lines).
patching file config/locales/sr.yml
Hunk #1 FAILED at 230.
1 out of 1 hunk FAILED -- saving rejects to file config/locales/sr.yml.rej
patching file config/locales/sv.yml
Hunk #1 succeeded at 296 (offset 8 lines).
patching file config/locales/th.yml
Hunk #1 succeeded at 222 (offset 5 lines).
patching file config/locales/tr.yml
Hunk #1 succeeded at 249 (offset 1 line).
patching file config/locales/uk.yml
Hunk #1 succeeded at 216 (offset 5 lines).
patching file config/locales/vi.yml
Hunk #1 succeeded at 283 (offset 1 line).
patching file config/locales/zh-TW.yml
Hunk #1 succeeded at 336 (offset 4 lines).
patching file config/locales/zh.yml
Hunk #1 succeeded at 261 (offset 1 line).
patching file db/migrate/109_add_default_version_to_project.rb
patching file test/fixtures/projects.yml
patching file test/functional/issues_controller_test.rb
Hunk #1 succeeded at 330 (offset -66 lines).

After that while I try to click "Settings" of any project I get Internal Server Error. Here is log:

Processing ProjectsController#settings (for x.x.x.x at 2010-10-12 18:22:14) [GET]
  Parameters: {"action"=>"settings", "id"=>"com001", "controller"=>"projects"}
Rendering template within layouts/base
Rendering projects/settings

ActionView::TemplateError (undefined method `default_version_id' for #<Project:0xb69522f0>) on line #20 of app/views/projects/_form.rhtml:
17: <p><%= f.check_box :is_public %></p>
18:
19: <% if Project.exists?(@project) && !@project.shared_versions.empty? %>
20:   <p><%= f.select :default_version_id, version_options_for_select(@project.shared_versions, @project.default_version), :include_blank => true %></p>
21: <% end %>
22:
23: <%= wikitoolbar_for 'project_description' %>

    lib/tabular_form_builder.rb:38:in `select'
    app/views/projects/_form.rhtml:20:in `_run_rhtml_app47views47projects47_form46rhtml_locals_f_form_object'
    app/views/projects/_edit.rhtml:2:in `_run_rhtml_app47views47projects47_edit46rhtml_locals_edit_object_tab'
    app/helpers/application_helper.rb:697:in `labelled_tabular_form_for'
    app/views/projects/_edit.rhtml:1:in `_run_rhtml_app47views47projects47_edit46rhtml_locals_edit_object_tab'
    app/views/common/_tabs.rhtml:24:in `_run_rhtml_app47views47common47_tabs46rhtml_locals_object_tabs'
    app/views/common/_tabs.rhtml:23:in `each'
    app/views/common/_tabs.rhtml:23:in `_run_rhtml_app47views47common47_tabs46rhtml_locals_object_tabs'
    app/helpers/application_helper.rb:197:in `render_tabs'
    app/views/projects/settings.rhtml:3:in `_run_rhtml_app47views47projects47settings46rhtml'
    /opt/redmine/passenger-2.2.11/lib/phusion_passenger/rack/request_handler.rb:92:in `process_request'
    /opt/redmine/passenger-2.2.11/lib/phusion_passenger/abstract_request_handler.rb:207:in `main_loop'
    /opt/redmine/passenger-2.2.11/lib/phusion_passenger/railz/application_spawner.rb:418:in `start_request_handler'
    /opt/redmine/passenger-2.2.11/lib/phusion_passenger/railz/application_spawner.rb:358:in `handle_spawn_application'
    /opt/redmine/passenger-2.2.11/lib/phusion_passenger/utils.rb:184:in `safe_fork'
    /opt/redmine/passenger-2.2.11/lib/phusion_passenger/railz/application_spawner.rb:354:in `handle_spawn_application'
    /opt/redmine/passenger-2.2.11/lib/phusion_passenger/abstract_server.rb:352:in `__send__'
    /opt/redmine/passenger-2.2.11/lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
    /opt/redmine/passenger-2.2.11/lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
    /opt/redmine/passenger-2.2.11/lib/phusion_passenger/abstract_server.rb:163:in `start'
    /opt/redmine/passenger-2.2.11/lib/phusion_passenger/railz/application_spawner.rb:213:in `start'
    /opt/redmine/passenger-2.2.11/lib/phusion_passenger/spawn_manager.rb:262:in `spawn_rails_application'
    /opt/redmine/passenger-2.2.11/lib/phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add'
    /opt/redmine/passenger-2.2.11/lib/phusion_passenger/spawn_manager.rb:256:in `spawn_rails_application'
    /opt/redmine/passenger-2.2.11/lib/phusion_passenger/abstract_server_collection.rb:80:in `synchronize'
    /opt/redmine/passenger-2.2.11/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
    /opt/redmine/passenger-2.2.11/lib/phusion_passenger/spawn_manager.rb:255:in `spawn_rails_application'
    /opt/redmine/passenger-2.2.11/lib/phusion_passenger/spawn_manager.rb:154:in `spawn_application'
    /opt/redmine/passenger-2.2.11/lib/phusion_passenger/spawn_manager.rb:287:in `handle_spawn_application'
    /opt/redmine/passenger-2.2.11/lib/phusion_passenger/abstract_server.rb:352:in `__send__'
    /opt/redmine/passenger-2.2.11/lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
    /opt/redmine/passenger-2.2.11/lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'

Rendering /opt/dist/ruby/redmine-1.0.1/public/500.html (500 Internal Server Error)
Actions #20

Updated by Eric Thomas about 14 years ago

The patch involves a database update. rake db:migrate should do the trick for you.

Actions #21

Updated by Slava Karg about 14 years ago

Well thanks! Error disappeared :)
Now I cant figure out how to set "default version": I looked at project settings and didn't find anything related ... o_O

Actions #22

Updated by Eric Thomas about 14 years ago

You should find it under Administration --> Projects --> Select a project --> Information tab --> Default version

Actions #23

Updated by Slava Karg about 14 years ago

Well this feature appeared just after restarting Apache :) Thanks!

Actions #24

Updated by Alex Last almost 14 years ago

is this a part of 1.0.3 release?

Actions #25

Updated by James Moore almost 14 years ago

I noticed that I could no longer set a default version after updating to 1.0.5. You need to add default_version_id to the safe_attributes list in app/models/project.rb

Actions #26

Updated by Ryan H over 13 years ago

Is this going to get rolled into the trunk at all?

Actions #27

Updated by Jean-Philippe Lang over 13 years ago

  • Target version set to Candidate for next major release
Actions #28

Updated by Radek Karban over 13 years ago

+1

Actions #29

Updated by Terence Mill about 13 years ago

+1

Actions #30

Updated by Adam Klinkosz about 13 years ago

+1

Actions #31

Updated by Oli Kessler about 13 years ago

+1

Actions #32

Updated by Tony Marschall almost 13 years ago

I have create a plugin with patches provided here + safe_attributes: http://www.redmine.org/plugins/default-version

Actions #33

Updated by Stéphane Thomas over 12 years ago

+1

Could this be be released in trunk, as requested 12 months ago?

Actions #34

Updated by Manuel Meurer over 12 years ago

+1

Actions #35

Updated by Anonymous over 12 years ago

+1

Actions #36

Updated by Anonymous over 12 years ago

Tony Marschall wrote:

I have create a plugin with patches provided here + safe_attributes: http://www.redmine.org/plugins/default-version

Thanks for plugin!

Actions #37

Updated by Rafael Amorim over 12 years ago

+1

It should be released asap

Actions #38

Updated by Roberto C over 12 years ago

+1

I'd like to have this feature, with some of the ideas posted here.

Tony's plugin posted above doesn't work with Redmine 1.3+, only until 1.2

Actions #39

Updated by Ben Asher over 12 years ago

I'm maintaining the new working fork at https://github.com/benasher44/redmine_default_version as specified in Tony Marschall's github repo readme. The latest update works with rails 2 and 3 and redmine versions 1.2.x-1.4.x and 2.0.x.

Actions #40

Updated by Felix Muster almost 12 years ago

can you make it compatible with redmine v2.2.0?

Actions #41

Updated by Dipan Mehta over 11 years ago

+1 This is very important.

Actions #42

Updated by Olivier B over 11 years ago

Is there a way to have this feature in redmine 2.3.1 (patch, plugin ?). Thanks

Actions #43

Updated by Maxime Vez over 11 years ago

+1

I also have redmine 2.3.1 installed (awsome product btw) and being able to pre-select a default version for a new issue would save time and simplify the process (my users are not very familiar with the process and they always forget to assign a version).

Thank you.

Actions #44

Updated by Francesco V about 11 years ago

+1

Actions #45

Updated by Mattanja Kern about 11 years ago

+1 Because we'd like to make the target version mandatory for bug reports but set it to the current live version by default.

Actions #46

Updated by Karel Pičman about 11 years ago

+1

Actions #47

Updated by Angelo Bertolli over 10 years ago

Which version has this patch been applied to? I am running version 2.0.4 in a production environment.

Actions #48

Updated by Lajish Lakshmanan over 10 years ago

Is there any patch or plugin avaialable for 2.4.2 or 2.5.2

Actions #49

Updated by Ivan Rapekas almost 10 years ago

Lajish Lakshmanan wrote:

Is there any patch or plugin avaialable for 2.4.2 or 2.5.2

Hello,

seems https://github.com/benasher44/redmine_default_version works with 2.5.3

Actions #50

Updated by Pedro Calvo over 9 years ago

+1

Actions #51

Updated by Erik Álvarez about 9 years ago

+1 This would be very helpful for backlog items.

Actions #52

Updated by Jean-Philippe Lang almost 9 years ago

  • Subject changed from Default Target : New Issue to Default target version for new issues
  • Status changed from Resolved to Closed
  • Assignee set to Jean-Philippe Lang
  • Target version changed from Candidate for next major release to 3.2.0
  • Resolution set to Fixed

Feature added in r14786.

Actions #53

Updated by Jean-Philippe Lang almost 9 years ago

Actions #54

Updated by Toshi MARUYAMA almost 9 years ago

Actions #55

Updated by Toshi MARUYAMA almost 9 years ago

Actions #56

Updated by Go MAEDA over 4 years ago

  • Related to Defect #33113: Default version and assignee are not exposed via projects API added
Actions

Also available in: Atom PDF