I have an automation rule that puts a comment in a ticket in a panel when a particular SLA starts, this based on a field value being set to true.
What I want to do is delete that comment if the field value is then set back to false.
I cannot be sure that comment is going to be the last comment in the ticket so just can't use that as the mechanism to delete the comment
The panel in the comment has the same title "CANCELLATION REQUESTED"
I have tried this to return the id
{{#issue.comments}}{{#if(exists(body.match("CANCELLATION REQUESTED")))}}{{id}}{{/}}{{/}}
Is there a way to delete a comment in automation that has that in it?