How to use the conditional post function in a workflow

Igor Belagorudsky August 26, 2015

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

1 vote
Answer accepted
Igor Belagorudsky August 27, 2015

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