How can I limit the amount of times a word can appear in a summary?
Asked by Sam Vanderbilt:

We use labels to create clones of tickets and these labels update various fields on the ticket. The action I want to change is that it adds "Recurring - " to the summary. But the problem is we often have to add labels to our clones so then our Issue Summary becomes "Recurring - Recurring - Project XYZ" when I want it to only ever have a maximum of 1 "Recurring - " in the summary.

What I want is it to be smart enough that it will read the summary and if it sees "Recurring -" add nothing. I have tried coming at this from various angles, but to no success and when I check the audit log, the rule is ALWAYS config change no matter how much time i let go by after updating a rule or even when I do not make any changes to the rule.![Screenshot 2024-01-25 at 11.23.07?AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/302563i039AFAB4A4AAA59A/image-size/large?v=v2&px=999 "Screenshot 2024-01-25 at 11.23.07?AM.png")![Screenshot 2024-01-25 at 11.23.15?AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/302562i0EDCBAD0137C7756/image-size/large?v=v2&px=999 "Screenshot 2024-01-25 at 11.23.15?AM.png")![Screenshot 2024-01-25 at 11.23.33?AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/302561i4101B8008A31D89A/image-size/large?v=v2&px=999 "Screenshot 2024-01-25 at 11.23.33?AM.png")![Screenshot 2024-01-25 at 11.25.56?AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/302560iD58E4DD3275A365D/image-size/large?v=v2&px=999 "Screenshot 2024-01-25 at 11.25.56?AM.png")


Answers:
author: Rudy Holtkamp
body: Hi [@Sam Vanderbilt](/t5/user/viewprofilepage/user-id/5385719) ,

I think you want to have the following automation rule:

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/302689i9575F0382BA021F5/image-size/large?v=v2&px=999 "image.png")

It triggers on all changes of summary (but if you want, you can also only use it when the issue is created).

Then it looks if the summary starts with at least two times 'Recurring -'  
You only want the 'Recurring -' text to show up once', so there might be 10 occurrences, that does not matter.

Next you will remove all the occurrences of 'Recurring -' and place one in front.

comments: author: Sam Vanderbilt
body: Hi [@Rudy Holtkamp](/t5/user/viewprofilepage/user-id/636802), thanks for the response. This does not seem to work however. The issues field condition in your automation only applies it to missions that contain "Recurring - Recurring -" when I actually need it to never get to the point where the summary could have more than one "Recurring -"

The english behind the logic that I think would work is:

IF {{issue.summary}} contains "Recurring -"

Then do NOT add "Recurring -"

*** ** * ** ***

It could also be that im unfamiliar with how to write this exactly in JIRA. I'm only a few months into learning JIRA, so it's not always obvious to me what needs "", (), "()", etc.

Here's screenshots of how I wrote your automation which did not work. For the then statement, I tried both:

Recurring - {{issue.summary.remove("Recurring -")}}

\&

Recurring - {{issue.summary.remove("Recurring - Recurring -")}}

*** ** * ** ***

![Screenshot 2024-01-26 at 11.17.24?AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/302772iBA819BA388BEBF6D/image-size/large?v=v2&px=999 "Screenshot 2024-01-26 at 11.17.24?AM.png")![Screenshot 2024-01-26 at 11.13.46?AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/302774i04C1F82FF9CA8FBF/image-size/large?v=v2&px=999 "Screenshot 2024-01-26 at 11.13.46?AM.png")![Screenshot 2024-01-26 at 11.13.37?AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/302773i83CAC98107882C5C/image-size/large?v=v2&px=999 "Screenshot 2024-01-26 at 11.13.37?AM.png")![Screenshot 2024-01-26 at 11.13.32?AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/302775i456D49E079794001/image-size/large?v=v2&px=999 "Screenshot 2024-01-26 at 11.13.32?AM.png")


Tags: cloud

jira-service-management

jira-service-management-cloud