Hello everyone,
I’ve been really enjoying n8n and have undertaken integrating some of my applications.
However, I have recently struggled with creating tickets from a monitoring system alarm with the HTTP Request node.
The service desk application expects the following format for creating tickets:
{
"title": "Help me!",
"group": "Users",
"customer": "email_of_existing_c[email protected]",
"article": {
"subject": "some subject",
"body": "some message",
"type": "note",
"internal": false
},
"note": "some note",
...
}
What I’m trying to do is use the alarm message as an article body. Here’s an example of the alarm message
"message": "Ping latency Overview ----------------------------- --Error: All pings to the given host have failed! Failed pings: 15:58:52:TimedOut 15:58:47:TimedOut 15:58:42:TimedOut 15:58:37:TimedOut 15:58:32:TimedOut 15:58:27:TimedOut Tracing route -------------------------------- -Info: Hop Nr 0: 172.23.42.4 [HV]: 0%. Latency: 0ms (Threshold: 200ms) "
I’ve used the “JSON/RAW Parameters” option in the HTTP Request node because of the “article” array and constructed my body accordingly. This works when entering some sample value. However, when I try using the value of “message” for the article body n8n doesn’t accept it as valid JSON and throws an error.
Is there some way I can prepare the message to be used by the HTTP Request node?
Best Regards