Using automation to truncate comment body to remove email history

Heather Hanchett May 24, 2023

For many customers (using Outlook), we get the entire message history when they reply to our custom emails coming from JSM. Those custom emails have all of the current ticket comments included. This is causing the JSM UI ticket comments to be quite long and difficult for our Support people to read through. 

 

I'd like to add an automation for when comments come in on an emailed ticket to remove anything starting with "From: no-reply@automation.atlassian.com" as we don't need the ticket history duplicated in each comment, but I'm not finding anything online about how to truncate a comment using Jira Automation. 

 

Any help would be greatly appreciated! 

1 answer

1 accepted

1 vote
Answer accepted
Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 24, 2023

Hi @Heather Hanchett 

You can use the substringBefore smart value to get the values you want https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#substringBefore-String-separator-

So you could use something like the following:

{{issue.description.substringBefore"From: no-reply@automation.atlassian.com")}}
Heather Hanchett May 25, 2023

Thank you Alex, will see if this works for comments! 

Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 25, 2023

@Heather Hanchett hi!

Did you manage to do it?

Heather Hanchett May 26, 2023

Yes, it worked in testing! 

{{issue.comments.last.body.substringBefore("Test string here")}}

Suggest an answer

Log in or Sign up to answer