Skip to content

Commit

Permalink
Merge branch 'release/0.3.0b4'
Browse files Browse the repository at this point in the history
  • Loading branch information
shomatan committed Jul 25, 2018
2 parents 2b68bcb + c931268 commit c6cfedd
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Download

Please download the jar file from this link, and run from the command line as follows.

https://github.com/nulab/BacklogMigration-Jira/releases/download/0.3.0b3/backlog-migration-jira-0.3.0b3.jar
https://github.com/nulab/BacklogMigration-Jira/releases/download/0.3.0b4/backlog-migration-jira-0.3.0b4.jar

java -jar backlog-migration-jira-[latest version].jar

Expand Down Expand Up @@ -218,7 +218,7 @@ https://github.com/nulab/BacklogMigration-Jira/releases

こちらのリンクからjarファイルをダウンロードし、以下のようにコマンドラインから実行します。

https://github.com/nulab/BacklogMigration-Jira/releases/download/0.3.0b3/backlog-migration-jira-0.3.0b3.jar
https://github.com/nulab/BacklogMigration-Jira/releases/download/0.3.0b4/backlog-migration-jira-0.3.0b4.jar

java -jar backlog-migration-jira-[最新バージョン].jar

Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import sbt.Keys._

scapegoatVersion in ThisBuild := "1.3.3"

lazy val projectVersion = "0.3.0b3"
lazy val projectVersion = "0.3.0b4"

lazy val commonSettings = Seq(
organization := "com.nulabinc",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@ object IssueMappingJsonProtocol extends DefaultJsonProtocol {
.map { item => IssueField(item._1, item._2.toString)}
.toSeq

def requireField[A](fields: Map[String, JsValue], fieldName: String)(implicit p: JsonReader[A]): A =
fields.find(_._1 == fieldName).map(_._2) match {
case Some(result) if result == JsNull =>
deserializationError(s"Cannot deserialize Issue. Field: $fieldName is required. Key: $key")
case Some(result) =>
result.convertTo[A]
case None =>
deserializationError(s"Cannot deserialize Issue. Field: $fieldName not found. Key: $key")
}

Issue(
id = id.toLong,
key = key,
Expand All @@ -75,12 +85,12 @@ object IssueMappingJsonProtocol extends DefaultJsonProtocol {
issueFields = issueFields,
dueDate = fieldMap.find(_._1 == "duedate").filterNot(_._2 == JsNull).map(_._2.convertTo[Date]),
timeTrack = fieldMap.find(_._1 == "timetracking").map(_._2.convertTo[TimeTrack]),
issueType = fieldMap.find(_._1 == "issuetype").map(_._2.convertTo[IssueType]).get,
status = fieldMap.find(_._1 == "status").map(_._2.convertTo[Status]).get,
priority = fieldMap.find(_._1 == "priority").map(_._2.convertTo[Priority]).get,
creator = fieldMap.find(_._1 == "creator").map(_._2.convertTo[User]).get,
createdAt = fieldMap.find(_._1 == "created").map(_._2.convertTo[Date]).get,
updatedAt = fieldMap.find(_._1 == "updated").map(_._2.convertTo[Date]).get,
issueType = requireField[IssueType](fieldMap, "issuetype"),
status = requireField[Status](fieldMap, "status"),
priority = requireField[Priority](fieldMap, "priority"),
creator = requireField[User](fieldMap, "creator"),
createdAt = requireField[Date](fieldMap, "created"),
updatedAt = requireField[Date](fieldMap, "updated"),
changeLogs = Seq.empty[ChangeLog],
attachments = fieldMap.find(_._1 == "attachment").map(_._2.convertTo[Seq[Attachment]]).getOrElse(Seq.empty[Attachment])
)
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
application {
name = "Backlog Migration for Jira"
version = "0.3.0b3"
version = "0.3.0b4"
title = ${application.name} ${application.version} (c) nulab.inc
fileName = backlog-migration-jira-${application.version}.jar
product = "jira"
Expand Down

0 comments on commit c6cfedd

Please sign in to comment.