Skip to content

Commit

Permalink
fix #32, but not fully
Browse files Browse the repository at this point in the history
outlook and google calendar don't import alarm so not a big issue
  • Loading branch information
CXwudi committed Jun 21, 2024
1 parent 84d69f3 commit 907b857
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ class IssuesGetter(
"idReadable",
"summary",
"description",
"customFields(name,id,value(name,id))"
"customFields(name,id,value(name,id,minutes))" // added minutes for the duration value,
// required by AlarmMapper as the string representation can contain an invalid P1W format
) + youtrackFieldNames,
customFields = customFieldNames,
pageSize = searchConfig.pageSize,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ import java.time.Duration
* 2023-01-03
*/
class AlarmMapper {

companion object {
}
fun createAlarm(json: YouTrackIssueJson, alarmSetting: AlarmSetting?): VAlarm? {
if (alarmSetting == null) {
log.info { "No alarm setting for ${json.debugName}, skipping alarm creation" }
Expand Down Expand Up @@ -93,8 +96,8 @@ class AlarmMapper {
log.debug { "${json.debugName} have empty or null value in the custom field $fieldName for creating alarm" }
return null
}
val durationString = valueJson["id"].asText()
return Duration.parse(durationString).let {
val durationMinutes = valueJson["minutes"].asLong()
return Duration.ofMinutes(durationMinutes).let {
if (isNegative) {
it.negated()
} else {
Expand Down

0 comments on commit 907b857

Please sign in to comment.