33import com .fasterxml .jackson .core .JsonProcessingException ;
44import com .rawlabs .das .sdk .java .exceptions .DASSdkApiException ;
55import com .rawlabs .protocol .das .Row ;
6+ import org .joda .time .DateTime ;
7+ import org .joda .time .DateTimeZone ;
68
9+ import java .time .OffsetDateTime ;
10+ import java .time .ZonedDateTime ;
711import java .util .*;
812
913@ SuppressWarnings ("unchecked" )
@@ -52,11 +56,12 @@ protected void processFields(
5256 assignee .map (a -> a .get ("displayName" )).orElse (null ),
5357 columns );
5458
55- addToRow (
56- "created" ,
57- rowBuilder ,
58- maybeFields .map (f -> f .get (names .get ("Created" ))).orElse (null ),
59- columns );
59+ String created =
60+ maybeFields
61+ .map (f -> f .get (names .get ("Created" )))
62+ .map (c -> DateTime .parse (c .toString ()).withZone (DateTimeZone .UTC ).toString ())
63+ .orElse (null );
64+ addToRow ("created" , rowBuilder , created , columns );
6065
6166 var creator =
6267 maybeFields .map (f -> f .get (names .get ("Creator" ))).map (p -> (Map <String , Object >) p );
@@ -87,11 +92,9 @@ protected void processFields(
8792 throw new DASSdkApiException ("error processing 'description'" , e );
8893 }
8994
90- addToRow (
91- "due_date" ,
92- rowBuilder ,
93- maybeFields .map (f -> f .get (names .get ("Due date" ))).orElse (null ),
94- columns );
95+ String due_date = maybeFields .flatMap (f -> Optional .ofNullable (f .get (names .get ("Due date" )))).map (Object ::toString ).orElse (null );
96+
97+ addToRow ("due_date" , rowBuilder , due_date , columns );
9598
9699 var priority =
97100 maybeFields .map (f -> f .get (names .get ("Priority" ))).map (p -> (Map <String , Object >) p );
@@ -106,12 +109,20 @@ protected void processFields(
106109 rowBuilder ,
107110 reporter .map (r -> r .get ("accountId" )).orElse (null ),
108111 columns );
112+
109113 addToRow (
110114 "reporter_display_name" ,
111115 rowBuilder ,
112116 reporter .map (r -> r .get ("displayName" )).orElse (null ),
113117 columns );
114118
119+ String resolved =
120+ maybeFields
121+ .flatMap (f -> Optional .ofNullable (f .get (names .get ("Resolved" ))))
122+ .map (c -> DateTime .parse (c .toString ()).withZone (DateTimeZone .UTC ).toString ())
123+ .orElse (null );
124+ addToRow ("resolution_date" , rowBuilder , resolved , columns );
125+
115126 addToRow (
116127 "summary" ,
117128 rowBuilder ,
0 commit comments