Hi,
I am developing a Jira plugin using Java API, I need to gather a list of columns according to a project. I don't know how to use ColumnLayoutManager and I am not sure if this interface can help me.
To be more explicit I would like to write a function something like that:
List<Column> getAllColumnsFromProject(ApplicationUser user, Long projectId){
//returns list of columns
}
Adapt your code to java syntax.
Here is a groovy script to list the custom fields of project 'TEC', issue type 'Story'.
The class you need is
com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.config.ConstantsManager
import org.apache.log4j.Level
log.setLevel(Level.DEBUG)
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def projectManager = ComponentAccessor.getProjectManager()
def projectID = projectManager.getProjectByCurrentKey('TEC').id
def customFieldList = customFieldManager.getCustomFieldObjects(projectID,ConstantsManager.ALL_ISSUE_TYPES)
for (f in customFieldList) {
log.debug(f.name)
}
see:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.