Ticket Column: business value calculation
Added by Christian Stüble almost 12 years ago
Hi,
I need to extend redmine and I hope that 'extended fields’ can help here.
We are using redmine and the backlogs plugin to support the SCRUM process of our team. We have already extended tickets by custom field to allow customers (the PO) to define a business value, a possible penalty, and a risk. Together with the story points field I want to calculate a value based on these fields. This value should be shown as a row of the ticket list to be able to sort the tickets according to it. The concrete calculation would be "(value + penalty) / (story_points + risk)”. My question: Is this kind of calculation already possible with “extended fields”? How can this be realized? Do I have to write my own plugin based on extended fields?
I read the documentation of this web site, also the information about how to add special columns. But they could not answer my questions.
Many thanks and best regards,
Chris
Replies (6)
RE: Ticket Column: business value calculation - Added by Andriy Lesyuk almost 12 years ago
Hi!
You need to use Query.add_available_column
and define special column using ExtendedQueryColumn
. The former is provided by core Redmine and the latter is the addition of Extended Fields plugin. See source:init.rb for examples.
However, no sorting is possible with such columns for now...
Thanks,
Andriy
RE: Ticket Column: business value calculation - Added by Christian Stüble almost 12 years ago
Hi,
many thanks for your answer! If I understand you right, I have to write my own plugin which is using the ExtendedQueryColumn from the extended fields plugin? Is there an example available of such a minimalistic plugin? To be honest, I have not written any plugin for Redmine until now.
Best regards,
Chris
RE: Ticket Column: business value calculation - Added by Andriy Lesyuk almost 12 years ago
No example is available, except source:init.rb. Sorry.
RE: Ticket Column: business value calculation - Added by Rohit Talwalkar over 11 years ago
FYI, I needed something similar, here’s the code I threw into init.rb:
Query.add_available_column(ExtendedQueryColumn.new(:calcVal,
:caption => :label_calc_value,
:value => lambda { |issue| issue.custom_field_value(CustomField.find_by_name('Risk')).to_i * issue.custom_field_value(CustomField.find_by_name('Intensity')).to_i * issue.custom_field_value(CustomField.find_by_name('Frequency')).to_i }))
You also need to add label_calc_value into the config/locals/en.yalm file
Hope that helps & good luck!
RE: Ticket Column: business value calculation - Added by Abcd Efgd over 11 years ago
Thank you for your nice plugin.
RE: Ticket Column: business value calculation - Added by Andriy Lesyuk about 11 years ago
Abcd Efgd, thank you!