HI All,
How will get all project keys. Because while we create new project by API i need to give different key. So before that i need to check all existing Key and create new Key. How will achieve this?
Since you have a collection on project keys for each project you have to do a loop over all projects. Here is a code example how to get all project keys:
import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.project.Project import com.atlassian.jira.project.ProjectManager ProjectManager projectManager = ComponentAccessor.getProjectManager(); List<String> prjKeys = new ArrayList<>(); for(Project project: projectManager.getProjectObjects()){ prjKeys.addAll(projectManager.getAllProjectKeys(project.getId())) } return prjKeys.toString()
can you please share your code.. I'm also working on something related to this
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.