public void CanBulkUpdateTickets()
{
var t1 = api.Tickets.CreateTicket(new Ticket()
{
Subject = "testing bulk update",
Comment = new Comment() { Body = "HELP" },
Priority = TicketPriorities.Normal
}).Ticket;
var t2 = api.Tickets.CreateTicket(new Ticket()
{
Subject = "more testing for bulk update",
Comment = new Comment() { Body = "Bulk UpdateTicket testing" },
Priority = TicketPriorities.Normal
}).Ticket;
var res = api.Tickets.BulkUpdate(new List<long>() { t1.Id.Value, t2.Id.Value }, new BulkUpdate()
{
Status = TicketStatus.Solved,
Comment = new Comment() { Public = true, Body = "check your email" },
CollaboratorEmails = new List<string>() { Settings.ColloboratorEmail },
AssigneeId = Settings.UserId
});
Assert.AreEqual(res.JobStatus.Status, "queued");
//also test JobStatuses while we have a job here
var job = api.JobStatuses.GetJobStatus(res.JobStatus.Id);
Assert.AreEqual(job.JobStatus.Id, res.JobStatus.Id);
Assert.True(api.Tickets.DeleteMultiple(new List<long>() { t1.Id.Value, t2.Id.Value }));
}