Forums

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

Support for myTeam() in JQL

Mathew Lederman
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.
October 22, 2025

Now that Atlassian is allowing us to connect AD Groups with Teams, I'm hoping there is some way to search for myTeam() or myTeams() in JQL which would search any for ticket where the Team field is set to a Team to which the current user belongs. I can't find anything from a Google search, but perhaps somebody has a link to documentation (or more likely, a feature request) that I can follow? 

I have been hoping for myGroups for some time, maybe now support for myTeams() will be available?

1 answer

0 votes
Jim Knepley - ReleaseTEAM
Atlassian Partner
October 22, 2025

Hi @Mathew Lederman 

I don't think there's a function to get a list of groups for the currently logged-in user. That would require something like ScriptRunner to create a "custom JQL function." My Groovy isn't that strong, but maybe like this?

 

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.user.ApplicationUser

def authenticationContext = ComponentAccessor.getJiraAuthenticationContext()
ApplicationUser currentUser = authenticationContext.getLoggedInUser()

if (!currentUser) {
return []
}

def groupManager = ComponentAccessor.getGroupManager()
def groupsForUser = groupManager.getGroupsForUser(currentUser)
def teamNames = groupsForUser.collect { it.getName() }

return teamNames

 

Mathew Lederman
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.
October 22, 2025

@Jim Knepley - ReleaseTEAM I've been hoping for a way to add teams, groups, etc to JSM queues because in the real world of service desks everybody assigns tickets to teams, not individuals.

I would love to have 1 queue that says show my service desk team of 250 agents supporting 1200 users, here's everything assigned to any of your groups, teams, whatever that's not resolved. But I need that functionality to work natively in order for it to be supported in queues.

Suggest an answer

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

Atlassian Community Events