I'm trying to limit what a workflow will do based on how projects are configured. We have two different Field Scheme Configurations (one contains certain requirements while the other doesn't). I'd like to check which field config an issue's project is using and then validate the workflow based on that.
Given an issue, I know I can access the issue's project with issue.projectObject?.name or issue.projectObject?.key
How can I pull additional project information out of that? For instance the field configuration scheme ID or name. I tried searching the API docs, but wasn't sure where to look.
Thanks!
Community moderators have prevented the ability to post new answers.
Figured it out! If anyone else is looking for something similar, here is my code:
import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.issue.Issue import com.atlassian.jira.issue.fields.layout.field.FieldLayoutManager import com.atlassian.jira.issue.fields.layout.field.FieldConfigurationScheme // This is used in a validator script. FieldLayoutManager fieldLayoutManager = ComponentAccessor.getComponent(FieldLayoutManager) FieldConfigurationScheme scheme = fieldLayoutManager.getFieldConfigurationScheme(issue.projectObject) log.debug("FieldConfig: " + scheme.getName() + " and id: " + scheme.getId())
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.