You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
```
var userClient = _account.CreateUserClient();
var ticketClient = _account.CreateTicketClient();
var user = await userClient.CreateUserAsync(new User
{
Login = dto.Username,
FirstName = dto.Username,
Active = true
});
_account.UseOnBehalfOf(user.Login);
var ticket = await ticketClient.CreateTicketAsync(
new Ticket
{
Title = dto.Title,
GroupId = 1,
CustomerId = user.Id,
OwnerId = user.Id,
OrganizationId = dto.OrganizationId
},
new TicketArticle
{
Subject = dto.Title,
Body = dto.Body
});
string path = null;
if (dto.Logo is {Length: > 0})
{
path = Path.GetFullPath(dto.Logo.FileName);
}
var article = await ticketClient.CreateTicketArticleAsync(new TicketArticle
{
TicketId = ticket.Id,
Body = dto.Body,
Subject = dto.Title,
Attachments = new List<TicketAttachment>
{
TicketAttachment.CreateFromFile(path, dto.Logo.ContentType),
new TicketAttachment()
{
Filename = path,
MimeType = dto.Logo.ContentType
}
}
});
And it always returns file not found, if I will not use TicketAttachment.CreateFromFile it will not return Unprocessible Entity.
File I want to upload simple png image
The text was updated successfully, but these errors were encountered:
My code looks like:
The text was updated successfully, but these errors were encountered: