Originally asked by Petri Pihlajamaa on 13 November 2020 (original question)
I’m having trouble updating Issue’s type via Exalate. The typename updates nicely but it doesn’t actually update the type of the issue.
def statusMapping = [
// Jira issue status <-> Zendesk ticket status
"bug" : "Bug",
"feature_request" : "Story",
"task" : "Task",
"technical_issue" : "Task"
]
def TicketTypeName = replica.customFields."Ticket type"?.value?.value
//throw new Exception("Status - ${TicketTypeName}")
def TicketType = statusMapping[TicketTypeName] ?: "Bug"
//throw new Exception("Status - ${TicketType}")
//issue.typeName = nodeHelper.getIssueType(TicketType)?.name ?: "Bug"
issue.typeName = nodeHelper.getIssueType(TicketType)?.name ?: "Bug"
issue.type.name = issue.typeName
throw new Exception("Status - ${issue.type.properties}")
The exception shows the type name updates to Task as it should but the issue itself is still the original type in Jira.
Script error for issue PCO-2613. Details: Status - [class:class com.exalate.basic.domain.hubobject.v1.BasicHubIssueType, id:10167, locked:false, description:null, name:Task]. Error line: Script334.groovy:33