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.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.