if alert.isOpen then "Open" else "Closed" role = host.roles[0] + service = role.fullname.split(/:/)[0] + switch service + when “Backlogtool”,“Backlog” then room = aaa + when "Cacoo" then room = bbb + when "Typetalk" then room = ccc + when “" then room = ddd + else room = eee msg = "[Mackerel] #{state} #{alert.status}: #{alert.monitorName} at #{host.name} (#{host.status}) #{role.fullname} #{alert.url}" robot.messageRoom room, msg