My goal is: I want to get all screens, that are in use as "Edit screens".
Since it would be a lot of clicking around, to go through all projects, into the project settings, on the screens section, and check all schemes, and since I want to get a bit practice, I want to write a script to do the job.
So far I can read all projects, I can read the Issue type screen scheme for each project, and the Screen schemes, that are configured for each Issue type within the Issue type screen scheme. But I cannot read the Edit screen, that is configured in a Screen scheme.
Here is the code I have so far:
{code}
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.project.ProjectManager
import com.atlassian.jira.project.Project
import com.atlassian.jira.issue.operation.IssueOperationImpl
List<Project> probs = ComponentAccessor.getProjectManager().projectObjects
probs.each{ prob ->
def itss = ComponentAccessor.getIssueTypeScreenSchemeManager().getIssueTypeScreenScheme(prob)
log.warn("Issue type screen scheme entities for: ${itss.getName()}")
log.warn("Entities:")
itss.getEntities().each{ entity ->
log.warn("${entity.getIssueType()?.getName()} - ${entity.getFieldScreenScheme().getName()}")
}
}
{code}
What I found :
When I have a Screen scheme, and I want to read the Edit screen, there is a method: FieldScreen getFieldScreen(IssueOperation issueOperation )
But I don't know how to provide that parameter "IssueOperation". It's not a string or an enum, it's an Object, I can create such an Object, but it's not giving the expected result.
E.g.:
itss.getEntities()[0].getFieldScreenScheme().getFieldScreen(new IssueOperationImpl("Edit Issue",""))
Is giving me the Create screen.
I'm afraid, this is very specific, but any help is much appreciated.