Set project Field Configuration Scheme programmatically

Hi, We are trying to set some project schemes programmatically for an inside development. We are able to set some schemes like: notification scheme, issue security scheme, permission scheme, issue type screen scheme, etc. using WorkflowSchemeManager, PermissionSchemeManager, etc etc etc. But we don't know how to set the Field Configuration Scheme and the Issue Type scheme Any ideas on how can we set those 2 schemes to projects??? Regards

4 answers

try with this

FieldConfigurationScheme srcProjectFieldLayout = fieldLayoutManager.getFieldConfigurationScheme(srcProjectGV)
        if (srcProjectFieldLayout) {
            fieldLayoutManager.addSchemeAssociation(newprojectGV, srcProjectFieldLayout.getId())

for your reference

@Iryna, if some thing helped you don't forget to voteup/accept as a answer,

it will help other users to choose right answer

this doesn't copy IssueTypeScheme, but I found a solution in your reference.

Thanks =)

Hi all,

for the issue type scheme (based on AssociateIssueTypeSchemes):

FieldConfigScheme newIssueTypeScheme = fieldConfigSchemeManager.getFieldConfigScheme(issueTypeSchemeId);

        JiraContextTreeManager treeManager = ComponentManager

        // Set the contexts
        List<JiraContextNode> contexts = CustomFieldUtils.buildJiraIssueContexts(false,
                new Long[]{project.getId()},

        ConfigurableField configurableField = newIssueTypeScheme.getField();
        fieldConfigSchemeManager.updateFieldConfigScheme(newIssueTypeScheme, contexts, configurableField);


and for the field layout configuration scheme:

FieldLayoutScheme fieldLayoutScheme = fieldLayoutManager.getMutableFieldLayoutScheme(fieldLayoutSchemeId);
      fieldLayoutManager.addSchemeAssociation(project, fieldLayoutScheme.getId());

Thanks, you saved me.

But can you tell how you retrieve issueTypeSchemeId in your example ?

i ahve given link check there you will get entire code

IssueTypeScheme has a manager


issueTypeSchemeManager.create("name of scheme", "description", issueTypdIds);

The issueTypeIds is a List of Strings whose id's are the IssueTypes to go in that scheme

I'll checkout FieldConfigurationScheme as was looking at that recently myself

Hi. Have you found any solution for setting Issue Type Scheme?

I actually tried to set it with IssueTypeSchemeManager but couldn't do it till now.

But Field Configuration you can set with this (here i was copying scheme from one project to another, but i think this will be the same with created scheme):

com.atlassian.jira.issue.fields.layout.field.FieldLayoutManager flmanager = ComponentManager.getInstance().getFieldLayoutManager();

org.ofbiz.core.entity.GenericValue projectFrom = pmanager.getProjectByKey(keyFrom);

org.ofbiz.core.entity.GenericValue projectTo = pmanager.getProjectByKey(keyTo);

com.atlassian.jira.issue.fields.layout.field.FieldConfigurationScheme fieldConfigurationScheme = flmanager	.getFieldConfigurationScheme(projectFrom);

Long fieldLayoutSchemeId = fieldConfigurationScheme.getId();

flmanager.addSchemeAssociation(projectTo, fieldLayoutSchemeId);

Hi. i found a solution here

hope this can help you

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

957 views 3 9
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