# Custom notification not sent when data contains double quotes

**URL:** <https://forum.ansible.com/t/custom-notification-not-sent-when-data-contains-double-quotes/3322>\
**Category:** Get Help\
**Tags:** awx\
**Created:** [January 15, 2024, 3:09pm UTC](https://forum.ansible.com/t/custom-notification-not-sent-when-data-contains-double-quotes/3322 "2024-01-15T15:09:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abd](https://avatars.discourse-cdn.com/v4/letter/a/c6cbf5/32.png) [@Abd](https://forum.ansible.com/u/Abd)\
**Post date:** [January 15, 2024, 3:09pm UTC](https://forum.ansible.com/t/custom-notification-not-sent-when-data-contains-double-quotes/3322/1 "2024-01-15T15:09:24Z")

</div>

Notification is not sent when custom data in the notification template contains a string that contains double or single quotes. I am using a webhook, that posts some data. I am also using `job.artifacts` to pass some data to the notification template. I have listed the two problamatic cases below.

Has anyone encountered this or is fmailiar with what is the cause for this behaviour.

Any help is highly appreciated 😃

### AWX version

23.5.1

### Ansible version

2.11.12

### Operating system

CentOS

### Steps to reproduce

A playbook that contains the following:

```YAML
- hosts: all
  gather_facts: true

  tasks:    
    - name: "[playbook_simple_test] Test Task."
      ansible.builtin.set_stats:
        aggregate: false
        per_host: false
        data:
          "{{ data_obj }}"

      register: some_test  

```

The notification template contains the following:

- Created:

```YAML
{{ job_metadata }}

```

- Success message body:

```YAML
{
  "job.id": "{{ job.id }}",
  "job.status": "{{ job.status }}",
  "job.artifacts": "{{ job.artifacts }}"
}

```

- Error message body:

```YAML
{
  "job.id": "{{ job.id }}",
  "job.status": "{{ job.status }}",
  "job.artifacts": "{{ job.artifacts }}"
}

```

There are the following three cases in a job template:

1. w/o double quotes ("):  
Extra-vars:

```json
{
  "data_obj": {
    "some_str": "This contains no double quotes."
  }
}

```

1. contains double quotes ("):  
Extra-vars:

```json
{
  "data_obj": {
    "some_str": "This contains double quotes \" in the middle of text."
  }
}

```

1. contains a stringified json

```json
{
  "data_obj": {
    "some_str": "{\"key1\": \"value1\", \"key2\": \"value2\"}"
  }
}

```

### Expected results

metadata  
{“job.id”: “xxxxx”, “job.status”: “successful”, “job.artifacts”: {“some\_str”: “string content”}}

### Actual results

1. w/o double quotes in string:  
metadata  
{“job.id”: “xxxxx”, “job.status”: “successful”, “job.artifacts”: {“some\_str”: “This contains double quotes " in the middle of text.”}}

2. contains double quotes ("):  
metadata  
**No Notification**

3. contains stringified json:  
metadata  
**No Notification**

---

<div class="post-metadata">

**Author:** ![djyasin](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/djyasin/32/114_2.png) [@djyasin](https://forum.ansible.com/u/djyasin)\
**Post date:** [January 17, 2024, 7:59pm UTC](https://forum.ansible.com/t/custom-notification-not-sent-when-data-contains-double-quotes/3322/2 "2024-01-17T19:59:12Z")

</div>

Hello @Abd we did see your GitHub Issue and this does seem to be a bug. We are continuing to triage this on your issue. Thank you for bringing this to our attention!

[https://github.com/ansible/awx/issues/14758](https://github.com/ansible/awx/issues/14758)
