Listen for measurement create alarm on threshold reached

Product/components used and version/fix level:

Detailed explanation of the problem:

I have a use case where i am Listening for Manage Object and based on Received Json extract deviceId,fragement,alarmText ,Thresholds From
this and Then Listen for Measurement based on deviceId and get the Latest Received Value .
Use that Received value to check whether Value is above Thresholds or Below .If above then create alarm .
I am facing issues as Previous alarm also creating even if i update the alarm Text from Manage Object

Received ManageObject Json:

“alarm_text”: “Range_50_25500 Greater than 0.53 na and active less then 0.30”,
“alarm_type”: “Flow”,
“alarm_severity”: {
“name”: “Major”
“threshold_value”: “0.30”,

Send for Listen for Measurement

result = thresoldValue > Recieved Measurement Value
if(result) {

					contextService.runWithinContext(microserviceCredentials, () -> {
						try {

							AlarmRepresentation alarm = new AlarmRepresentation();
							var source = new ManagedObjectRepresentation();
							alarm.setProperty("rule_id", rule_id);
					My  Problem  is when i am  updating  alarm Text Old  alarm Text  also appeared in  cumulocity alarm ,even  if  i  updated  the Alarm Text

Hi Vikash,

welcome! Alarm behavior can be confusing. From the code you shared it looks like you create a new alarm while an alarm already exists. This is a POST operation:

If an alarm of the same source and type already exists, only the “count” and “time” fields are updated in this case. If you want to change the text (or e.g. severity) of an alarm you have to fetch the existing alarm first and do an update on it using a PUT operation:

Best regards,

looks after handled separate create and update for alarms solve my issues