Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to find all the projects using default field configuration?



How to find all the projects using default field configuration's of a custom field?

Any sort of help is appreciated. 




import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.issue.fields.CustomField;
import com.atlassian.jira.issue.fields.ConfigurableField;
import com.atlassian.jira.issue.CustomFieldManager;
import com.atlassian.jira.issue.fields.config.FieldConfigScheme;
import com.atlassian.jira.issue.fields.config.manager.FieldConfigSchemeManager;
import com.atlassian.jira.issue.fields.FieldManager;
import com.atlassian.jira.issue.context.ProjectContext;
import com.atlassian.jira.issue.context.JiraContextNode;
import org.apache.log4j.Logger;
import org.apache.log4j.Level;
def log = Logger.getLogger("test.connector")

CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager();
FieldConfigSchemeManager fieldConfigSchemeManager = ComponentAccessor.getFieldConfigSchemeManager();
FieldManager fieldManager = ComponentAccessor.getFieldManager();

def customfield = fieldManager.getCustomField("customfield_26238")
def projects_using = customfield.getConfigurationSchemes()
def projects = customfield.getAssociatedProjectObjects()
for(int i=0;i<projects_using.size();i++){
log.debug(projects_using[i]. getAssociatedProjectIds())


The above is working only for the projects which have their separate context. 


2018-06-04 20:04:32,038 DEBUG [test.connector]: [com.atlassian.jira.issue.fields.config.FieldConfigSchemeImpl@5174eeeb, com.atlassian.jira.issue.fields.config.FieldConfigSchemeImpl@25f2efc1, com.atlassian.jira.issue.fields.config.FieldConfigSchemeImpl@2d65b11c]

2018-06-04 20:04:32,038 DEBUG [test.connector]: Default Configuration Scheme for 911 Flow Completed?

2018-06-04 20:04:32,038 DEBUG [test.connector]: []

2018-06-04 20:04:32,038 DEBUG [test.connector]: Phone Launches

2018-06-04 20:04:32,038 DEBUG [test.connector]: [21209, 22015]

2018-06-04 20:04:32,038 DEBUG [test.connector]: Kiran Test

2018-06-04 20:04:32,038 DEBUG [test.connector]: [11204]


0 answers

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Apps & Integrations

Send an Email or Publish to Confluence - What should you do with your release notes?

Background When you hear the words ‘Release notes’, almost always you think of an unsolicited email from a software vendor. But I am here to tell you that from our data, sending release notes via E...

138 views 1 2
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you