Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create event - resource attendees is ignored #2705

Open
rzechu opened this issue Oct 11, 2024 · 0 comments
Open

Create event - resource attendees is ignored #2705

rzechu opened this issue Oct 11, 2024 · 0 comments
Labels
type:bug A broken experience

Comments

@rzechu
Copy link

rzechu commented Oct 11, 2024

Describe the bug

I am using .NET SDK to create event with me as required + resource attendee
Command is send and completed sucessfully.
Event is created for me and resource but in scheduling assistand resource is missing

Apologize for polish language GUI, but images should be self explanatory

image

Resource is missing... (check Expected behavior)

outlook_invalid

Expected behavior

Resource should be visible in Scheduling Assistant
This is how looks like event created in outlook.
outlook_valid

How to reproduce

    public async Task<EventAddResultDto> EventAdd(EventAddDto eventAddDto, CancellationToken cancellationToken)
    {
        ArgumentNullException.ThrowIfNull(nameof(eventAddDto));
        ArgumentNullException.ThrowIfNull(nameof(eventAddDto.MlaUser));

        Event msGraphEvent = new()
        {
            Subject = eventAddDto.Subject,
            Body = new ItemBody
            {
                Content = eventAddDto.Body,
                ContentType = eventAddDto.IsHtmlBody ? BodyType.Html : BodyType.Text,
            },

            Start = new DateTimeTimeZone
            {
                DateTime = eventAddDto.StartUtcTime.ToString("o"),
                TimeZone = eventAddDto.StartUtcTime.ToDateTimeTimeZone().TimeZone,
            },
            End = new DateTimeTimeZone
            {
                DateTime = eventAddDto.EndUtcTime.ToString("o"),
                TimeZone = eventAddDto.EndUtcTime.ToDateTimeTimeZone().TimeZone,
            },
            Location = new Location
            {
                DisplayName = eventAddDto.Location,
            },
            Attendees = eventAddDto.Attendees.Select(s => new Attendee
            {
                EmailAddress = new EmailAddress { Address = s.EmailAddress },
                Type = s.Type.ToMsGraphType(),
            }).ToList()
        };

        _logger.Info("Adding event to MS Graph {SubjectText}={Subject}, {StartText}={Start} {EndText}={End}",
            nameof(msGraphEvent.Subject), msGraphEvent.Subject, nameof(msGraphEvent.Start), msGraphEvent.Start, nameof(msGraphEvent.End), msGraphEvent.End);
        _logger.Info("Adding event to MS Graph Attendees={Attendees}", msGraphEvent.Attendees);

        msGraphEvent.AllowNewTimeProposals = false;
        msGraphEvent.OnlineMeetingProvider = OnlineMeetingProviderType.TeamsForBusiness;
        msGraphEvent.IsOnlineMeeting = eventAddDto.IsOnlineMeeting;

        var eventResult = await _msClient.Users[eventAddDto.MlaUser].Events.PostAsync(msGraphEvent, null, cancellationToken);
        if (eventResult is null)
            throw new Exception("Event was not added");

        var eventAddResult = new EventAddResultDto()
        {
            Id = eventResult.Id,
            ICalUId = eventResult.ICalUId,
            WebLink = eventResult.WebLink,
        };

        return eventAddResult!;
    }

SDK Version

5.40.0

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output

Click to expand log ```
</details>


### Configuration

- Windows 11 x64

### Other information

_No response_
@rzechu rzechu added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Oct 11, 2024
@shemogumbe shemogumbe removed the status:waiting-for-triage An issue that is yet to be reviewed or assigned label Oct 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug A broken experience
Projects
None yet
Development

No branches or pull requests

2 participants