Hello out there,
I want to automatically set the project category in a groovy script. I found out that Project class has a field for category and there is an interface for retrieving the categories. But I cannot find how to get an instance of that interface.
This is what I found so far:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.entity.ProjectCategoryFactory
import com.atlassian.jira.project.Project
import com.atlassian.jira.project.ProjectCategory
import com.atlassian.jira.project.ProjectCategoryStore
import com.atlassian.jira.project.ProjectManager
Long categoryId = ProjectCategoryFactory.NONE_PROJECT_CATEGORY_ID
ProjectManager projectManager = ComponentAccessor.getProjectManager()
Project project = projectManager.getProjectObjByKey("MYKEY")
ProjectCategoryStore categoryStore = // TODO retrieve Project Category Store Instance
ProjectCategory myCategory = categoryStore.getProjectCategore(categoryId)
project.proctCategory = myCategory