annikoff/redmine_plugin_computed_custom_field

Calculation of Project author

Closed this issue · 5 comments

I find that in Redmine the project author is not saved and try to create a computed field to store this information.
I try this formula but allways save the user that make a change on project configuration.
if !self.identifier_frozen? then
else
User.current.id
end
Please can you help me?

Hi. Try this formula.

current_cf_id = 1 # replace by your value
if new_record?
  User.current.id
else
  custom_field_value(current_cf_id)
end

Thank you very much this work for me.
I have on more question for you, how can I retrieve the old value of this custom field? I try with
custom_field_value(current_cf_id).value_was
but it seems to be an invalid method

You could find an old value in journal_details table.

Didn't work, journal don't have the project type

I suppose you should find some solutions to journalize project or capture custom field changes.