• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

DataBiosphere / consent / #5585

14 Mar 2025 03:43PM UTC coverage: 75.384% (-3.9%) from 79.278%
#5585

push

web-flow
[DT-1315]Incorrect ticket_form_id being recorded in zendesk (#2466)

Co-authored-by: rjohanek <rjohanek@broadinstitute.org>

3 of 5 new or added lines in 1 file covered. (60.0%)

6235 of 8271 relevant lines covered (75.38%)

1.24 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

75.0
/src/main/java/org/broadinstitute/consent/http/models/support/DuosTicket.java
1
package org.broadinstitute.consent.http.models.support;
2

3
import com.fasterxml.jackson.annotation.JsonInclude.Include;
4
import com.fasterxml.jackson.core.JsonProcessingException;
5
import com.fasterxml.jackson.databind.ObjectMapper;
6
import org.zendesk.client.v2.model.Ticket;
7

8
/**
9
 * Wrapper around org.zendesk.client.v2.model.Ticket to do the following:
10
 * <ul>
11
 *   <li>Provide a top level field "request" that represents the native Request model which is
12
 *   required for Zendesk API usage. See
13
 *   <a href="https://developer.zendesk.com/api-reference/ticketing/tickets/ticket-requests/">Requests</a></a>
14
 *   for more information.</li>
15
 *   <li>It is required that we provide a `ticketFormId` which is not available on the `Request`
16
 *   class, but is only on the `Ticket` class.</li>
17
 *   <li>Ignore the Ticket.hasIncidents field on serialization</li>
18
 * </ul>
19
 */
20
public class DuosTicket {
21

22
  public final Ticket request;
23

24
  public DuosTicket(Ticket request) {
1✔
25
    this.request = request;
1✔
26
  }
1✔
27

28
  public String toString() {
29
    // we must use Jackson here instead of Gson because the zendesk Ticket class uses
30
    // JsonProperty annotations that are not compatible with Gson
31
    ObjectMapper mapper = new ObjectMapper();
1✔
32
    mapper.setSerializationInclusion(Include.NON_NULL);
1✔
33
    try {
34
      return mapper.writeValueAsString(this);
1✔
NEW
35
    } catch (JsonProcessingException e) {
×
NEW
36
      throw new RuntimeException(e);
×
37
    }
38
  }
39

40
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc