Forums » Development »
Custom fields
Added by J S over 11 years ago
I want to make a custom field with a unique property, could I make a plugin to do this or would I have to dive into the Redmine code? Can someone give me a pointer, please?
Replies (6)
RE: Custom fields - Added by Terence Mill over 11 years ago
I don't undertstand. You want to allow only one value? This sounds you wanna create a custom field of type bollean property [true][false].
http://redmine.yours/custom_fields/new?type=IssueCustomField
Choose type boolean.
RE: Custom fields - Added by J S over 11 years ago
Actually I was thinking more along the lines of a unique priority. So no two items in the list can have the same number.
RE: Custom fields - Added by Terence Mill over 11 years ago
If you define a list as admin (thats the only custom field can be created),you can choose whatever you want. Also items what are not duped each other. Thats already possible.
RE: Custom fields - Added by J S over 11 years ago
The feature I want does not exist so I need to hard code it. I basically want a unique integer for each bug. For example, Bug no. 1 has a priority 2, bug no. 2 has a priority of 3, bug no. 3 has a priority of 1. If i try to assign the priority of no. 4 to be 1 then bugs no. 1 - 3 should bump up 1 level in priority because it is a unique integer. A good starting point would be learning to program a new field that is not a "custom field", but that is a hard coded field. Could you tell me which .rb files I would need to look at to make this possible?
RE: Custom fields - Added by Anonymous over 11 years ago
It might be helpful to look through some of the 'backlog', scrum-style plugins that have been built over the years. The basic principle of the backlog is that it's a list of uniquely prioritized items. You might be able to adopt some of the logic (or an entire plugin) used for them.
RE: Custom fields - Added by dj jones about 11 years ago
JS - you seem to want Redmine to have to edit other Bugs - when you create a new one. (or when you edit just one).
That would be a big performance hit on the server if there are many bugs in the system.
This workflow may get you what you want:
System
- saves priority as a number (not just an integer)
- the 'top priority' is the smallest number (negative numbers are allowed)
- so -2 is higher priority than -1 and 1 and 2.6 and 4.1; and 1.5 is higher priority than 2 and 4.5
User can enter a priority of 'top' - means top priority
When the user enters 'top'
- search all bugs sort for lowest priority - and edit the current record to be lower than that.
- no need to change any other records
Then if you want to extent that to allow the user to enter '2nd_top' meaning 2nd priority, etc