Script Runner - Assignee in a group

Kathleen Jacobs 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 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 January 28, 2015

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

Suggest an answer

Log in or Sign up to answer