jQuery.post('/bi/alert/api:create',{
"data": JSON.stringify({
"dataSetId": 977,
"name": "Create test",
"executeOnDataChange": true,
"owner": {
"id": 1,
"username": "admin",
"email": "jan.bednarik@belladati.com"
},
"filter": "{\"attributes\":{\"op\":\"AND\",\"children\":[{\"op\":\"AND\",\"filters\":[{\"op\":\"IN\",\"attribute\":\"L_NOTFICITATION_TYPEO\",\"values\":[\"Storm\"],\"countOp\":\"EQ\"}]}]}}",
"elements": [
{
"name": "Location",
"description": null,
"type": "drilldown",
"attribute": "L_LOCATIONO"
},
{
"name": "Notficitation type",
"description": null,
"type": "drilldown",
"attribute": "L_NOTFICITATION_TYPEO"
},
{
"name": "message",
"description": null,
"type": "drilldown",
"attribute": "L_MESSAGE"
},
{
"name": "Value",
"description": null,
"type": "dataIndicator",
"indicator": "M_VALUE"
},
{
"name": "Other value",
"description": null,
"type": "dataIndicator",
"indicator": "M_OTHER_VALUE"
},
{
"name": "Value",
"description": null,
"type": "dataIndicator",
"indicator": "M_VALUE"
}
],
"action": {
"type": "system",
"body": "${L_MESSAGE}",
"dateTimeAttribute": null,
"clearNotifications": true
},
"conditions": [
{
"compareOperation": "LTE",
"formula": "500",
"elementName": "Value"
},
{
"compareOperation": "EQ",
"formula": "\"Czech Republic\"",
"elementName": "Location"
}
]
})},function(reply) { console.log(reply); }) |