Forums

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

Insight IQL/AQL using currentUser() is not working

Richard Jenkins
Contributor
March 2, 2023

I created an Insight field and am trying to filter only the current user's equipment in the field. When I try "User = currentUser()", nothing comes up. currentUser doesn't even autofill or show up as a suggestion. Only when I add something to the object like "System.User = currentUser()". But I still get no results. 

I verified that the attribute USER is on the object under the specific objectType. What is the correct IQL or configuration to pull the user's own equipment? Thank you in advanced.

1 answer

1 accepted

1 vote
Answer accepted
PD Sheehan
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.
March 2, 2023

If you are trying to do this in a custom field IQL configuration for use in an issue creation, try to use "currentReporter()" instead.

Otherwise, here is an example of the search working for me:

2023-03-02 17_16_49-Insight Search - JIRA.png

Richard Jenkins
Contributor
March 3, 2023

Thank you @PD Sheehan . Can you clarify the red text a little more? I do have the computer in the Object of "System" and the user is in another Object under General. But the computer does have an attribute object that points to the User object. So I am using the following:

objecttype = system and "Primary user".Name = currentUser()

 

This is still not seeing my own equipment. What am I doing wrong?

PD Sheehan
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.
March 3, 2023

"Primary User" is that a "User" attribute? Or an "Object Reference" attribute?

The "currentUser()" iql function returns a "jira user entity", so you can only compare that against a "Jira user" attribute.

Richard Jenkins
Contributor
March 3, 2023

Primary User is an attribute on the device with an attribute object of User, which appears to be a reference

image.png

 

and here are the attributes for the "User" Object:

image.png

PD Sheehan
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.
March 3, 2023

I don't see a "User" Attribute there.

This is what a User attribute looks like:

2023-03-03 12_31_51-Insight - JIRA.png

You can't use the currentUser() function against a Default/Text attribute.

Richard Jenkins
Contributor
March 3, 2023

ok.. let me run that down then. Thanks for the direction, @PD Sheehan ! I truly appreciate it!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events