Clone function clones some links even if "Clone links" is not checked

Alex Pogan December 19, 2020

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 = false

def loggedInUser = ComponentAccessor.jiraAuthenticationContext.loggedInUser
def issueManager = ComponentAccessor.issueManager
def issueService = ComponentAccessor.issueService

def originalIssue = issueManager.getIssueByCurrentKey(originalIssueKey)

def validationResult = issueService.validateClone(loggedInUser, originalIssue, newSummary, cloneAttachments, cloneSubTasks, cloneLinks, customFieldsToClone)
assert validationResult.isValid() : validationResult.errorCollection

def 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

1 answer

0 votes
Der Lun _Adaptavist_ January 21, 2021

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
7.11.0
TAGS
AUG Leaders

Atlassian Community Events