How to find the list of jira projects associated with the default issue type scheme?

Hi All,

I need to find the list of projects associated with the default issue type scheme. Is there a JQL query for the same?

Thanks and Regards,

Jenin C M

4 answers

1 accepted

0 votes
Accepted answer

JQL searches for issues, not projects.

I assume you're trying to do this in code somewhere, as you can simply look at the admin UI to see which projects are on the default issue type screen?

Why is this the accepted answer?

Probably a hangover from the forum before last.

The following worked for me with JIRA 6.4.4

 

import com.atlassian.jira.ComponentManager
import com.atlassian.jira.issue.fields.config.manager.IssueTypeSchemeManager
import com.atlassian.jira.issue.fields.config.FieldConfigScheme
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.util.SimpleErrorCollection
import java.util.Collections


/**
 * Find all projects that use the Default Issue Type Scheme.
 * No data is changed.
 *
 * Matt Doar
 * ServiceRocket
 */

def componentManager = ComponentManager.getInstance();
def projectManager = componentManager.getProjectManager();
def issueTypeSchemeManager = ComponentAccessor.getIssueTypeSchemeManager()

StringBuffer sb = new StringBuffer();

def projects = projectManager.getProjectObjects();
count = 0
for (project in projects) {
    FieldConfigScheme its = issueTypeSchemeManager.getConfigScheme(project);
    if (its.getName().equals("Default Issue Type Scheme")) {
        sb.append(project.getKey() + "<br/>");
        count += 1;
    }

}

sb.append("Total: " + count);
return sb.toString();

Updated for JIRA 7.2.4 (minimal changes)

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.fields.config.manager.IssueTypeSchemeManager
import com.atlassian.jira.issue.fields.config.FieldConfigScheme
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.util.SimpleErrorCollection
import java.util.Collections
 
 
/**
 * Find all projects that use the Default Issue Type Scheme.
 * No data is changed. Runs in a few seconds.
 *
 * Matt Doar
 * ServiceRocket
 */
 
def projectManager = ComponentAccessor.getProjectManager();
def issueTypeSchemeManager = ComponentAccessor.getIssueTypeSchemeManager()
 
StringBuffer sb = new StringBuffer();
 
def projects = projectManager.getProjectObjects();
count = 0
for (project in projects) {
    FieldConfigScheme its = issueTypeSchemeManager.getConfigScheme(project);
    if (its.getName().equals("Default Issue Type Scheme")) {
        sb.append(project.getKey() + "<br/>");
        count += 1;
    }
 
}
 
sb.append("Total: " + count);
return sb.toString();

Hi Matt,

What is the proper way of running your script?

I appreciated for your outcome!

Hi Nic,

Thanks for the response!

I am on Jira 5.2.11 and unfortunately in UI for 'default issue type schehe' it shows 'Global (all unconfigured projects)'. Rest of the schemes do show the list.

Should we try to find it through database? Could you please provide me the query for the same?

Thanks and Regards,

Jenin C M

Ah, yes, I was thinking about other schemes.

The problem with issue type schemes is that it's a negative. The system uses whatever scheme you choose for a project, but if you don't choose one, t here's nothing stored. When it needs to know the issue type scheme, it looks for a setting, finds nothing, and hence uses the default.

I think your only option is a negative query - get the full list of projects and then remove any that have any scheme set. I don't know the SQL for that, but the last time I did it (5.1), I simply clicked "associate" to the right of the default scheme and then scraped the html option list (because it's a full list of all projects *not* currently using the default)

I tried a few things with Bob Swift's CLI tool for Jira, but I couldn't figure out how to use --issueTypeScheme with getProjectList or any other sort of query, or even action (like make some innocuous change to all projects with an issueTypeScheme of 10000). I then dug into an export of the data (use the backup zip file generated daily, containing entities.xml & activeobjects.xml), but it appears that default literally means that - projects that don't have a defined fieldconfigscheme get the default scheme, so we're back to the concept of a negative query. You could use getProjectList, Excel, copy & paste the project lists using the non-default scheme and using some sorting in Excel, figure out which projects are using the default project scheme.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,949 views 19 22
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you