Skip to content

Commit

Permalink
Fixed RD-15247: IS [NOT] NULL generates wrong JQL
Browse files Browse the repository at this point in the history
  • Loading branch information
bgaidioz committed Dec 31, 2024
1 parent 8530102 commit 499b575
Show file tree
Hide file tree
Showing 10 changed files with 1,707 additions and 198 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
import com.fasterxml.jackson.core.JsonProcessingException;
import com.rawlabs.das.sdk.java.exceptions.DASSdkApiException;
import com.rawlabs.protocol.das.Row;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;

import java.time.OffsetDateTime;
import java.time.ZonedDateTime;
import java.util.*;

@SuppressWarnings("unchecked")
Expand Down Expand Up @@ -52,11 +56,12 @@ protected void processFields(
assignee.map(a -> a.get("displayName")).orElse(null),
columns);

addToRow(
"created",
rowBuilder,
maybeFields.map(f -> f.get(names.get("Created"))).orElse(null),
columns);
String created =
maybeFields
.map(f -> f.get(names.get("Created")))
.map(c -> DateTime.parse(c.toString()).withZone(DateTimeZone.UTC).toString())
.orElse(null);
addToRow("created", rowBuilder, created, columns);

var creator =
maybeFields.map(f -> f.get(names.get("Creator"))).map(p -> (Map<String, Object>) p);
Expand Down Expand Up @@ -87,11 +92,9 @@ protected void processFields(
throw new DASSdkApiException("error processing 'description'", e);
}

addToRow(
"due_date",
rowBuilder,
maybeFields.map(f -> f.get(names.get("Due date"))).orElse(null),
columns);
String due_date = maybeFields.flatMap(f -> Optional.ofNullable(f.get(names.get("Due date")))).map(Object::toString).orElse(null);

addToRow("due_date", rowBuilder, due_date, columns);

var priority =
maybeFields.map(f -> f.get(names.get("Priority"))).map(p -> (Map<String, Object>) p);
Expand All @@ -106,12 +109,20 @@ protected void processFields(
rowBuilder,
reporter.map(r -> r.get("accountId")).orElse(null),
columns);

addToRow(
"reporter_display_name",
rowBuilder,
reporter.map(r -> r.get("displayName")).orElse(null),
columns);

String resolved =
maybeFields
.flatMap(f -> Optional.ofNullable(f.get(names.get("Resolved"))))
.map(c -> DateTime.parse(c.toString()).withZone(DateTimeZone.UTC).toString())
.orElse(null);
addToRow("resolution_date", rowBuilder, resolved, columns);

addToRow(
"summary",
rowBuilder,
Expand Down
Loading

0 comments on commit 499b575

Please sign in to comment.