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

New-MgUserCalendarEvent creating duplicate entries #2960

Open
TWells94 opened this issue Sep 18, 2024 · 4 comments
Open

New-MgUserCalendarEvent creating duplicate entries #2960

TWells94 opened this issue Sep 18, 2024 · 4 comments
Labels
status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close type:bug A broken experience

Comments

@TWells94
Copy link

TWells94 commented Sep 18, 2024

Describe the bug

Duplicate entries are getting added for one reseult. The exemple params would be

$CalendarSubject = "New Event"
$StartDate = "yyyy-MM-ddT00:00:00"
$DayAfter= "yyyy-MM-ddT00:00:00"
$AllDay = $True

$params = @{
                Subject = $CalendarSubject
                Body = @{
                    ContentType = "HTML"
                    Content = "Synced from Rapport."
                }
                Start = @{
                    DateTime = $StartDate
                    TimeZone = "Pacific Standard Time"
                }
                End = @{
                    DateTime = $DayAfter
                    TimeZone = "Pacific Standard Time"
                }
                ShowAs = "oof"
                
                IsAllDay = $AllDay

            }

            
            # Create the event
       $Event = New-MgUserCalendarEvent -UserId $UserID -CalendarId $CalendarID -BodyParameter $params

The example screenshot below is from running this once. It seems to add multiple values for some and a single value for others.

I have checked through the results and none of them include duplicate values, i've also removed the "$Event =" and seen it appaears to only add one event but checking the calendar it adds 2.
image

I've ran it without making the command a variable and it is only showing

Expected behavior

To add one singular value based on the inputs given.

How to reproduce

I have attached a copy of my script but leaving out the inital call (However the example data is copied in the same format)

This is what seems to give 2 copies of the same event entry, at line 112 i even filter out any duplicates based on the start date.

Example_Calendar_Github.txt

SDK Version

2.23.0

Latest version known to work for scenario above?

No response

Known Workarounds

None

Debug output

Click to expand log ```
</details>


### Configuration

_No response_

### Other information

_No response_
@TWells94 TWells94 added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Sep 18, 2024
@timayabi2020
Copy link
Contributor

@TWells94 thank you for logging this issue. Please use Invoke-MgGraphRequest cmdlet and let us know if you are still having the same experience. Please use the sample request below. Maybe there is something causing a duplicate web request.

$params = @{
	subject = "Let's go for lunch"
	body = @{
		contentType = "HTML"
		content = "Does mid month work for you?"
	}
	start = @{
		dateTime = "2019-03-15T12:00:00"
		timeZone = "Pacific Standard Time"
	}
	end = @{
		dateTime = "2019-03-15T14:00:00"
		timeZone = "Pacific Standard Time"
	}
	location = @{
		displayName = "Harry's Bar"
	}
	attendees = @(
		@{
			emailAddress = @{
				address = "adelev@contoso.com"
				name = "Adele Vance"
			}
			type = "required"
		}
	)
	transactionId = "7E163156-7762-4BEB-A1C6-729EA81755A7"
}
Invoke-mggraphrequest -Uri 'https://graph.microsoft.com/v1.0/users/<UserId>/calendars/<CalendarId>/events' -Method POST -Body $Params -debug

@timayabi2020 timayabi2020 added status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close and removed status:waiting-for-triage An issue that is yet to be reviewed or assigned labels Sep 24, 2024
@TWells94
Copy link
Author

TWells94 commented Sep 24, 2024 via email

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: Attention 👋 and removed status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close labels Sep 24, 2024
@TWells94
Copy link
Author

TWells94 commented Sep 24, 2024 via email

@timayabi2020
Copy link
Contributor

timayabi2020 commented Sep 26, 2024

@TWells94 is it possible to switch to a different network environment and execute the request?

@timayabi2020 timayabi2020 added status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close and removed Needs: Attention 👋 labels Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close type:bug A broken experience
Projects
None yet
Development

No branches or pull requests

2 participants