If currentUser is member of group X, show issues with label Y (or something similar)

Simon Wagemyr October 1, 2018

Hi,

I'm trying to figure out a way to do the following:

If currentUser is member of group X, show issues with label Y

I'm pretty certain my above search is not possible the way I wrote it, but can I get the sought-after result in another way? Been scratching my head for a while, can't seem to find a good solution for this.

Doesn't have to be with labels specifically, but I think you get the idea.

I guess what I'm after is a form of "Assign to group" and have one system dashboard that works no matter which "group" you are in.

1 answer

0 votes
Petter Gonçalves
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 1, 2018

Hello Simon,

Can you please let us know where are you trying to run the query you informed? Is it in an automation plugin or in the own JIRA JQL filter? Should the users from other group be restricted from seeming issues with the label Y or this is only to build a customized filter with an easy display for each team?

If you are configuring it on a JQL query, I think you got the wrong idea of the JQL functionality. There's no way to make conditional queries using JQL, this is only a search language and not works for programming.

If you are trying to display different issues depending on a specific users group, I would recommend you to create one filter per group and then share it only with the users you need. 

Taking your own scenario as an example, I would create a JQL filter like labels = y and share the filter only with the group X.

In fact, you can use labels or even custom fields to identify the group that should be working on the issue.

Simon Wagemyr October 1, 2018

It's Jira JQL filter I'm talking about, being well aware that I'm wanting the dog to purr. The vagueness of this is due to me not really being able to work out a proper work around with the tools in front of me.

I want to create a system dashboard that works for all members, with some sort of group classification, where you only see the issues that are relevant to your team.

Let's say we have Mary in team A and Ken in team B. We have label A and B to correspond to the teams.

When Mary logs in, she sees the system dashboard. On the dashboard, there is a filter result that displays all open ticket with label "A". The filter doesn't show issues with other labels (or more specifically, issues without label "A").

When Ken logs in, it's the same thing, but for label "B". He doesn't see anything with e.g. label "A".

 

I can't rely on users using different dashboards or create their own, just getting them to understand how to navigate Jira in the first place can be a challenge, and I have to create the environment to need as little administration as possible in the long run (i.e., when I'm no longer part of this board).

I don't know if there is some ingenious way of getting the result I want with another approach, but I do know I can't do this the exact way I'm envisioning it. 

Like Simone Thomas likes this
Petter Gonçalves
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 1, 2018

Hello Simon,

Thank you for your detailed answer.

I believe that the only way that you can do this kind of configuration would be by adding a user picker (Multiple Users) custom field that must be filled in the creation of the issue, so you will be able to filter your gadget with the following JQL:

"user picker custom field" = currentUser()

Performing the steps above, your gadget will only display the issues where the current user is one of the users added to the Custom field.

Also, the user picker (Multiple Users) custom field can be filled with an entire group, so you will not need to flag every single user everytime you create a new ticket:

Screen Shot 2018-10-01 at 16.46.15.png

Please, let me know if this option would work for you, Simon.

Like Marcela likes this
Simon Wagemyr October 1, 2018

Thank you for the input. I will look at it more closely later this week and return once I've tinkered with it.

I greatly appreciate the effort to help me find a good solution.

Petter Gonçalves
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 1, 2018

We're glad to help you, Simon.

Please, let us know if the option provided has worked for you once you have tested it.

Fabian Laqua September 7, 2021

Dear @Petter Gonçalves ,

has anything changed in this procedure in the last years or do I still need a user field for currentUser()?

I have the same problem and would like to display tickets in a JQL query only if the current user is in a certain group.

Like Simone Thomas likes this
Fabian Laqua November 29, 2023

FYI: We use the plugin Scriptrunner von Adaptavist and i wrote an additional JQL function:

It searches all AD groups of the current user for the AD group that is passed as the value by the parameter and returns all issues that fulfil this condition. This issueFunction can be linked with other JQL statements.

I`m not a professional delevoper but it helps us a lot and works as suggested :-D

So if this is still needed, I can gladly provide the code.

@Simon Wagemyr 

Suggest an answer

Log in or Sign up to answer