Answer the question
In order to leave comments, you need to log in
How to pull out a custom field from a plugin in Redmine?
Good day.
There are Custom Fields in redmine, I created one and want to access it from a plugin.
The first thing that comes to mind is this:
if issue.respond_to?(:custom_field_values)
issue.custom_field_values.each do |cfv|
if cfv.respond_to?(:custom_field)
c_field = cfv.custom_field
if c_field.respond_to?(:name) and (c_field.name == "Название настраиваемого поля") and cfv.respond_to?(:value)
id = cfv.value.to_i > 0 ? cfv.value.to_i : nil
if id.present?
return User.where(id: id).take
end
end
end
end
end
Answer the question
In order to leave comments, you need to log in
I can't tell you the code, but here it is
tin of course. Why did you decide that custom fields do not have id. Everything is :)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question