1

I am using Redmine 2.1 and I am writing a custom plugin. I am trying to access the value of a custom field on an issue.

  def controller_issues_edit_before_save(context = {})
    issue = context[:issue]

    add_assignee(issue)
  end

I am getting my issue then I pass it to a custom function.

private
  def add_assignee(issue)
    add_watcher_to_issue(issue, issue.custom_field_values {'bob'})
  end

I don't seem able to get the value of my custom field bob. bob is a user field.

How do I get the value of my custom field?

Rob
  • 85
  • 8

1 Answers1

0

I can't check it myself but the argument passed to issue.custom_field_values {'bob'} confuses me. it looks like you pass a block?!

Looked at this line I think custom_field_values is a hash so pass an expected key:

issue.custom_field_values('bob')
gotva
  • 5,919
  • 2
  • 25
  • 35