Forums

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

JQL search for current user = asset object attribute

Peter Strömberg August 12, 2024

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())

2 answers

1 accepted

0 votes
Answer accepted
Peter Strömberg August 12, 2024

Thanks Lisa, 

Perhaps getting closer, but still generating error. 

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

1.png2.png3.png

Lisa Forstberg
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.
August 13, 2024

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()')

Lisa Forstberg
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.
August 13, 2024
Lisa Forstberg
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.
August 13, 2024

I have ran this JQL on my Cloud and it works

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

 

Peter Strömberg August 13, 2024

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. 

 

Like Lisa Forstberg likes this
Peter Strömberg August 13, 2024

2024-08-13_10-58-20.png

Like Lisa Forstberg likes this
Lisa Forstberg
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.
August 13, 2024

Jättebra att det funkar i DC också. 

0 votes
Lisa Forstberg
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.
August 12, 2024

Hej @Peter Strömberg ,

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

Best regards

Lisa

Lisa Forstberg
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.
August 13, 2024

Ignore this peeps! Check the thread above instead :-P

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events