OfficeDev / office-js

A repo and NPM package for Office.js, corresponding to a copy of what gets published to the official "evergreen" Office.js CDN, at https://appsforoffice.microsoft.com/lib/1/hosted/office.js.
https://learn.microsoft.com/javascript/api/overview
Other
674 stars 95 forks source link

Outlook: When editing a single event within a Recurrence, Office.context.mailbox.item.itemId returns an id for the 'seriesMaster' instead of the single 'Occurrence' according to the Outlook REST API #714

Closed mrbfrank closed 3 years ago

mrbfrank commented 5 years ago

Expected Behavior

When editing a single appointment occurrence that is part of a series, the expected behavior is that Office.context.mailbox.item.itemId should return the ID for that individual Occurrence.

Current Behavior

Using Office.context.mailbox.item.itemId to query the Outlook REST API returns the parent seriesMaster object instead of the Occurrence.

Steps to Reproduce, or Live Example

Context

I realize I can filter Occurrences by start/end times in the Outlook REST API, however for my use case I am specifically trying to retrieve those unknown values. Those values are not reliably retrieved in OfficeJS because a user can change the start/end times of an Occurrence in the Outlook compose UI before opening the Add-in, and therefore any reference to the previously booked time is lost. I specifically need to query the Outlook REST API for the originally booked time of an Occurrence, via the Occurrence ID.

Your Environment

sumurthy commented 5 years ago

@exextoc

exextoc commented 5 years ago

Thanks for reporting this issue. We are able to reproduce it. We will proceed to investigate and update this thread.

WBendrot commented 5 years ago

+1

michaelrway commented 5 years ago

+1

mrbfrank commented 5 years ago

bitmoji

mrbfrank commented 4 years ago

Hello @exextoc can you say why this was closed? Was this bug fixed & released? Thanks.

AnjanaValsan commented 4 years ago

This is not fixed at the moment. In Outlook for Mac, the item id is the same as the series id for all instances. Only if an occurrence is a deviation we expose the item Id. (explanation below) Recurrence with deviation When one item in a series is scheduled for a different time, it is called a deviation or exception. (the highlighted one below) image Recurrence without deviation image All instances are scheduled to happen in the same slot. Hence this is an example of a series with no deviation.

@mrbfrank can you explain the use case you are trying to solve using the item id of a occurrence? This will help us prioritise this issue at our end.

mrbfrank commented 4 years ago

@AnjanaValsan Hi yes I am working with a 3rd party scheduling service that I wish to synchronize with Outlook appointments. My Add-in must have the original start and end time of each meeting in order to find & update the calendar events in that 3rd party service. I know I can use Office.context.mailbox.item.start.getAsync() to retrieve the start time from the Outlook appointment editor UI, however if the user changes the start & end times before my Add-in is opened I cannot get the originally booked start or end time. Therefore, I am attempting to query the saved start & end time of the occurrence by looking it up via Office.context.mailbox.item.itemId in the Outlook REST API. Then with this info, my Add-in can detect that the meeting time is in a changed state & prompt the user to click an "Update" button to send this 3rd party scheduling service the original time (to identify the event) & the new time (to update the event).

mrbfrank commented 4 years ago

@AnjanaValsan I have a followup question to try and work around the issue. Hypothetically if I setup my own service & subscribe to Outlook calendar change events in the Microsoft Graph API (in an enterprise environment with thousands of users), is there any way to detect a received event is a recurrence deviation & know the previous scheduled time of that appointment? Thanks.

sergez commented 4 years ago

Hi, The issue is still reproduced for me on:

Platform [PC desktop, Mac, iOS, Office Online]: Mac Host [Excel, Word, PowerPoint, etc.]: Outlook Office version number: Outlook for Mac v16.37 (20051002) Operating System: MacOS High Sierra v10.13.6

Also it reproduced when call saveAsync() on mailboxItem - Office.context.mailbox.item.saveAsync(console.log);

exextoc commented 4 years ago

Hi, this is a known issue and is in our backlog. We will update this thread once it is fixed, but do not have timelines to share at this point.

exextoc commented 4 years ago

This issue has been fixed. You can update to the latest Insider Fast build (16.41 (20072700) and above) to see it!

MennoAret commented 4 years ago

I had the same issue that the itemId is returning the seriesMaster ID instead of the single occurrence event ID. I upgraded to version 16.41 (20081200) but the itemId is still from the series instead of the occurrence. @exextoc Do you know more about this? Was the fix rolled back?

exextoc commented 4 years ago

Reopening this GitHub issue.

exextoc commented 4 years ago

Our engineers have personally checked it with the with build number 16.41 (20081204) and it seems to be perfectly working. Are you still facing this issue? Can you please confirm how you are checking the build number?

MennoAret commented 4 years ago

@exextoc Thanks for your response. This is my version now, version 16.41 (20081701), noted from the "About Outlook": image I assume that this is a newer Outlook version than 16.41 (20072700), or not?

I still have the issue that for the occurrence meeting the itemId is returning the ID of the series.

This is how I get the itemId in our add-in:

var itemId = Office.context.mailbox.item.itemId;
if (itemId === null || itemId == undefined) {
    Office.context.mailbox.item.saveAsync(function (result) {
        itemId = result.value;
    });
}

If this is incorrect please let me know.

exextoc commented 4 years ago

@MennoAret Thanks for reporting this issue. The saveAsync() method still appears to be returning the series master ID. We will fix this issue.

However, if you are using this on an existing meeting for which you're the organizer, you should be using the item.getItemIdAsync() API - you shouldn't need to do saveAsync. Office.context.item.itemId will be null for organizer mode.

lindalu-MSFT commented 3 years ago

@exextoc Is this still in the backlog or has it been fixed? Is there an internal bug number for tracking? Thanks, linda

exextoc commented 3 years ago

Hey @lindalu-MSFT , This issue has been verified as fixed and the fix should be completely rolled out. @MennoAret , Can you confirm that you see the issue fixed on the latest version of Outlook for Mac?

ghost commented 3 years ago

This issue has been automatically marked as stale because it is marked as needing author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. Thank you for your interest in Office Add-ins!

ghost commented 3 years ago

This issue has been closed due to inactivity. Please comment if you still need assistance and we'll re-open the issue.