Convert alerts from Kapacitor to infux2

Hi, recently I moved from Influxdb v1 to v2. I’m still using Kapacitor for the alerting. I’m trying to port all the Kapcitor rules to the influx2 alerts. With the Kapacitor there is resolution from crit to OK. I don’t see this in the influx2 alerting. Am I missing somthing?

An example of “server is down” that I’m using in the kapacitor:

batch
|query(‘’’ SELECT mean(usage_user) FROM “collectd”.“default”.“cpu” where “host” !~ /(baba)|(dod)/ ‘’')
.period(10m)
.every(10m)
.groupBy(‘host’)
|stats(10m)
|derivative(‘emitted’)
.unit(10m)
.nonNegative()
// |deadman(0.0000001, 10m)

|alert()
    .crit(lambda: "emitted" < 0.0000001)
    .stateChangesOnly()
    .LevelField('level')
    .message('server: {{ index .Tags "host" }} {{ if eq .Level "OK" }}OK{{ else }}error - no data receive{{ end }}')
    .slack()
    .channel(ch4)

Thank you