How to find issues for a user that are present in group custom field in JIRA sql

Basudev Behera February 23, 2016
 

15 answers

0 votes
Vasiliy Zverev
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.
February 23, 2016

I can propose two work arouds:

  1. To use this SQL:

    Select
    	customfield.cfname
    	, customfieldvalue.*
    	, cwd_group.*
    	, cwd_user.display_name
    from
    	customfield
    	join customfieldvalue	
    		join cwd_group	
    			join cwd_membership 
    				join cwd_user on	cwd_membership.child_id = cwd_user.ID
    			on cwd_group.ID = cwd_membership.parent_id
    		on customfieldvalue.STRINGVALUE = cwd_group.group_name
    	on	customfield.ID = customfieldvalue.CUSTOMFIELD
    where
    	customfield.cfname = 'группы'		--here is custom field name
    	and cwd_user.user_name = 'vzverev'	--
  2. To create a Script custom field provided Script Runner plugin.

 

0 votes
Udo Brand
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.
February 23, 2016

currentuser() will not work on group picker.

If the user knows in which groups he is (like GroupA and GroupB) use

YourCFGroupPicker in (GroupA, GroupB)

0 votes
Basudev Behera February 23, 2016

ok.. So for group picker field how we will use currentUser() function or tell me how the users of that group which is present in group custom field can see the issues

0 votes
Udo Brand
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.
February 23, 2016

currentuser() will only work for user picker fields like

assignee = currentuser()

I still don't understand what your requirements are! What are you trying to achieve (and step back from your current solution)?

0 votes
Basudev Behera February 23, 2016

We added a group to custom field for some issues and then we are trying to search issues for a particular user, the user is present in the group that added to the custom field but we are unable to find issues with the function currentUser().

0 votes
Udo Brand
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.
February 23, 2016

Can you tell us what your requirements are (without how you are trying to achieve it), maybe we can help. The JQL you want will not work.

0 votes
Basudev Behera February 23, 2016

I am using like currentUser() in memeberOf("group field name") but that is not working.

0 votes
Udo Brand
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.
February 23, 2016

I doubt that you can use something like

assignee in membersOf("<YourGroupCustomField>")

0 votes
Basudev Behera February 23, 2016

Actually we added  groups to a custom-field. so we want to use the customfield not group name. Is that possible?

0 votes
l February 23, 2016

assignee in membersOf("groupname")

0 votes
Udo Brand
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.
February 23, 2016

Do you know the groups the particular user is in, then use

YourCFGroupPicker in (GroupA, GroupB,...)

That would be my only idea.

0 votes
Basudev Behera February 23, 2016

Could you please help it's urgent

0 votes
Udo Brand
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.
February 23, 2016

Hmm, I don't think that this is possible. But maybe someone knows it better.

0 votes
Basudev Behera February 23, 2016

That customfield is group Picker

0 votes
Udo Brand
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.
February 23, 2016

The custom field is of type Group Picker or a Multi User Picker?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events