JQL issueFunction for comments by user in custom field

SaidAslan June 20, 2016

Hi all!

I need to filter the issues where last comment author is user in custom field (i.e. tempCF).

the issueFunction in commented("by user") is working with the user ID. 

How can I use a custom field here? 

2 answers

0 votes
JamieA
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.
June 21, 2016

I think you made that work for the case where you name a particular user, or for the current user, but you can't do what you actually asked for - which is just to find the issues where they are the same.

If you actually need that you could write a new JQL function, but it would not be able to do it using a "pure" lucene query (so slow).

Or you could do a hidden script field which just marks whether they are the same, and query on that (or write a function which is an alias for querying on that).

SaidAslan June 22, 2016

actually, I dont think that could fast write hidden scripts with such a checking because of being very new in groovy scripting. till this moment it works as I expected (we need to automate email approving process) smile 

0 votes
Corentin Méhat
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.
June 20, 2016

(edited)

issueFunction in lastComment("by currentUser()") and assignee = currentUser()

SaidAslan June 20, 2016

No. The user in CF is not static, for every issue is differ, and I need to create a filter to use it in Automation rules, so CF content must be called for comparison, not particular user

Corentin Méhat
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.
June 20, 2016

Then you can have a look to : https://confluence.atlassian.com/jirasoftwarecloud/advanced-searching-functions-reference-764478342.html

and look for the JQL functions returning a "user" and see if one matches what you need ? without more details I'd go for currentUser() but it is not necessarily what you're looking for smile

SaidAslan June 20, 2016

can I do smth like this? 

issueFunction in lastComment("by currentUser()") AND "tempCF"= currentUser()

but there are no results (but I have issues matching the query)

Corentin Méhat
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.
June 20, 2016

I just tried that with the assignee (system) field and it worked correctly :

issueFunction in lastComment("by currentUser()") and assignee = currentUser()

SaidAslan June 20, 2016

oh sorry it was my mistake smile

it works, thanks!

Suggest an answer

Log in or Sign up to answer