Forums

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

Find String in comment

MG January 7, 2022

Hi

I wrote a scriptField that display last comment and named: "lastComment";

and now I want return issues that have "xxx" in last comment.

for example :

In advance search ; user wrote : " lastComment ~ "xxx"  " 

I dont know how do I find "xxx" in any search ?(I used lastComment.getBody().find() , but how do I get search expression from user.)

"xxx" is expression that user searched and can different. 

thanks

1 answer

0 votes
Neil Arrowsmith
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.
January 9, 2022

Hi

Assuming you've got the Scriptrunner plugin, how about this?

issueFunction in issueFieldMatch ("project=ABC", "lastComment", "xxx")
MG January 21, 2022

Hi @Neil Arrowsmith 

I used this jql, but not worked!

It can't find a text in last comment field(Script field) 

Neil Arrowsmith
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.
January 22, 2022

Hi MG

Did you update the “project=ABC” part of the query to something that works for the set of issues you want to search?

Neil

MG January 22, 2022

Hi @Neil Arrowsmith 

Yes, I updated sub query, but not worked.

thanks

Neil Arrowsmith
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.
January 24, 2022

Hi MG

Not sure how much I can help.

This is an example from our Jira system with real data:

issueFunction in issueFieldMatch ("project=MED", "Build Targets", "process")

This works fine, bringing back all issues in the MED project that have "process" in the field "Build Targets". This is a Text Field (multi-line) custom field.

Suggest an answer

Log in or Sign up to answer