Forums

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

Finding the 1st text match in comments, date-wise ?!

Touqeer Anjum
Contributor
July 24, 2023

Hi All,

I'm trying to find a specific comment that has a number in the comment text. I have used the below, and it works fine, but the problem it retrieves all the matching text comments, what I want is to only retrieve the 1st found comment matching the string by date/time, for example.

24 Jul 2023 10:30 AM - Your request number is 1234

24 Jul 2023 11:30 AM - Your request number is 5678

The below command shows both numbers, 1234 and 5678, while what I want is to only get 1234, how can I achieve this, and store it in a variable and use it elsewhere ?!

{{issue.comment.body.text.substringBetween("Your request (",") has been received and is being reviewed by our support staff.")}}

 

1 answer

0 votes
Nic Brough -Adaptavist-
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.
July 24, 2023

This is not actually about your search.  The search finds everything issues that match your question, but have nothing to say about what you do with the list of after it hands that list back to you.

You will need to find or write something that can take the search results and drop all the ones you don't want.  There's no way to do that with Automation and smart values.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events