Project

General

Profile

how to set default assignee to <<me>>

Added by weiquan zhang over 10 years ago

How to set default assignee to <<me>> when create new issues? that is, by default the new issue will be assigned to the one who creates it.


Replies (4)

RE: how to set default assignee to <<me>> - Added by Ivan Cenov over 10 years ago

there is no automatic way to do this.

RE: how to set default assignee to <<me>> - Added by Fernando Merlos 11 days ago

For those who may be interested, here is a possible workaround:

1. Edit the file app/views/issues/_form.html.erb
2. Add the line "$(".assign-to-me-link").click();" at the end of the document ready function

...
<%= javascript_tag do %>
$(document).ready(function(){
  ...
  $(".assign-to-me-link").click();
});
<% end %>

3. Restart your Redmine server

RE: how to set default assignee to <<me>> - Added by Fernando Merlos 9 days ago

Fernando Merlos wrote in RE: how to set default assignee to <<me>>:

For those who may be interested, here is a possible workaround:

1. Edit the file app/views/issues/_form.html.erb
2. Add the line "$(".assign-to-me-link").click();" at the end of the document ready function

[...]

3. Restart your Redmine server

For old versions of the Redmine that has not the 'Assign to me' button, here's the workaround that works for the version with or without the button, by adding the next next code at the end of the file 'app/views/issues/_form.html.erb':

...
<%= javascript_tag do %>
$(document).ready(function(){
  ...
  /* Set default assignee to << me >> */
  try {
    var assign_to_me_link_elm = $(".assign-to-me-link");
    if ((assign_to_me_link_elm) && (assign_to_me_link_elm.length > 0) &&
        (assign_to_me_link_elm[0]) && (assign_to_me_link_elm[0].className == 'assign-to-me-link')) {
      assign_to_me_link_elm.click();
    } else {
      document.getElementById("issue_assigned_to_id").selectedIndex = "1";
    }
  } catch (error) {
    console.error(error);
  }
});
<% end %>

    (1-4/4)