Mattermost webhook integration: message is empty in failed build POST

Summary

The mattermost json webhook json payloads are not consistent. A commit notification has a message text. A build failed notification not (only inside the probs attachments part)

Steps to reproduce

Grab the RAW data of a failed build and a commit notification hook to mattermost and compare them.

What is the current bug behavior?

i.e. Errbot unable to parse the message on failed builds.

What is the expected correct behavior?

The field message should be filled.

Relevant logs and/or screenshots

JSON failed build

'{
  "id": "1f55ya4qwfnf8yec3irgpibefo",
  "create_at": 1527086808778,
  "update_at": 1527086808778,
  "edit_at": 0,
  "delete_at": 0,
  "is_pinned": false,
  "user_id": "rzhrj338w7ni9pby4a63qcc3pa",
  "channel_id": "huywbjtqhpbe7rzyih8a8kj67w",
  "root_id": "",
  "parent_id": "",
  "original_id": "",
  "message": "", **<- HERE SHOULD BE THE TEXT**
  "type": "slack_attachment",
  "props": {
    "attachments": [
      {
        "id": 0,
        "fallback": "",
        "color": "danger",
        "pretext": "",
        "author_name": "",
        "author_link": "",
        "author_icon": "",
        "title": "",
        "title_link": "",
        "text": **"build failed example text",**
        "fields": null,
        "image_url": "",
        "thumb_url": "",
        "footer": "",
        "footer_icon": "",
        "ts": null
      }
    ],
    "from_webhook": "true",
    "override_username": "Gitlab",
    "webhook_display_name": "GitLab"
  },
  "hashtags": "",
  "pending_post_id": ""
}'
Assignee Loading
Time tracking Loading