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

Jenin CM August 18, 2013

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
Answer accepted
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 18, 2013

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?

Michael Ellis January 30, 2018

Why is this the accepted answer?

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 30, 2018

Probably a hangover from the forum before last.

3 votes
MattS
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 15, 2015

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();
MattS
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 8, 2017

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();
Oleksandr Chalyi January 23, 2018

Hi Matt,

What is the proper way of running your script?

I appreciated for your outcome!

0 votes
Kelly Schoenhofen
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 18, 2013
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.
0 votes
Jenin CM August 18, 2013

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

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 18, 2013

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)

Suggest an answer

Log in or Sign up to answer