annikoff/redmine_plugin_computed_custom_field

Change "Link values to URL" for custom field

Closed this issue · 4 comments

How to get/set "Link values to URL" property for custom field? When I use expression e.g. for id property of the custom field: cfs[46].id, I got the error: "Formula undefined method `id' for 1:Fixnum Did you mean? i"

I would like to make thing when in issue someone change the value, after saving, it shows the url associated with the selected value. I think to do it in the following way:

  1. List custom field is "Operators" (cfs[57]) with records: Value1, Value2 and so on.
  2. In some hidden for all users computed custom field I get the new value of the "Operators" custom field. As far as I understand, if I place this hidden field in the list of custom fields after cfs[57], then I can read new value directly from cfs[57].
  3. Depending on the readed value I should replace default value of the custom field "Operator" property "Link values to URL" for some value associated with the Value1/2 etc. How to replace the value?

Thank you.

Hi. Sorry for the long answer.
cfs[46].id returns a number, not an object with id field.
Is your question still actual?

Hi,

yes, still actual. I don't understand is it possible to get "Link values to URL" of a custom field?

Do you mean something like this? "http://example.com/path/#{cfs[57]}"

Hi. Do you need any help?