- if context[:issue].tracker_id == Setting.plugin_redmine_publications['tracker'].to_i
- pub_field = context[:params][:publications]
- context[:issue].publication_names = pub_field.split(',').map { |n| n.strip }
+ if context[:issue].tracker.id == Setting.plugin_redmine_publications[:tracker].to_i
+ old_value = context[:issue].publication_names
+ new_value = context[:params][:publications].split(',').map { |n| n.strip }
+ context[:journal].details << JournalDetail.new(
+ :property => 'attr', :prop_key => "publications",
+ :old_value => old_value.join(', '),
+ :value => new_value.join(', ') ) unless new_value==old_value
+ context[:issue].publication_names = new_value