Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to search a string in comments.

I have implemented automatic commenting on tickets after they are open more than 1 hour.

  • I need to check if the comments are not already existing to make sure there are no duplicates.
  • I need to check a string value in comments of the ticket so that duplicate comments can be avoided.

2 answers

1 vote

Instead of checking the text of the last comment, I'd address it differently:

  1. Use a datetime type custom field called "Last time auto-commented" or something
  2. Then update it when you add that auto comment
  3. And verify if the last comment's creation timestamp equals to the value of this custom field, it means that the last comment is an auto-comment (and there is no need another one)

@Aron Gombas _Midori_ 

Thanks for the reply, but i have three auto comments to be checked so ,


my thought was to check a specific string in the comments.

@sai siva

the approach of @Aron Gombas _Midori_ is the best from my point of view.

If you have 3 different autocomments you can create some check that will be actived after the comment added (in the automation that create the comment).

Normally, it's a good practice when you add a comment update a "notified Date Field" in order to avoid to do the same comment again in the future. (Obviously checking this "nofitied Date Field" before adding a new one.


If you have 3 different comment, check it 3 times I think so.


Best regards!

0 votes

Hi @sai siva !

The first thing that comes to mind is the following:

... and comment ~ "your text here"

@Grigory Salnikov 

Thanks for the quick reply.

comment ~ "open for 1 hour"
  • comment no 1 = this incident is sorted and to be forwarded.

  • comment no 2 = this incident is open for 1 hour please respont.


so if i use comment ~ "open for 1 hour " this checks for all the comments in the ticket ?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira

Do you use Jira Cloud with Microsoft Teams?

Hi, Jira users! Do you use Jira alongside Microsoft Teams? We want to hear how you’ve used the power of Jira Cloud and Microsoft Teams (via the Jira Cloud for Microsoft Teams app) to achieve a team...

469 views 3 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you