Forums

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

JQL/AQL Query Filter to Tie a Specific Attribute to the Current User

Josh Jordan
Contributor
January 13, 2023

Hello All!

I am a new Jira admin (I mean brand new), who is taking over a new site that has some uploaded Assets data that includes customers, employees, roles, etc.  We have a custom field for "Project Manager" that is driven by an attribute in the Customers Object Schema under the Customer # Object Type.  I am looking to create a filter that at the most basic level is "Project Manager" = currentUser().  However, after quite a bit of research, I am not finding the right way to reference that attribute... Any help is appreciated!

 

Thank you!

2 answers

1 accepted

1 vote
Answer accepted
Josh Jordan
Contributor
February 15, 2023

For anyone looking for this in the future.  We used the following for the filter JQL:

 

"Project Manager" in iqlFunction('\"JiraUserName\" = currentUser()')

Andrew Boeger
Contributor
June 1, 2023 edited

@Josh Jordan 

I am trying to replicate this. I want an Assets field on a service desk request form where the end user selects their device from the dropdown... but ideally it only shows them options where they're attached to the device. 

"Owner's Jira user Profile" is an attribute on the Asset object. The attribute is a reference to a Jira User object (i.e. a link to the user profile). 

Am I doing something wrong or can this not be done? 

Screenshot 2023-06-01 at 12.45.47 PM.png

Andrew Boeger
Contributor
June 1, 2023

I re-read your statement to see that you're using JQL whereas everything on my screen is AQL. I tried this just as a shot in the dark... and holy jesus it worked :) 

Screenshot 2023-06-01 at 12.56.38 PM.png

Like • Josh Jordan likes this
1 vote
Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 13, 2023 edited

Hi @Josh Jordan,

Welcome to Atlassian Community!

Is the Project Manager field a user picker field or an Assets object field? The currentUser() function only works on Assignee, Reporter, Voter, Watcher, Creator, and custom fields of type User.

Josh Jordan
Contributor
January 16, 2023

Hey Mikael!

 

Thank you for the quick reply!

This is an Assets attribute under our Customer # field that reference's an employee object; it should be a User" custom field called PM.

 

To give a more detailed overview of our Assets design:

We have a "Companies" schema with company names and some other details. It has an inbound reference to the customer number from the "Customers" schema.  Then an "Employee'" schema with employee names, contact info (email), role, and Jira U/N; it also has an inbound reference from the Customer #.   Under the Customer Number object, there are attributes.  In this case, "Assigned Project Manager" is the field I am looking to filter by.  So basically, I want something like Assigned Project Manager = currentUser().  I am hoping to make this happen so I can make a dynamic filter that can be used in dashboards. 

 

Thanks!

Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 15, 2023

Okay, unfortunately currentUser() is not supported in AQL, at least not yet. The only thing I can suggest is that you submit a suggestion to have that added. Go to jira.atlassian.com to log it. 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events