Skip to content

Commit

Permalink
Merge branch 'custom_field_format' into evolved
Browse files Browse the repository at this point in the history
  • Loading branch information
cat-in-136 committed Sep 4, 2018
2 parents b30750b + e8b1796 commit 315349f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/redmine_slack/listener.rb
Original file line number Diff line number Diff line change
Expand Up @@ -252,23 +252,27 @@ def channel_for_project(proj)
end

def detail_to_field(detail)
if detail.property == "cf"
key = CustomField.find(detail.prop_key).name rescue nil
case detail.property
when "cf"
custom_field = detail.custom_field
key = custom_field.name
title = key
elsif detail.property == "attachment"
value = (detail.value)? IssuesController.helpers.format_value(detail.value, custom_field) : ""
when "attachment"
key = "attachment"
title = I18n.t :label_attachment
value = escape detail.value.to_s
else
key = detail.prop_key.to_s.sub("_id", "")
if key == "parent"
title = I18n.t "field_#{key}_issue"
else
title = I18n.t "field_#{key}"
end
value = escape detail.value.to_s
end

short = true
value = escape detail.value.to_s

case key
when "title", "subject", "description"
Expand Down

0 comments on commit 315349f

Please sign in to comment.