ERROR project = SP AND currentUser() in membersof(issueFunction in valueOf("Single Group Picker"))

Stefano Rosario Aruta March 25, 2019

ERROR project = SP AND currentUser() in membersof(issueFunction in valueOf("Single Group Picker"))

someone can write this JQL correctly?? please

3 answers

1 accepted

0 votes
Answer accepted
Henning Tietgens
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.
March 26, 2019

Hi Stefano,

The JQL must be based on the data of the issue. So you have to start like

project = SP AND SingleGroupPickerField = "Group of a user"

Getting all groups of the current user is not supported, so you have to know them beforehand.

Best regards,
Henning

Stefano Rosario Aruta March 26, 2019

how can i do? i nett to check if currentuser is in the single group in the field "Single Group Picker"

Stefano Rosario Aruta March 26, 2019

but can i check if currentUser in memberof(Customfield_SingleGroupPicker) ???

Henning Tietgens
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.
March 26, 2019

No, you can not. Maybe I could help regarding your underlying problem... Why do you need to check this?

Stefano Rosario Aruta March 26, 2019

so when current user want to do a transition appers a screen where current user need to chossing a single issue in a project with this condition "currentUser in memberof (Customfield_SingleGroupPicker)" is true.

Henning Tietgens
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.
March 26, 2019

This is not possible out of the box. Maybe there are some plugins like Elements Connect which make this possible but I don't have a concrete idea. Sorry.

Stefano Rosario Aruta March 26, 2019

ok don't worry, thank you

0 votes
dxpcanada December 5, 2019

Has anyone actually figured this out? Seems like a common request that makes sense.

I have many departments and I have created a custom field that is set as the ticket moves to the different department which is assigned to the custom field. The custom field is a group field. 

I want to filter the Queues so I have one called "My Department Unassigned" what should show up are the tickets where current user is a member of custom field (group field).

Example: Agent 1 is part of General Help Desk and Application Support and Agent 2 is part of General Help Desk.

The Queue is Called My Department. Agent 1 should see all tickets with the group field value of General Help Desk or Application Support. Agent 2 should only see the tickets with the group field value of General Help Desk. 

Has anyone accomplished this with or without a plugin? If so any help would be greatly appreciated.

Tobias Ravenstein November 26, 2020

Can be done with Scriptrunner (Cloud) by using a additional Field (User Picker) and fill this field by scripted listener with the members of group in the groupicker field.
Then you have to filter for Groupmembers=currentUser()

Example code:

// get custom fields
def customFields = get("/rest/api/2/field")
.asObject(List)
.body
.findAll { (it as Map).custom } as List<Map>

def input1CfId = customFields.find { it.name == 'Group' }?.id
def output1CfId = customFields.find { it.name == 'Members' }?.id

if (issue == null) {
return
}

def input1 = issue.fields[input1CfId]

if (input1 == null ) {
return
}

def groupMembers = get("/rest/api/3/group/member")
.queryString("groupname", "${input1.name}")
.asObject(Map)
.body
.values

def members = []

groupMembers.each {
members += it
}

def resp = put("/rest/api/2/issue/${issue.key}")
.queryString("overrideScreenSecurity", 'true')
.queryString("notifyUsers", 'false')
.header('Content-Type', 'application/json')
.body([
fields: [
(output1CfId): members
]
])
.asString()

assert resp.status == 204
Like Peter Yiu likes this
David Harkins
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.
July 5, 2021

Does anyone have this available for Data Centre?

Would a calculated field also work? or is it best to only change the members field when the group field is changed?

0 votes
Carmen Rosa Ussi October 17, 2019

It is "assignee in (membersOf(teamName))" (at least in Cloud version). I hope it helps to other people who is looking for it in spite this ticket has been open for a while.

Suggest an answer

Log in or Sign up to answer