Automation when a Comment is deleted

bertrand.drouhard
Contributor
January 20, 2022

Hi,

I built an automation to feed a "Last comment" custom field that enables me to display on the Kanban board the last comment of an issue.

I have a rule for "Issue commented" that sets "Last comment", and another one for "Issue comment edited" that updated "Last comment". 

My problem is that if I delete a comment, no rules are triggered. There is no trigger "Issue comment deleted". 

Any idea ?

Regards,

Bertrand

3 answers

1 accepted

1 vote
Answer accepted
Pramodh M
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 20, 2022

Hi @bertrand.drouhard 

It's not possible, the possibile automation triggers are

https://support.atlassian.com/jira-software-cloud/docs/automation-triggers

You could implement the webhook system and add an API to feed tha last comment of an issue in kanban board

Let me know if you are interested in this, but straight forward solution is not there

Thanks,

Pramodh

bertrand.drouhard
Contributor
January 20, 2022

Thanks Pramodh, I see what you mean. I twould be possible to use a webhook that is triggered on "comment deleted" (and that event exists for Webhooks): then we make a call to the Jira API to update the issue (only the "last comment" custom field).

 

But why is there no "Comment deleted" trigger in automation? Must be side effects that Atlassian could not solve easily...

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 20, 2022

Hi @bertrand.drouhard 

Yes, and...to what others have noted: there is an open suggestion to add an automation trigger for the update/delete of comments, which you may vote for/watch to see progress.

https://jira.atlassian.com/browse/JIRAAUTOSERVER-127

Kind regards,
Bill

bertrand.drouhard
Contributor
January 21, 2022

Thanks Bill, the suggestion is for Jira Server, not Jira Cloud. For Jira Cloud, there is already a "update comment" trigger, but no "delete comment" trigger.

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 21, 2022

Bertrand, my understanding is the JIRAAUTOSERVER project is for all automation related stuff.  There may also be automation-related tickets in the specific Jira, Software Cloud, and Server projects.

0 votes
jrypkahauer
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 13, 2024

Hey all, I know this question is a little over 2 years old, but just in case anyone goes looking for this answer and needs current info, THERE IS a "Deleted Comment" trigger if you use the Multiple Events trigger and then select "comment deleted" from the list of trigger events provided.

I just finished working on an automation that services new, edited, and deleted comments.

I used the multiple event trigger to fire the automation on comment create, comment edit, and comment delete.

  • TRIGGER: Multiple
    • Comment Add
    • Comment Edit 
    • Comment Delete
  • IF "{{comment.author}}" "Matches Regex" "\w+"
    (matches any "word" character, equivalent to [[a-zA-Z0-9_]])
    • We're dealing with a New/Edited Comment
      send the comment author, date/time, and body to Teams channel
  • ELSE
    • We're dealing with a deleted comment (no author, no comment... it works!)
      send "A comment was deleted from {{issue.key}}" to Teams channel

Hopefully the OP will see this and select the new answer as the valid one. :)

0 votes
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 20, 2022

Hi Bertand,

That's not one of the trigger options. What if you just turned off the permission to delete comments except for the people who need to know when a comment is deleted? 

bertrand.drouhard
Contributor
January 20, 2022

Thank you John, that's a solution, but I like the idea that someone can delete a comment he just addeed by mistake.

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 20, 2022

Understood - but why would need for automation to do something if a mistake happens? 

bertrand.drouhard
Contributor
January 21, 2022

My automation updates the "Last comment" custom fields when a comment is created. But if you delete the last commet, then "Last comment" is not updated, and still contains the comment that was deleted, and it's wrong. Instead of being blank (no comment left) or being filled with the previous comment.

Suggest an answer

Log in or Sign up to answer