Feature #8138

Assign Priority based on Category

Added by Daniel Hoelbling almost 12 years ago. Updated over 5 years ago.

Status:NewStart date:2011-04-13
Priority:NormalDue date:
Assignee:-% Done:


Target version:-


I have a rather strange request from a Customer and am wondering if there is already a patch for this somewhere (since I suck at Ruby).

The basic Idea is that the category a ticket is in determines it's Priority. I can hide the Priority from the form so users can't set that. But I somehow need to assign the priority based on what category is selected.

It would require extending either the data-model, or hacking directly into issues.rb with some before_create method and a switch statement on my categories.

Is there an existing patch out there for this? Because I am tempted to simply hack this into issue before_create, but then I'd had to make sure it only runs on this one project etc..

0001-Implemented-IssueCategory-default-Priority-setting.patch Magnifier (3.99 KB) Daniel Hoelbling, 2011-04-18 11:54

Related issues

Duplicated by Redmine - Feature #21224: Assign a priority to a category Closed


#1 Updated by Etienne Massip almost 12 years ago

  • Category set to Issues

#2 Updated by Daniel Hoelbling almost 12 years ago

I think I fixed the issue myself.
Attached you can find my patch that does this pretty much in the same way as assign_to is being handled

Unfortunately I am a complete stranger to Rails so I really didn't know how to effectively write a test for this.. (it's all magic!) but from my testing so far it works.

greetings Daniel

#3 Updated by Daniel Hoelbling almost 12 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

#4 Updated by Etienne Massip over 11 years ago

  • Status changed from Resolved to New

#5 Updated by Go MAEDA about 7 years ago

#6 Updated by Matias Fusaro over 6 years ago


#7 Updated by Matias Fusaro over 5 years ago

Anyone can think of any alternative?

Also available in: Atom PDF