Hi all,
I want to restrict a transition so that only users of a certain group can make the transition, based on the value of a custom field.
For example, if the value of my custom field is greater than 200, then i only want users who are a member of the 'WHCM' group to be able to make this transition.
Below is the code I have so far but I am not able to make the transition even when the custom field value is less than 200 or I am a member of the WHCM group.
If anyone could advise where I am going wrong I would be very greatful :-)
import com.atlassian.jira.component.ComponentAccessor
import org.apache.log4j.Category;
import com.atlassian.jira.ComponentManager;
import com.opensymphony.workflow.InvalidInputException;
import com.atlassian.jira.ComponentManager;
import com.atlassian.jira.issue.CustomFieldManager;
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.issue.MutableIssue;
import com.atlassian.jira.issue.comments.CommentManager;
import com.atlassian.jira.issue.fields.CustomField;
import com.atlassian.jira.util.ImportUtils;
import com.opensymphony.util.TextUtils
import com.atlassian.jira.component.ComponentAccessor;
CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager();
CustomField customField_1 = customFieldManager.getCustomFieldObject("13700");
String string_1 = issue.getCustomFieldValue(customField_1);
def groupManager = ComponentAccessor.getGroupManager()
if (issue.getCustomFieldValue("customField_1") > "200") {
return groupManager.isUserInGroup(currentUser, 'WHCM')
}
return true