Clone Issue does not work for some issue types
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
The clone issue is not working for some issue types. Other issue types using the same workflow work fine.
Environment
Jira 8.5.15, 8.X, 9.X
Diagnosis
Atlassian-Jira-log showing below WorkflowException while cloning issues.
1
2
3
4
2024-06-04 08:40:28,588+0900 JiraTaskExecutionThread-3 ERROR xxxx 520x16626x1 9jbt2p 12.x.x.x /secure/CloneIssueDetails.jspa [c.a.j.bc.issue.DefaultIssueService] com.atlassian.jira.workflow.WorkflowException
com.atlassian.jira.exception.CreateException: com.atlassian.jira.workflow.WorkflowException
at com.atlassian.jira.issue.managers.DefaultIssueManager.createIssue(DefaultIssueManager.java:522)
OR
1
2
3
2023-06-14 05:55:34,338+0000 JiraTaskExecutionThread-343 ERROR xxxx 355x1894364x1 4degs1 172.x.x.x /secure/CloneIssueDetails.jspa [c.a.j.bc.issue.DefaultIssueService] com.atlassian.jira.workflow.WorkflowException: java.lang.NullPointerException
com.atlassian.jira.exception.CreateException: com.atlassian.jira.workflow.WorkflowException: java.lang.NullPointerException
at com.atlassian.jira.issue.managers.DefaultIssueManager.createIssue(DefaultIssueManager.java:508)
OR
1
2
020-04-28 13:12:30,877 JiraTaskExecutionThread-958 ERROR xxxx 792x8269411x1 1jnrtlt x.x.x.x /secure/CloneIssueDetails.jspa [c.a.j.bc.issue.DefaultIssueService] com.atlassian.jira.workflow.WorkflowException: java.lang.NullPointerException: null value in entry: issue=null
com.atlassian.jira.exception.CreateException: com.atlassian.jira.workflow.WorkflowException: java.lang.NullPointerException: null value in entry: issue=null
Cause
Looking further in the stack trace for Workflow exception you see below NPE while executing the CreateIssue and hence the Clone operation is blocked
1
2
3
4
5
6
7
8
9
Caused by: java.lang.NullPointerException
at com.xxxxx.atlassian.teammultiselect.jira.customfields.TeamMultiSelect.getDefaultValue(TeamMultiSelect.java:137)
at com.xxxxx.atlassian.teammultiselect.jira.customfields.TeamMultiSelect.createValue(TeamMultiSelect.java:60)
at com.atlassian.jira.issue.fields.ImmutableCustomField.createValue(ImmutableCustomField.java:693)
at com.atlassian.jira.workflow.function.issue.IssueCreateFunction.execute(IssueCreateFunction.java:81)
at com.opensymphony.workflow.AbstractWorkflow.executeFunction(AbstractWorkflow.java:1014)
at com.opensymphony.workflow.AbstractWorkflow.transitionWorkflow(AbstractWorkflow.java:1407)
at com.opensymphony.workflow.AbstractWorkflow.initialize(AbstractWorkflow.java:606)
at com.atlassian.jira.workflow.OSWorkflowManager.createIssue(OSWorkflowManager.java:754)
The above trace shows that code from the plugin Jira-Team-MultiSelect is getting executed when it gets NPE for the custom field.
OR
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
at com.xpandit.raven.customfield.TestTestPlansCustomField.createValue(Unknown Source)
....
at com.atlassian.jira.workflow.OSWorkflowManager.createIssue(OSWorkflowManager.java:754)
... 12 more
Caused by: java.lang.NullPointerException
at com.xpandit.raven.parameterizedtest.dataset.service.impl.DatasetTestLinkServiceImpl.a(Unknown Source)
at java.base/java.util.Optional.map(Unknown Source)
at com.xpandit.raven.parameterizedtest.dataset.service.impl.DatasetTestLinkServiceImpl.a(Unknown Source)
at com.xpandit.raven.parameterizedtest.dataset.bean.h.a(Unknown Source)
at com.xpandit.raven.service.impl.ParameterServiceImpl.a(Unknown Source)
at com.xpandit.raven.parameterizedtest.dataset.service.impl.DatasetServiceImpl.b(Unknown Source)
at com.xpandit.raven.parameterizedtest.dataset.service.impl.DatasetServiceImpl.a(Unknown Source)
at com.xpandit.raven.parameterizedtest.dataset.service.impl.DatasetServiceImpl.a(Unknown Source)
at com.xpandit.raven.customfield.TestTestPlansCustomField.a(Unknown Source)
Above trace show that code from XRay plugin is getting executed when it got NPE for custom field.
OR
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Caused by: com.google.common.util.concurrent.UncheckedExecutionException: java.lang.NullPointerException: null value in entry: issue=null
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2203)
at com.google.common.cache.LocalCache$LocalManualCache.get(LocalCache.java:4739)
at com.atlassian.jira.issue.customfields.persistence.EagerLoadingOfBizCustomFieldPersister.getValuesForIssueId(EagerLoadingOfBizCustomFieldPersister.java:103)
at com.atlassian.jira.issue.customfields.persistence.EagerLoadingOfBizCustomFieldPersister.getValuesForTypeAndParent(EagerLoadingOfBizCustomFieldPersister.java:86)
at com.atlassian.jira.issue.customfields.persistence.OfBizCustomFieldValuePersister.updateValues(OfBizCustomFieldValuePersister.java:151)
at com.atlassian.jira.issue.customfields.persistence.EagerLoadingOfBizCustomFieldPersister.updateValues(EagerLoadingOfBizCustomFieldPersister.java:61)
at com.atlassian.jira.issue.customfields.persistence.OfBizCustomFieldValuePersister.createValues(OfBizCustomFieldValuePersister.java:108)
at com.atlassian.jira.issue.customfields.persistence.EagerLoadingOfBizCustomFieldPersister.createValues(EagerLoadingOfBizCustomFieldPersister.java:49)
at com.atlassian.jira.issue.customfields.persistence.OfBizCustomFieldValuePersister.createValues(OfBizCustomFieldValuePersister.java:101)
at com.atlassian.jira.issue.customfields.persistence.EagerLoadingOfBizCustomFieldPersister.createValues(EagerLoadingOfBizCustomFieldPersister.java:43)
at com.atlassian.jira.issue.customfields.impl.AbstractSingleFieldType.createValue(AbstractSingleFieldType.java:143)
at com.atlassian.jira.issue.fields.ImmutableCustomField.createValue(ImmutableCustomField.java:693)
at com.atlassian.jira.issue.fields.ImmutableCustomField.updateValue(ImmutableCustomField.java:410)
at com.atlassian.jira.issue.fields.ImmutableCustomField.updateValue(ImmutableCustomField.java:396)
at ch.beecom.jira.jsu.util.field.WorkflowUtils.setFieldValue(WorkflowUtils.java:412)
at ch.beecom.jira.jsu.util.field.WorkflowUtils.setFieldValue(WorkflowUtils.java:246)
at ch.beecom.jira.jsu.util.copyfields.FieldsCopier.setValueFallbackToString(FieldsCopier.java:134)
at ch.beecom.jira.jsu.util.copyfields.FieldsCopier.copyField(FieldsCopier.java:82)
at ch.beecom.jira.jsu.util.copyfields.FieldsCopier.copyFields(FieldsCopier.java:74)
at ch.beecom.jira.jsu.workflow.function.copyvaluefromotherfield.CopyValueFromOtherFieldPostFunction.copyFields(CopyValueFromOtherFieldPostFunction.java:115)
at m.atlassian.jira.issue.customfields.persistence.EagerLoadingOfBizCustomFieldPersister.createValues(Eagech.beecom.jira.jsu.workflow.function.copyvaluefromotherfield.CopyValueFromOtherFieldPostFunction.executeFunction(CopyValueFromOtherFieldPostFunction.java:102)
at ch.beecom.jira.jsu.workflow.function.AbstractPreserveChangesPostFunction.executeFunction(AbstractPreserveChangesPostFunction.java:44)
at ch.beecom.jira.jsu.workflow.precondition.AbstractPreconditionAwareFunction.execute(AbstractPreconditionAwareFunction.java:51)
at com.opensymphony.workflow.AbstractWorkflow.executeFunction(AbstractWorkflow.java:1014)
at com.opensymphony.workflow.AbstractWorkflow.transitionWorkflow(AbstractWorkflow.java:1407)
at com.opensymphony.workflow.AbstractWorkflow.initialize(AbstractWorkflow.java:606)
at com.atlassian.jira.workflow.OSWorkflowManager.createIssue(OSWorkflowManager.java:742)
... 12 more
Above trace show that code from plugin JSU is getting executed when it got NPE for custom field.
Solution
As the exception is related to Workflow remove/disable any post-function/validator in the workflow of the issue your are trying to close and then try to clone the issue.
Disable the 3rd party plugin list in stack trace (like in above examples it was Jira-Team-MultiSelect , XRay and JSU ) and then try to clone the issue.
If issue is resolved by disabling the 3rd party plugin then contact the 3rd party vendor and provide the stack trace so that they can investigate it.
Was this helpful?