Forums

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

Conditions user in group scriptrunner

Alex
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 Champions.
September 28, 2023

Hi, community!


Please tell me how can I make the script work? Condition: if the current user is a member of one of the groups, then true, otherwise false. I'm new to groove and my skipp doesn't work yet

 

import com.atlassian.jira.component.ComponentAccessor

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

def groupCurrUser = ComponentAccessor.getGroupManager().getGroupsForUser(currentUser)

def group = ["adm","test-group"]

if(currentUser in group.any{groupName->

def getGroupName = ComponentAccessor.getGroupManager().getGroupsForUser(currentUser)}){

true

}

else {

false

}

7 answers

1 accepted

0 votes
Answer accepted
Sebastian Menge
Contributor
February 24, 2013

This does not seem to be possible currently.

JIRA can show the "mentioned in" links, but is not able to search.

The mentioned plugin do not offer that functionality too.

2 votes
sun pitt
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!
June 27, 2018

Is Jira able to create JQL for the above problem?

0 votes
Raisa MacLeod
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!
March 16, 2016

I think this will be useful as well. I want to just create a table of JIRA issues linked to a confluence page.

0 votes
Deleted user
July 6, 2015

I am still looking for a solution for this very issue! Anything to suggest, crew?

0 votes
Edwin Stol
May 28, 2013

Is what David states true? i've been looking for information in JIRA's database about the Confluence pages, but i cannot find anything. And if what David states is true, the plugins mentioned by Tiago won't do any good either.Sebastian; how did you 'resolve' this?

alexcampeandiv
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!
February 12, 2014

The links are stored in a JIRA database table called "remotelink".

0 votes
Tiago Comasseto
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 Champions.
February 19, 2013

Hi,

I don't think it's possible with JIRA out of the box, but you may be able to do this search with one of the following plugins:

https://marketplace.atlassian.com/plugins/com.j-tricks.jql-plugin

https://marketplace.atlassian.com/plugins/org.craftforge.jira.craftforge-jql-functions-plugin

I hope this helps

Cheers

0 votes
David at David Simpson Apps
Atlassian Partner
February 19, 2013

My guess is that JIRA doesn't "know" what's being linked to from Confluence as all that data is stored within Confluence pages.

You can search for usage of the JIRA issue macros in Confluence using this though:
http://ffeathers.wordpress.com/2012/09/04/how-to-search-for-macros-and-macro-parameters-in-confluence-4/

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events