Skip to content

Instantly share code, notes, and snippets.

@binaryphile
Last active December 30, 2015 19:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save binaryphile/7873836 to your computer and use it in GitHub Desktop.
Save binaryphile/7873836 to your computer and use it in GitHub Desktop.
def email_issue_attributes(issue)
items = []
%w(author status priority assigned_to category fixed_version).each do |attribute|
unless issue.disabled_core_fields.include?(attribute+"_id")
items << "#{l("field_#{attribute}")}: #{issue.send attribute}"
end
end
issue.custom_field_values.each do |value|
items << "#{value.custom_field.name}: #{show_value(value)}"
end
items
end
def render_email_issue_attributes(issue, html=false)
items = email_issue_attributes(issue)
if html
content_tag('ul', items.map{|s| content_tag('li', s)}.join("\n").html_safe)
else
items.map{|s| "* #{s}"}.join("\n")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment