owIssue :: Issue -> OutputMessage
showIssue issue = RichMessage defaultAttachment
    { attachmentFallback = summary issue
    , attachmentColor = color
    , attachmentAuthorName = Just (issueKey issue)
    , attachmentAuthorIcon = priorityIcon issue
    , attachmentTitle = Just (summary issue)
    , attachmentTitleLink = issueUrl issue
    , attachmentText = description issue
    , attachmentFields = catMaybes [ makeField "Status" (issueStatus issue)
                                   , makeField "Assigned to" (assigneeName issue)
                                   ]
    , attachmentThumbUrl = Just "https://a.slack-edge.com/2fac/plugins/jira/assets/service_36.png"
    , attachmentFooter = Just $ T.concat ["Comments: ", T.pack . show $ (fromMaybe 0 $ commentCount issue)]
    }
  where
    color = case (priorityName issue) of
      Just "Blocker"  -> DangerColor
      Just "Critical" -> DangerColor
      Just "Major"    -> WarningColor
      Just "Minor"    -> GoodColor
      Just "Trivial"  -> GoodColor
      _               -> DefaultColor


showIssue :: Issue -> OutputMessage
showIssue issue = RichMessage defaultAttachment
    { attachmentFallback = summary issue
    , attachmentColor = color
    , attachmentAuthorName = Just (issueKey issue)
    , attachmentAuthorIcon = priorityIcon issue
    , attachmentTitle = Just (summary issue)
    , attachmentTitleLink = issueUrl issue
    , attachmentText = description issue
    , attachmentFields = catMaybes [ makeField "Status" (issueStatus issue)
                                   , makeField "Assigned to" (assigneeName issue)
                                   ]
    , attachmentThumbUrl = Just "https://a.slack-edge.com/2fac/plugins/jira/assets/service_36.png"
    , attachmentFooter = Just $ T.concat ["Comments: ", T.pack . show $ (fromMaybe 0 $ commentCount issue)]
    }
  where
    color = case (priorityName issue) of
      Just "Blocker"  -> DangerColor
      Just "Critical" -> DangerColor
      Just "Major"    -> WarningColor
      Just "Minor"    -> GoodColor
      Just "Trivial"  -> GoodColor
      _               -> DefaultColor
showIssue issue = RichMessage defaultAttachment
    { attachmentFallback = summary issue
    , attachmentColor = color
    , attachmentAuthorName = Just (issueKey issue)
    , attachmentAuthorIcon = priorityIcon issue
    , attachmentTitle = Just (summary issue)
    , attachmentTitleLink = issueUrl issue
    , attachmentText = description issue
    , attachmentFields = catMaybes [ makeField "Status" (issueStatus issue)
                                   , makeField "Assigned to" (assigneeName issue)
                                   ]
    , attachmentThumbUrl = Just "https://a.slack-edge.com/2fac/plugins/jira/assets/service_36.png"
    , attachmentFooter = Just $ T.concat ["Comments: ", T.pack . show $ (fromMaybe 0 $ commentCount issue)]
    }
  where
    color = case (priorityName issue) of
      Just "Blocker"  -> DangerColor
      Just "Critical" -> DangerColor
      Just "Major"    -> WarningColor
      Just "Minor"    -> GoodColor
      Just "Trivial"  -> GoodColor
      _               -> DefaultColor