In my automation I have a REST API callout with this payload spec, interested in issue comments
{
"webhookEvent": "issue_commented",
"timestamp": "{{issue.updated.setTimeZone("UTC")}}",
"eventData": {
"target": "XXX",
"comments": [
{{#issue.comments}}
{ "author": "{{author.displayName}}",
"createdAt": "{{created.setTimeZone("UTC")}}",
"body": "{{body}}"},
{{/}}
]
}
}
Two or 3 things. There is no consistency in time (I need a Tardis) between the issue updated date and time (usually 4, 5 o rsometims6 hours after the comment createdAt date and time).
There doesn't seem to be a way to prevent the final trailing ',' when the list of comments is exhausted.
E.G. I want
{ "webhookEvent": "issue_commented", "timestamp": "2021-02-03T19:27:10.8+0000", "eventData": { "target": "XXX", "comments": [ { "author": "Stuart__", "createdAt": "2021-02-03T14:36:03.7+0000", "body": "Stuart test 1, 2, 3 and 4 and 6 and 7" }, { "author": "Stuart__", "createdAt": "2021-02-03T18:51:34.9+0000", "body": "* B1 * B2 * B3" } ] }}
But get { "webhookEvent": "issue_commented", "timestamp": "2021-02-03T19:27:10.8+0000", "eventData": { "target": "XXX", "comments": [ { "author": "Stuart__", "createdAt": "2021-02-03T14:36:03.7+0000", "body": "Stuart test 1, 2, 3 and 4 and 6 and 7" }, { "author": "Stuart__", "createdAt": "2021-02-03T18:51:34.9+0000", "body": "* B1 * B2 * B3" }, ] }}
Are there any hints on formatting webhook payload as nice JSON?
Thank you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.