Forums

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

Trim the words in the summary before creating the ticket

Lakshmi CH
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.
May 30, 2025

Hi Team,

We have an automated email ticket creation using a script that takes certain keywords from the email body and adds them to the ticket summary. However, the summary's formatting is not displaying correctly. Is there a way to use a JMWE post-function, Nunjucks, to trim the summary before creating the ticket (correct the summary)

I've attached a screenshot for reference; the section marked in red is common across all tickets, but in the total:1, the numbers vary all the time. We would like to trim that part.

subject trim.png

3 answers

0 votes
Michael Wan May 31, 2025

@Lakshmi CH 

Here is a solution using Jira Automation (native in Cloud, or installable in Data Center via Atlassian's official app):

Automation Rule:

  • Trigger: Issue created
  • Condition: Issue summary contains total:
  • Action: Edit issue → Field: Summary
    Set value to:
{{issue.summary.replaceAll("total: \d+", "").trim()}}

 It will remove any total: <number> from the summary. 

 

Original summary: 

*Order 123, Ready to go total: 1

Updated summary:

*Order 123, Ready to go

 

Original summary: 

*Testing Status total: 25

Updated summary:

*Testing Status

 

The same regex pattern should also work with a JMWE post-function using Nunjucks, although I haven't tested it directly as I don’t have JMWE installed at the moment.

Hope that helps!

 

0 votes
Jim Knepley - ReleaseTEAM
Atlassian Partner
May 30, 2025

@Lakshmi CH,

I would need to experiment to know for sure, but that seems like it could be a job for slice:

`{{summary.slice(1, -10)}}`

0 votes
Jim Knepley - ReleaseTEAM
Atlassian Partner
May 30, 2025

Hi @Lakshmi CH 

The screenshot you referenced is missing. Can you re-upload it?

Lakshmi CH
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.
May 30, 2025

Hi @Jim Knepley - ReleaseTEAM , I am sorry, Please find the attached one.

Suggest an answer

Log in or Sign up to answer