Project

General

Profile

URL to new issue with a specific tracker??

Added by Robert Lankford over 14 years ago

I'm a little embarrassed to ask this, but is there a way to derive a URL that'll take you to the new issue tab for a specific project and also choose a specific tracker? For instance, the URL title text might be:

Log a bug against Project X!

Replies (5)

RE: URL to new issue with a specific tracker?? - Added by Arnaud Martel over 14 years ago

http://www.mysite.org/projects/[project]/issues/new?tracker_id=[trackerid]

for exemple, Create a new patch will create a new issue (patch tracker) inside the redmine project.

Is it what you're looking for ??

RE: URL to new issue with a specific tracker?? - Added by Robert Lankford over 14 years ago

I have one other question. It appears as though you can do this for tracker but not category. For instance, I might like to have a url like:

http://www.mysite.org/projects/[project]/issues/new?tracker_id=[trackerid]&category_id=[categoryid]

I don't think redmine supports the auto-loading of the category via the url, but I could be wrong. It looks as though you'd add something like that in app\controllers\issue_controller.rb around line 129:

  # Add a new issue
  # The new issue will be created from an existing one if copy_from parameter is given
  def new
    @issue = Issue.new
    @issue.copy_from(params[:copy_from]) if params[:copy_from]
    @issue.project = @project
    # Tracker must be set before custom field values
    @issue.tracker ||= @project.trackers.find((params[:issue] && params[:issue][:tracker_id]) || params[:tracker_id] || :first)
    if @issue.tracker.nil?
      render_error l(:error_no_tracker_in_project)
      return
    end
    if params[:issue].is_a?(Hash)
      @issue.attributes = params[:issue]
      @issue.watcher_user_ids = params[:issue]['watcher_user_ids'] if User.current.allowed_to?(:add_issue_watchers, @project)
    end
    @issue.author = User.current

My problem is that I know little to nothing about Ruby. I'll get to this eventually, but do any of you already familiar with Redmine/ruby know of a line or two that could be inserted in the code above to enable automated categorization of new issues?

RE: URL to new issue with a specific tracker?? - Added by Felix Schäfer over 14 years ago

Try issue[category_id]=CATEGORY_ID instead of category_id=CATEGORY_ID.

RE: URL to new issue with a specific tracker?? - Added by Robert Lankford over 14 years ago

Wonderful! Thanks so much for the quick response.

    (1-5/5)