Closed cbmarchetti closed 2 years ago
Hi,
Use this code in BEFORE SAVE section:
if (custom_field_value(1) != custom_value_for(1).try(&:value)) && tracker_id == 4
self.save_custom_field_values
self.tag_list.add(CustomFieldEnumeration.where(:id=> custom_field_value(1).to_s,:custom_field_id => '1').first.to_s)
end
I hope it helps!
Hi, thanks for your help, but it's not working yet tags.zip
Hi,
This code was tested and works properly. Do you use any special plugin for tags?
redmineup_tags 2.0.11 https://www.redmineup.com/pages/plugins/tags/
Hi,
Try it with @issue instead of self:
if (custom_field_value(1) != custom_value_for(1).try(&:value)) && tracker_id == 4
@issue.save_custom_field_values
@issue.tag_list.add(CustomFieldEnumeration.where(:id=> custom_field_value(1).to_s,:custom_field_id => '1').first.to_s)
end
Thank you very much! @AirTibu
@cf_key_value = CustomFieldEnumeration.where(:id=> custom_field_value(1).to_s,:custom_field_id => '1').first.to_s
if @issue.tracker_id == 4 if custom_field_value(1) != custom_value_for(1).try(&:value) self.tag_list.add(@cf_key_value) self.save end end