How to search a string in comments.

sai siva November 12, 2021

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
Aron Gombas _Midori_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 12, 2021

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)
sai siva November 12, 2021

@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.

Juan José Marchal Gómez
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.
November 12, 2021

@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
Grigory Salnikov
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.
November 12, 2021

Hi @sai siva !

The first thing that comes to mind is the following:

... and comment ~ "your text here"
sai siva November 12, 2021

@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
TAGS
AUG Leaders

Atlassian Community Events