Unable to perform deployment: Unable to apply change 'type: addition, object: JiraConfigurationRoot#root/JiraIssueType
Problem
CMJ tried to create a new issue type with the name ' XXXXX' and failed because, according to Jira, there was one already.
This is usually caused by whitespace at the end or the beginning of the name, like " Test" or "Test “ and Jira will silently trim these whitespaces when comparing issue types.
Caused by: com.botronsoft.jira.rollout.impl.merge.MergeException: Unable to apply change 'type: addition, object: JiraConfigurationRoot#root/JiraIssueType# issue, target object: JiraConfigurationRoot#root, feature: issueTypes'
at com.botronsoft.jira.rollout.impl.merge.AbstractMergeAdapter.notifyChanged(AbstractMergeAdapter.java:89)
at com.botronsoft.jira.rollout.impl.merge.di.CacheRefreshInterceptor.invoke(CacheRefreshInterceptor.java:30)
at com.botronsoft.jira.rollout.impl.merge.MainMergeAdapter.notifyChanged(MainMergeAdapter.java:59)
at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:424)
at org.eclipse.emf.ecore.util.EcoreEList.dispatchNotification(EcoreEList.java:249)
at org.eclipse.emf.compare.merge.AbstractMerger.addAt(AbstractMerger.java:1222)
at com.botronsoft.jira.rollout.model.diff.AtomicityAwareReferenceMerger.addInTarget(AtomicityAwareReferenceMerger.java:95)
at org.eclipse.emf.compare.merge.ReferenceChangeMerger.accept(ReferenceChangeMerger.java:129)
at org.eclipse.emf.compare.merge.AbstractMerger.copyDiff(AbstractMerger.java:796)
at org.eclipse.emf.compare.merge.AbstractMerger.copyLeftToRight(AbstractMerger.java:819)
at org.eclipse.emf.compare.merge.BatchMerger.copyAllLeftToRight(BatchMerger.java:150)
at com.botronsoft.jira.rollout.impl.deploy.ConfigurationImportServiceImpl.importConfiguration(ConfigurationImportServiceImpl.java:213)
at com.botronsoft.jira.rollout.impl.snapshot.SnapshotImportOperationService.importSnapshot(SnapshotImportOperationService.java:120)
... 9 more
Caused by: java.lang.IllegalStateException: An issue type with the name ' XXXXX' exists already.
at com.atlassian.jira.config.DefaultIssueTypeManager.createIssueTypeAndAddToDefaultScheme(DefaultIssueTypeManager.java:138)
at com.atlassian.jira.config.DefaultIssueTypeManager.createIssueTypeAndAddToDefaultScheme(DefaultIssueTypeManager.java:129)
at com.atlassian.jira.config.DefaultIssueTypeManager.createSubTaskIssueType(DefaultIssueTypeManager.java:115)
at com.botronsoft.jira.rollout.impl.merge.ConfigurationRootMergeAdapter.addIssueType(ConfigurationRootMergeAdapter.java:669)
at com.botronsoft.jira.rollout.impl.merge.di.CacheRefreshInterceptor.invoke(CacheRefreshInterceptor.java:30)
at com.botronsoft.jira.rollout.impl.merge.ConfigurationRootMergeAdapter.addFeature(ConfigurationRootMergeAdapter.java:173)
at com.botronsoft.jira.rollout.impl.merge.AbstractMergeAdapter.notifyChanged(AbstractMergeAdapter.java:78)Solution
Go to the source instance and check the issue type
' XXXXX'for whitespaces in its name. If there are any, trim them off and create a new snapshot.Now go to the target instance and check the issue type
' XXXXX'for whitespaces in its name. If there are any, trim them off and deploy again(deploy the new snapshot if you created one from the previous step).
If that doesn’t help, please send us the latest Support Zip file and the output of the following database query from both source and target instances.
SELECT QUOTE(pname) as pname_with_whitespace FROM ISSUETYPE;The SQL above will add the ' to the Issue type name in the query result so that whitespace can be easily identified.
e.g
‘Epic’
'Story'
'Task'
'Test ' → here you can see there is a whitespace at the end of the name.