JQL search for current user = asset object attribute
Asked by Peter Str?mberg:

Hi,

We have most our Jira issues connected to delivery projects, being asset objects. The name of the object is "**Project** ", and they sit in an object schema named named "**IAMP - Projects and installed base**".

The project object has several attributes, like "**Project Manager**".

Now I want to have a JQL that gives me, ALL jira issues connected to the Project objects where the project manager = current user.

That is, assume I am project manager for 10 delivery projects, and they are connected to 1000 Jira issues (various jira projects). These delivery projects are normally connected with asset custom field named "Project number".

Now I want the JQL to query all those 1000 issues, for the projects which I am managing.   
How to write this? I tried with issues in assetAttributeValue. Did not work.

Any help would be highly appreciated. Thanks.

Best regards

Peter

issue in assetAttributeValue("Project", "Project manager", currentUser())


Answers:
author: Peter Str?mberg
body: Thanks Lisa,

Perhaps getting closer, but still generating error.

I enclose some pictures showing the object, attribute, and search result.

![1.png](https://community.atlassian.com/t5/image/serverpage/image-id/341437i561130BC636BD069/image-size/large?v=v2&px=999 "1.png")![2.png](https://community.atlassian.com/t5/image/serverpage/image-id/341439i44DA8C21235B94DD/image-size/large?v=v2&px=999 "2.png")![3.png](https://community.atlassian.com/t5/image/serverpage/image-id/341438i86A56DFE60342FA9/image-size/large?v=v2&px=999 "3.png")

comments: author: Lisa Forstberg
body: Oh I think I made a couple of mistake here.

1) attributeValue is deprecated, we should use **aqlFunction instead**

2) If we run

    Project in attributeValue("Project Manager","=","currentUser()")

then Jira will look for the the ++Jira Project,++ not the field called project.

You have a asset custom field called "project" right? that is applied to each issue connecting them to the project object. If you find the custom field id for that field you should replace it with 12345 in this example:

**`cf[12345] in aqlfunction('"Project Manager"= currentUser()')`**


author: Lisa Forstberg
body: By the way - I am consulting this documentation: <https://confluence.atlassian.com/servicemanagementserver/assets-jql-functions-1087513360.html>


author: Lisa Forstberg
body: I have ran this JQL on my Cloud and it works

"Customfieldname" in aqlFunction('"SME" = currentUser()')


author: Peter Str?mberg
body: Thanks a lot Lisa!

It finally worked!! :)

I used this search string: **cf\[10783\] in aqlFunction('"Project Manager" = currentUser()')**

See screenshot.

This opens for a lot of new possibilities in building Structures, dashboards and searching issues. Issue resolved.


author: Peter Str?mberg
body: ![2024-08-13_10-58-20.png](https://community.atlassian.com/t5/image/serverpage/image-id/341469i19D4C3F68ED310E5/image-size/large?v=v2&px=999 "2024-08-13_10-58-20.png")


author: Lisa Forstberg
body: J?ttebra att det funkar i DC ocks?.


author: Lisa Forstberg
body: Hej [@Peter Str?mberg](/t5/user/viewprofilepage/user-id/4618436) ,

Is the attribute called "project manager" a jira user type attribute?

My server skills are a bit dusty right now but what does this give you

    Project in attributeValue("Project Manager","=","currentUser()")

more [documentation here](https://confluence.atlassian.com/servicemanagementserver/assets-jql-functions-1087513360.html)

Best regards

Lisa

comments: author: Lisa Forstberg
body: Ignore this peeps! Check the thread above instead :-P


Tags: asset-object

currentuser

data-center

jira-data-center

jql