I'm trying to send some notifications to Teams with one conditional at the beginning.
If the condition doesn't match, nothing will be sent to the webhook.
##IFchange.urgency=0##
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"themeColor": "0076D7",
"summary": "##change.title##",
"sections": [{
"activityTitle": "##change.title##",
"activitySubtitle": "##change.content##",
"facts": [{
"name": "##lang.change.authors##",
"value": "##IFchange.authors## ##change.authors## ##ENDIFchange.authors## ##ELSEchange.authors##--##ENDELSEchange.authors##"
}, {
"name": "##lang.change.creationdate##",
"value": "##change.creationdate##"
}, {
"name": "##lang.change.status##",
"value": "##change.status##"
}, {
"name": "##lang.change.impact##",
"value": "##change.impact##"
}, {
"name": "##lang.change.content##",
"value": "##change.content##"
}],
"markdown": true
}],
"potentialAction": [{
"@type": "OpenUri",
"name": "Learn More",
"targets": [{
"os": "default",
"uri": "https://glpi.url.com/front/change.form.php?id=##change.id##"
}]
}
]
}
##ENDIFchange.urgency##