How to use the conditional post function in a workflow


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"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



1 answer

1 accepted

1 vote
Accepted answer

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
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,718 views 17 21
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