From cebb6dcaa7c0a8741ceb6edc13ee7b5616c31976 Mon Sep 17 00:00:00 2001 From: Michael Karmazin Date: Thu, 25 Aug 2022 12:25:59 +1000 Subject: [PATCH] Fix the case when FieldType.String comes as OptionFieldValue rather than StringFieldValue --- .../j2b/issue/writer/convert/IssueFieldWrites.scala | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/scala/com/nulabinc/backlog/j2b/issue/writer/convert/IssueFieldWrites.scala b/src/main/scala/com/nulabinc/backlog/j2b/issue/writer/convert/IssueFieldWrites.scala index 037fd8f..a65d2c1 100644 --- a/src/main/scala/com/nulabinc/backlog/j2b/issue/writer/convert/IssueFieldWrites.scala +++ b/src/main/scala/com/nulabinc/backlog/j2b/issue/writer/convert/IssueFieldWrites.scala @@ -93,10 +93,14 @@ class IssueFieldWrites @Inject() (customFieldDefinitions: Seq[Field]) ) } case FieldType.String => - toTextCustomField( - field, - issueField.value.asInstanceOf[StringFieldValue] - ) + var stringFieldValue: StringFieldValue = null + issueField.value match { + case optionFieldValue: OptionFieldValue => + stringFieldValue = StringFieldValue(optionFieldValue.value) + case _ => + stringFieldValue = issueField.value.asInstanceOf[StringFieldValue] + } + toTextCustomField(field, stringFieldValue) case FieldType.Unknown => toTextCustomField( field,