Project

General

Profile

Trying to use "String" Custom Fields for datetimes and fill it automatically

Added by Gurvan Le Dromaguet almost 11 years ago

Hi,

Similarly to "Closed Date" field that was added recently, I need to record other key dates for tracking. For this I would need: I did not find existing solutions for these 2 items, so I have considered:
  • Using a Custom field type "String" to record date times with a fixed predefined format (eg: 2013/09/01 16:41 UTC), quite easy in Ruby:
    dnow=DateTime.now
    dnow.strftime("%Y-%m-%d %H-%M-%S UTC")
  • For triggers, I thought I could add a method in issue.rb update(), but can't get it to work.
    2 problems: How to get the former state ? How to update the custom field ? I tried this:http://stackoverflow.com/questions/16958500/creating-and-populating-redmine-custom-fields-by-ruby-code but no luck my field is never updated (and I have big troubles understanding the code)

Did anyone code successfully such a mechanism ?

Thanks