Clone function clones some links even if "Clone links" is not checked
Have an issue with links of different types (for example link types A,B,C,D).
in case of cloning without checking "Clone links" get a new issue with cloned links of some type A,B plus "clones". Links of type C,D were not cloned
Checked all the listeners, automations, post functions etc. There are no any scripts creating links of type A,B
using script runner script - the same result
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.fields.CustomField// the issue key of the issue to clone
final String originalIssueKey = "JC-243"// the summary of the new issue
final String newSummary = "TEST Cloning 1 - A summary for the cloned issue"// the empty map will clone all the custom fields from the original issue
final Map<CustomField, Optional<Boolean>> customFieldsToClone = [:]final boolean cloneAttachments = false
final boolean cloneSubTasks = false
final boolean cloneLinks = falsedef loggedInUser = ComponentAccessor.jiraAuthenticationContext.loggedInUser
def issueManager = ComponentAccessor.issueManager
def issueService = ComponentAccessor.issueServicedef originalIssue = issueManager.getIssueByCurrentKey(originalIssueKey)
def validationResult = issueService.validateClone(loggedInUser, originalIssue, newSummary, cloneAttachments, cloneSubTasks, cloneLinks, customFieldsToClone)
assert validationResult.isValid() : validationResult.errorCollectiondef result = issueService.clone(loggedInUser, validationResult)
assert result.isValid() : result.errorCollection
Checked on different projects - the same result
Expect no links (except "clones") in case of cloning without "Clone links" checked
Is that a bug? Some hidden jira settings ?
Can someone please help
Hi Alex,
I believe the link below will answer your question :
https://community.atlassian.com/t5/Jira-questions/if-I-want-to-clone-issue-but-not-link-And-I-can-t-add-code-in/qaq-p/1031103
hopefully this helps
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.