480 issue.component = component |
480 issue.component = component |
481 |
481 |
482 // pre-select version, if available in the path info |
482 // pre-select version, if available in the path info |
483 if (version != null) { |
483 if (version != null) { |
484 if (version.status.isReleased) { |
484 if (version.status.isReleased) { |
485 issue.affectedVersions = listOf(version) |
485 issue.affected = version |
486 } else { |
486 } else { |
487 issue.resolvedVersions = listOf(version) |
487 issue.resolved = version |
488 } |
488 } |
489 } |
489 } |
490 } |
490 } |
491 |
491 |
492 with(http) { |
492 with(http) { |
563 } |
563 } |
564 } |
564 } |
565 // TODO: process error messages |
565 // TODO: process error messages |
566 eta = http.param("eta", ::dateOptValidator, null, mutableListOf()) |
566 eta = http.param("eta", ::dateOptValidator, null, mutableListOf()) |
567 |
567 |
568 affectedVersions = http.paramArray("affected") |
568 affected = http.param("affected")?.toIntOrNull()?.takeIf { it > 0 }?.let { Version(it, project.id) } |
569 .mapNotNull { param -> param.toIntOrNull()?.let { Version(it, project.id) } } |
569 resolved = http.param("resolved")?.toIntOrNull()?.takeIf { it > 0 }?.let { Version(it, project.id) } |
570 resolvedVersions = http.paramArray("resolved") |
|
571 .mapNotNull { param -> param.toIntOrNull()?.let { Version(it, project.id) } } |
|
572 } |
570 } |
573 |
571 |
574 val openId = if (issue.id < 0) { |
572 val openId = if (issue.id < 0) { |
575 dao.insertIssue(issue) |
573 dao.insertIssue(issue) |
576 } else { |
574 } else { |