ansible / awx

AWX provides a web-based user interface, REST API, and task engine built on top of Ansible. It is one of the upstream projects for Red Hat Ansible Automation Platform.
Other
14.01k stars 3.42k forks source link

"tower_notification_template" module fails when type is webhook and the custom messages is used with "message" and is successful if used with "body" #10447

Open SWADESNA opened 3 years ago

SWADESNA commented 3 years ago
ISSUE TYPE
SUMMARY
      messages:
        started:
          body: |-
            {
              "tower_source"  : "Ansible Tower Dev",
              "id"            : "{{ job.id }}"
            }
ENVIRONMENT

Below sample can be used for testing while creating Customized messages:

      messages:
        started:
          message: |-
            {
              "tower_source"  : "Ansible Tower Dev",
              "id"            : "{{ job.id }}"
            }
EXPECTED RESULTS

It fails with below:

FAILED! => {"changed": false, "msg": "Unable to create notification_template webhook1 notification: {'messages': ['Messages cannot contain newlines (found newline in started event)']}"}
ADDITIONAL INFORMATION

The below attached image for successful creation using "body". body_success

wenottingham commented 3 years ago

Marking as an enhancement for better module docs.

lucab85 commented 3 years ago

+1 for case 02969503

lucab85 commented 3 years ago

Please consider a UI update to set the "body" field. At the moment it's only possible to set the "message" field in the notification template area: Screenshot from 2021-06-23 12-24-37

azrdev commented 1 year ago

Please consider a UI update to set the "body" field. At the moment it's only possible to set the "message" field in the notification template area:

this seems to be implemented in AWX 21.1.0 which allows to set * message bodys