Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Script Runner - Assignee in a group

Kathleen Jacobs
Contributor
October 24, 2013

They have a condition if the reported is in a specific group:

import com.atlassian.jira.component.ComponentAccessor

def groupManager = ComponentAccessor.getGroupManager()

groupManager.isUserInGroup(issue.reporter?.name, 'business-users')

But how can i change this so it's the assignee?

2 answers

1 accepted

0 votes
Answer accepted
JamieA
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 24, 2013

Use assignee instead of reporter...?

Kathleen Jacobs
Contributor
October 24, 2013

I chaned it to:

def groupManager = ComponentAccessor.getGroupManager()

groupManager.isUserInGroup(issue.assignee?.name, 'External Art')

Getting error:

javax.script.ScriptException: groovy.lang.MissingPropertyException: No such property: ComponentAccessor for class: Script52

JamieA
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 24, 2013

You have to import it:

import com.atlassian.jira.component.ComponentAccessor

0 votes
Kathryn Allison
Contributor
January 28, 2015

Why does this not work when adding && issue.projectObject.key == 'ABCD'

Suggest an answer

Log in or Sign up to answer