How to use the conditional post function in a workflow

Hi,

I am trying to set up a conditional transition in my workflow and need to use the groovy functionality (see screenshot). What I am trying to write is "When a case is Created, if the reporter is memberof("developers"), transition the case to status X rather than keep it in Open", I will take any of the following as solutions (I've searched high and low with no results so far):

1. Link to documentation on what I can do with the issue object in groovy. I found the rest API but this is different. I am trying to write something like return issue.get("reporter").memberOf("developers");
2. Someone to tell me how to see the log or error log or something... It says I can use logger and I've tried to log.info("test") but I don't have access to the actual log since I am in an On Demand instance... is there any other way for me to see the logs? I tried to see if I can do it with the API, but no the documentation doesn't mention it.
3. Or, as a last resort, if someone simply knows how to do this, I'll take that as well smile

2015-08-25_1544.png

Thanks!!

1 answer

1 accepted

For future generations, I figured it out. Enjoy!

 

import com.atlassian.jira.component.ComponentAccessor;
return ComponentAccessor.getGroupManager().isUserInGroup(issue.get("reporter"), "developers");

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Jira

5 ways you can make the most of Jira Software and Bitbucket Cloud

As part of the Bitbucket product team I'm always interested in better understanding what kind of impact the use of our tools have on the way you work. In a recent study we conducted of software devel...

76 views 0 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you