How can I change the security level when moving an issue to another project?

Originally asked by Oscar Ruiz Ramirez on 01 October 2020 (original question)


When I use the Move.groovy script the security level does not change. In the following code I make the security level change before running the move, but after moving the issue it keeps the security level of the original issue.

if (replica.projectKey != issue.project.key) {
	issue.securityLevel = new BasicHubIssueSecurityLevel(
		nodeHelper.getSecurityLevelId(
			 replica.customKeys.u_jira_security_level,
			 nodeHelper.getProject(replica.projectKey)) as String,
		replica.customKeys.u_jira_security_level,
		null
	) 
	Move.move(
		issue,
		replica.projectKey,
		issue.typeName,
		issue.status.name
	)
	syncHelper.syncBackAfterProcessing()
}



How can I change the security level when moving an issue to another project?