Hi all,
I'm not sure if it's posted yet in the past, but i'm trying te create a ticket through the API with HTML layout.
To explain a bit more:
We use Zabbix to monitor our servers. I created a action script where it is possible to choose to create a ITFlow Ticket when a Problem was raised in Zabbix. However, the created ticket_details in the ticket are all on one line. I'm trying to create a multiline ticket.
This are the parameters and the (JavaScript) I'm using in Zabbix:

try {
// 1) Inlezen van parameters
var params = JSON.parse(value);
// 2) Zabbix severity mappen naar ITFlow-priority
var zabbixSeverity = params.ticket_priority;
var itflowPriority;
if (zabbixSeverity === 'High' || zabbixSeverity === 'Disaster') {
itflowPriority = 'High';
}
else if (zabbixSeverity === 'Average') {
itflowPriority = 'Medium';
}
else {
itflowPriority = 'Low';
}
// 3) Emoji-mapping voor status & severity (zelfde als in ntfy-script)
var statusEmoji = {
PROBLEM: 'đ¨',
RESOLVED: 'â
',
INFO: 'âšī¸'
}[params.status] || 'đ';
var severityEmoji = {
'Not classified': 'âĒ',
'Information': 'đĩ',
'Warning': 'đĄ',
'Average': 'đ ',
'High': 'đ´',
'Disaster': 'đĨ'
}[params.severity] || '';
// 4) Opbouw en opmaak ticket_subject (plaatje: status + trigger)
var ticket_subject = statusEmoji + ' '
+ params.status
+ ': '
+ params.trigger;
// 5) Opbouw en opmaak ticket_details als HTML (zonder newline-karakters)
var ticket_details = [
'<p><strong>' + statusEmoji + ' Status : ' + params.status + ' - ' + severityEmoji + ' Severity : ' + params.severity + '</strong></p>',
'<ul>',
'<li>Host: ' + params.host + '</li>',
'<li>Trigger: ' + params.trigger + '</li>',
'<li>Item: ' + params.item + '</li>',
'<li>Time: ' + params.datetime + '</li>',
'<li>Link: <a href="' + params.trigger_link + '" target="_blank" rel="noopener">Open in Zabbix</a></li>',
'<li>Beschrijving: ' + params.description + '</li>',
'</ul>'
].join('');
// 6) Payload samenstellen conform ITFlow API
var payload = {
api_key: params.api_key,
ticket_subject: ticket_subject,
ticket_details: ticket_details,
ticket_priority: itflowPriority,
ticket_assigned_to: params.ticket_assigned_to,
ticket_contact_id: params.ticket_contact_id,
client_id: params.client_id
};
// 7) HTTP POST via HttpRequest
var req = new HttpRequest();
req.addHeader('Content-Type: application/json');
var response = req.post(params.URL, JSON.stringify(payload));
// 8) Statuscode controleren
if (req.getStatus() !== 200) {
throw 'Ticket creatie mislukt, status ' + req.getStatus() + ': ' + response;
}
// 9) Optioneel: ticket_id teruggeven als event-tag
var result = {
tags: {
itflow_id: JSON.parse(response).ticket_id
}
};
return JSON.stringify(result);
}
catch (error) {
// Foutmelding in Zabbix-log en afbreken met exception
Zabbix.log(3, '[ itflow webhook ] Ticket creatie failed: ' + error);
throw 'Ticket creatie mislukt: ' + error;
}
It's about the part that starts with // 5)
Is it possible what i'm trying to do?
Thanks in advance.