Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Comment Automation: Removing a specific part of a comment

Erik George
Contributor
August 3, 2022

Hello,

I'm curious if there is a way to use the comment automation to remove a specific string from comments? Currently with our system, the way that email-reply-comments get added, they're all added with a line at the bottom featuring the "From:" email information. 

Is there a way to use the "Edit Comment" automation to remove this? To my knowledge, Edit Comment seems to only be useful for either adding on to existing comment content, or replacing it altogether.

Figured I'd ask the Jira experts - thanks!

1 answer

1 accepted

4 votes
Answer accepted
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.
August 3, 2022

Hi @Erik George -- Welcome to the Atlassian Community!

When using the Edit Comment action, you can reference the current comment, and then use text functions to remove/replace text.  For your use case, you may need a regular expression to do a pattern match to remove the text.  To learn more about this approach, please take a look at the replaceAll() function: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#replaceAll-String-regex--String-replacement-

However note doing this, you are losing a bit of information about the history of the comment.  So consider if there will be any impacts for that loss of information.

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer