Forums

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

JQL custom function passing currentUser() to scope precomputations

Luc Allaire
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 29, 2024

We are looking to make a custom JQL function we could use to see a dashboard as an other user. This would allow us to check if permissions were properly given. 

The function would replace currentUser() in our filters and we could change the user being impersonated with a dashboard widget. 

 

From my understanding, due to precomputation if I want each user to have a different selected value I must pass the current user as an argument to the function. I am unable to do so or find any alternative way to allow each user to select a different user.

Thank you!

1 answer

0 votes
Bo Zhao
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.
May 29, 2024

Hi @Luc Allaire 

I sometimes get into the same problem and I don't seem to find a better solution. Things will get more complicated if you have user-based permission instead of role-based.

As site admin, you can use the Admin Helper to check a user's permission against a certain Jira ticket, you may have to do this multiple times if you have more than one project. Or login as the user to view their dashboard.

Luc Allaire
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 30, 2024

Hi Bo Zhao
, I would be programming a plugin for this purpose. What I mean to ask is if it is possible to avoid global precomputations in a forge custom jql function and have either precomputations in a user scope or just make sure they each have a different result (for exemple by passing current user to the function).

Thank you

Suggest an answer

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

Atlassian Community Events