Skip to content

Commit

Permalink
adding is_public to the Ticket class (#285)
Browse files Browse the repository at this point in the history
  • Loading branch information
mozts2005 authored Jun 25, 2017
1 parent 294fd25 commit 2cbe830
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/Tests/TicketTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1326,5 +1326,28 @@ public async Task CanCreateUpdateOptionsAndDeleteTaggerTicketFieldAsync()

Assert.True(await api.Tickets.DeleteTicketFieldAsync(id));
}

[Test]
public async Task CanGetIsPublicAsync()
{

var ticket = new Ticket()
{
Subject = "my printer is on fire",
Comment = new Comment { Body= "HELP", Public = true },
Priority = TicketPriorities.Urgent
};

var resp1 = await api.Tickets.CreateTicketAsync(ticket);
Assert.That(resp1.Ticket.IsPublic, Is.True);

ticket.Comment.Public = false;
var resp2 = await api.Tickets.CreateTicketAsync(ticket);

Assert.That(resp2.Ticket.IsPublic, Is.False);

Assert.That(await api.Tickets.DeleteAsync(resp1.Ticket.Id.Value), Is.True);
Assert.That(await api.Tickets.DeleteAsync(resp2.Ticket.Id.Value), Is.True);
}
}
}
6 changes: 6 additions & 0 deletions src/ZendeskApi_v2/Models/Tickets/Ticket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,11 @@ public class Ticket : BaseTicket
[JsonProperty("ticket_form_id")]
public long? TicketFormId { get; set; }

/// <summary>
/// Is true if any comments are public, false otherwise
/// </summary>
[JsonProperty("is_public")]
public bool IsPublic { get; private set; }

}
}

0 comments on commit 2cbe830

Please sign in to comment.