diff --git a/README.md b/README.md index b8c969a0..a0749acb 100755 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ Migrate your projects from Redmine to [Backlog]. * The Backlog Space's administrator roles. ## Update +* 2016/02/24 0.9.0b25 released * 2016/02/19 0.9.0b24 released * 2016/02/18 0.9.0b23 released * 2016/02/17 0.9.0b22 released @@ -261,6 +262,7 @@ Redmineのプロジェクトを[Backlog]に移行するためのツールです * Backlogの管理者権限 ## 更新履歴 +* 2016/02/24 0.9.0b25 リリース * 2016/02/19 0.9.0b24 リリース * 2016/02/18 0.9.0b23 リリース * 2016/02/17 0.9.0b22 リリース @@ -494,4 +496,4 @@ https://www.backlog.jp/contact/ [Backlog]: http://www.backlog.jp/ -[Jar]: https://github.com/nulab/BacklogMigration-Redmine/releases/download/v0.9.0b24/backlog-migration-redmine-0.9.0b24.jar \ No newline at end of file +[Jar]: https://github.com/nulab/BacklogMigration-Redmine/releases/download/v0.9.0b25/backlog-migration-redmine-0.9.0b25.jar \ No newline at end of file diff --git a/build.sbt b/build.sbt index c7f8219b..f01625f2 100644 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,7 @@ name := "backlog-migration-redmine" organization := "com.nulabinc" -version := "0.9.0b24" +version := "0.9.0b25" scalaVersion := "2.11.6" diff --git a/src/main/scala/com/nulabinc/r2b/actor/prepare/IssuesActor.scala b/src/main/scala/com/nulabinc/r2b/actor/prepare/IssuesActor.scala index 23dbe50c..e98fc1b0 100644 --- a/src/main/scala/com/nulabinc/r2b/actor/prepare/IssuesActor.scala +++ b/src/main/scala/com/nulabinc/r2b/actor/prepare/IssuesActor.scala @@ -15,8 +15,8 @@ import scala.collection.JavaConverters._ import scala.collection.mutable.Set /** - * @author uchida - */ + * @author uchida + */ class IssuesActor(conf: R2BConfig, project: Project) extends Actor with R2BLogging { private val users = Set.empty[Option[User]] @@ -40,7 +40,7 @@ class IssuesActor(conf: R2BConfig, project: Project) extends Actor with R2BLoggi } private def searchIssues(offset: Int) = { - val params: Map[String, String] = Map("offset" -> offset.toString, "limit" -> Redmine.ISSUE_GET_LIMIT.toString, "project_id" -> project.getId.toString, "status_id" -> "*") + val params: Map[String, String] = Map("offset" -> offset.toString, "limit" -> Redmine.ISSUE_GET_LIMIT.toString, "project_id" -> project.getId.toString, "status_id" -> "*", "subproject_id" -> "!*") val issues: Seq[Issue] = redmineService.getIssues(params) issues.foreach(collectUsers) } diff --git a/src/main/scala/com/nulabinc/r2b/actor/redmine/IssuesActor.scala b/src/main/scala/com/nulabinc/r2b/actor/redmine/IssuesActor.scala index b68adc22..9ed6efda 100644 --- a/src/main/scala/com/nulabinc/r2b/actor/redmine/IssuesActor.scala +++ b/src/main/scala/com/nulabinc/r2b/actor/redmine/IssuesActor.scala @@ -39,7 +39,7 @@ class IssuesActor(conf: R2BConfig, project: Project) extends Actor with R2BLoggi } private def search(offset: Int) = { - val params: Map[String, String] = Map("offset" -> offset.toString, "limit" -> Redmine.ISSUE_GET_LIMIT.toString, "project_id" -> project.getId.toString, "status_id" -> "*") + val params: Map[String, String] = Map("offset" -> offset.toString, "limit" -> Redmine.ISSUE_GET_LIMIT.toString, "project_id" -> project.getId.toString, "status_id" -> "*", "subproject_id" -> "!*") val issues: Seq[Issue] = redmineService.getIssues(params) issues.foreach(output) } @@ -49,7 +49,7 @@ class IssuesActor(conf: R2BConfig, project: Project) extends Actor with R2BLoggi val users: Seq[User] = redmineService.getUsers IOUtil.output(ConfigBase.Redmine.getIssuePath(project.getIdentifier, searchIssue.getId), RedmineMarshaller.Issue(issue, project, users)) - AttachmentDownloader.issue(conf.redmineKey, project.getIdentifier,issue) + AttachmentDownloader.issue(conf.redmineKey, project.getIdentifier, issue) count += 1 info(Messages("message.execute_redmine_issue_export", project.getName, count, allCount)) diff --git a/src/main/scala/com/nulabinc/r2b/conf/ConfigBase.scala b/src/main/scala/com/nulabinc/r2b/conf/ConfigBase.scala index 51fb8879..897d7715 100644 --- a/src/main/scala/com/nulabinc/r2b/conf/ConfigBase.scala +++ b/src/main/scala/com/nulabinc/r2b/conf/ConfigBase.scala @@ -8,7 +8,7 @@ import java.io.File object ConfigBase { val LOG_APPLICATION_LABEL = "[R2B]" val NAME: String = "Backlog Migration for Redmine" - val VERSION: String = "0.9.0b24" + val VERSION: String = "0.9.0b25" val root = new File(".").getAbsoluteFile.getParent val R2B_ROOT = root + "/backlog-migration-redmine" diff --git a/src/main/scala/com/nulabinc/r2b/domain/Redmine.scala b/src/main/scala/com/nulabinc/r2b/domain/Redmine.scala index a90c68cb..aab31749 100644 --- a/src/main/scala/com/nulabinc/r2b/domain/Redmine.scala +++ b/src/main/scala/com/nulabinc/r2b/domain/Redmine.scala @@ -49,13 +49,7 @@ case class RedmineJournalDetail(property: String, name: String, oldValue: Option case class RedmineAttachment( id: Int, - fileSize: Long, - fileName: String, - contentType: String, - description: String, - contentURL: String, - author: Int, - createdOn: String) + fileName: String) case class RedmineWikiPage( title: String, @@ -156,7 +150,7 @@ object RedmineJsonProtocol extends DefaultJsonProtocol { implicit val RedmineProjectFormat = jsonFormat3(RedmineProject) implicit val RedmineIssueStatusFormat = jsonFormat2(RedmineIssueStatus) implicit val RedmineIssueStatusesWrapperFormat = jsonFormat1(RedmineIssueStatusesWrapper) - implicit val RedmineAttachmentFormat = jsonFormat8(RedmineAttachment) + implicit val RedmineAttachmentFormat = jsonFormat2(RedmineAttachment) implicit val RedmineWikiPageFormat = jsonFormat8(RedmineWikiPage) implicit val RedmineCustomFieldFormat = jsonFormat5(RedmineCustomField) implicit val RedmineJournalDetailFormat = jsonFormat4(RedmineJournalDetail) diff --git a/src/main/scala/com/nulabinc/r2b/service/RedmineMarshaller.scala b/src/main/scala/com/nulabinc/r2b/service/RedmineMarshaller.scala index 48225dc8..6a818919 100644 --- a/src/main/scala/com/nulabinc/r2b/service/RedmineMarshaller.scala +++ b/src/main/scala/com/nulabinc/r2b/service/RedmineMarshaller.scala @@ -187,13 +187,7 @@ object RedmineMarshaller { private def getRedmineAttachment(attachment: Attachment): RedmineAttachment = RedmineAttachment( id = attachment.getId, - fileSize = attachment.getFileSize, - fileName = attachment.getFileName, - contentType = attachment.getContentType, - description = attachment.getDescription, - contentURL = attachment.getContentURL, - author = attachment.getAuthor.getId, - createdOn = new DateTime(attachment.getCreatedOn).toString(timestampFormat)) + fileName = attachment.getFileName) private def getRedmineCustomField(customField: CustomField): RedmineCustomField = RedmineCustomField( diff --git a/src/main/scala/com/nulabinc/r2b/service/RedmineService.scala b/src/main/scala/com/nulabinc/r2b/service/RedmineService.scala index 99d6299c..6498f886 100644 --- a/src/main/scala/com/nulabinc/r2b/service/RedmineService.scala +++ b/src/main/scala/com/nulabinc/r2b/service/RedmineService.scala @@ -23,7 +23,7 @@ class RedmineService(conf: R2BConfig) extends R2BLogging { val redmine: RedmineManager = RedmineManagerFactory.createWithApiKey(conf.redmineUrl, conf.redmineKey) def getIssuesCount(projectId: Int): Int = { - val url = conf.redmineUrl + "/issues.json?limit=1&project_id=" + projectId + "&key=" + conf.redmineKey + "&status_id=*" + val url = conf.redmineUrl + "/issues.json?limit=1&subproject_id=!*&project_id=" + projectId + "&key=" + conf.redmineKey + "&status_id=*" val str: String = httpGet(url) val redmineIssuesWrapper: RedmineIssuesWrapper = JsonParser(str).convertTo[RedmineIssuesWrapper] redmineIssuesWrapper.total_count