Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Sending JSON Payload to DataDog

Dennis Christilaw
Contributor
September 25, 2024

I have an interesting issue here:

I am trying to send a JSON payload to DataDog to start an Incident (using their On-Call feature).

I send the following payload and it works:


 {

"title": "Something Silly Here",
"text": "Maybe some Description Text",
"tags": "team:{{customFields.customfield_15951.asJsonString}}, incident", "source_type_name": "Jira",
"alert_type": "info"

}


However, when I attempt to use additional Smart Values like the below example, I am get an error:


 {

"title": "{{issue.summary.asJsonString}}",
"text": "{{issue.description.asJsonString}}",
"tags": "team:{{customFields.customfield_15951.asJsonString}}, incident",
"source_type_name": "Jira",
"alert_type": "info"
}


Error:


Error publishing web request. Response HTTP status:
400
Error response HTTP body:
{"errors": ["Invalid JSON structure"]}

I just need to know what is not formatted correctly

2 answers

1 accepted

0 votes
Answer accepted
Dennis Christilaw
Contributor
September 25, 2024

Through some trial and error, we were able to get the formatting right for both sides. Tested via https://webhook.site/:

What worked is below:


{
    "title": {{issue.summary.asJsonString}},
    "text": {{issue.description.asJsonString}},
    "tags": "incident, team:{{issue.fields.customfield_15951.value}}, ticket:https://mynovu.atlassian.net/browse/{{issue.key}}",
    "source_type_name": "Jira",
    "alert_type": "info"
}
0 votes
Jim Knepley - ReleaseTEAM
Atlassian Partner
September 25, 2024

asJsonString wraps the string in quotes. When it's expanded, you're sending:

{
"title": ""summary"",
"text": ""description"",
"tags": "team:"customfield", insident",
"source_type_name": "Jira",
"alert_type": "info"
}

...which I don't think is what you want. I would remove the quotes wrapping the title and text values and try again.

Dennis Christilaw
Contributor
September 25, 2024

Thanks! We discovered this as well. We did find a solution!! (posted separately)

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events