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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
this doesn't copy IssueTypeScheme, but I found a solution in your reference.
Thanks =)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all,
for the issue type scheme (based on AssociateIssueTypeSchemes):
FieldConfigScheme newIssueTypeScheme = fieldConfigSchemeManager.getFieldConfigScheme(issueTypeSchemeId); JiraContextTreeManager treeManager = ComponentManager .getComponentInstanceOfType(JiraContextTreeManager.class); // Set the contexts List<JiraContextNode> contexts = CustomFieldUtils.buildJiraIssueContexts(false, null, new Long[]{project.getId()}, treeManager); ConfigurableField configurableField = newIssueTypeScheme.getField(); fieldConfigSchemeManager.updateFieldConfigScheme(newIssueTypeScheme, contexts, configurableField); fieldManager.refresh();
and for the field layout configuration scheme:
FieldLayoutScheme fieldLayoutScheme = fieldLayoutManager.getMutableFieldLayoutScheme(fieldLayoutSchemeId); fieldLayoutManager.addSchemeAssociation(project, fieldLayoutScheme.getId());
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, you saved me.
But can you tell how you retrieve issueTypeSchemeId in your example ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i ahve given link check there you will get entire code
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi. i found a solution here https://bitbucket.org/topmanage/tm-project-templates/overview
hope this can help you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
IssueTypeScheme has a manager
e.g.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'll checkout FieldConfigurationScheme as was looking at that recently myself
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.