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

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 Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,789 views 11 18
Join discussion

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot