Unable to use recurrence pattern type as relative yearly & relative monthly while creating and updating ToDo Task.

Sonal Mehta 21 Reputation points
2020-12-16T08:17:26.773+00:00

When we create ToDo with recurrence pattern using Rest API (as given https://learn.microsoft.com/en-us/graph/api/resources/recurrencepattern?view=graph-rest-1.0), it doesn't take the provided values. This happen in case of recurrence pattern type: relativeYearly & relativeMonthly. Also for rest case, where dayOfMonth is required & provided then API does create the ToDo with default value i.e. 30 rather than requested value.

Sending recurrence object as
recurrence: {
pattern: {
type: 'relativeYearly',
interval: 2,
month: 12,
dayOfMonth: 4
}
}
It creates the ToDo with pattern type as "daily". It seems setting are not applied yet for the API.
Using V1.0 version here. Please guide.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,522 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Deva-MSFT 2,256 Reputation points Microsoft Employee
    2021-01-17T19:22:32.017+00:00

    Interesting. Please share the payload so that i can give a try on this.

    0 comments No comments

  2. Alistair Phillips 1 Reputation point
    2021-06-14T02:38:07.517+00:00

    Hi,

    I seem to be experiencing the same issue in that a relativeMonthly recurrence pattern is saved as daily.

    If I POST the following to https://graph.microsoft.com/v1.0/me/todo/lists/#list_id#/tasks

    {  
        "title": "Remind me on the second Sunday of every month",  
        "recurrence": {  
            "pattern": {  
                "type": "relativeMonthly",  
                "interval": 1,  
                "daysOfWeek": ["sunday"],  
                "index": "second"             
            },  
            "range": {  
                "type": "noEnd"  
            }  
        },  
        "dueDateTime": {  
            "dateTime": "2021-07-11T09:00:00.0000000",  
            "timeZone": "Australia/Sydney"          
        },  
        "reminderDateTime": {  
            "dateTime": "2021-07-11T09:00:00.0000000",  
            "timeZone": "Australia/Sydney"          
        },  
        "isReminderOn": true  
    }  
    

    a reminder is created with the following recurrence pattern:

        "recurrence": {  
            "pattern": {  
                "type": "daily",  
                "interval": 1,  
                "month": 0,  
                "dayOfMonth": 0,  
                "daysOfWeek": [],  
                "firstDayOfWeek": "sunday",  
                "index": "first"  
            },  
            "range": {  
                "type": "noEnd",  
                "startDate": "2021-07-11",  
                "endDate": "0001-01-01",  
                "recurrenceTimeZone": "Australia/Sydney",  
                "numberOfOccurrences": 0  
            }  
        }  
    

    According to https://learn.microsoft.com/en-us/graph/outlook-schedule-recurring-events and https://learn.microsoft.com/en-us/graph/api/resources/recurrencerange?view=graph-rest-1.0 this should work.

    Any ideas?

    Thanks,
    Alistair


  3. Brian Kendrick 0 Reputation points
    2023-06-20T02:11:44.99+00:00

    I am seeing the same issue with Powershell for WEEKLY occurrence

    Object Being Loaded :

    Recurance                      FREQ=WEEKLY;INTERVAL=1;BYDAY=SU
    DueDateTimeTimeZone                                            
    Assignee                       Brian Kendrick                  
    ListName                       Household chores                      
    Name                           Blow porches, driveway, and side deck
    ListID                         taskList/8929837_12084023
    CreationDate                   2023-05-28T10:51:44.000Z
    Catagory                       Regular Maintenance
    DueDate                        2023-05-28T13:00:00.000Z
    

    Body Parameters

    Categories                     {Regular Maintenance}                                                                              
    Title                          Blow porches, driveway, and side deck                                                              
    CreatedDateTime                2023-05-28T10:51:44.000Z                                                                           
    Recurrence                     {firstDayOfWeek, interval, type, daysOfWeek}                                                       
    DueDateTime                    2023-05-28T13:00:00.000Z 
    

    Recurrence Pattern

    firstDayOfWeek                 sunday                                                                                             
    interval                       1                                                                                                  
    type                           WEEKLY                                                                                             
    daysOfWeek                     ["sunday"]                                                                                         
    

    Error Response

    New-MgUserTodoListTask : The property 'firstDayOfWeek' does not exist on type 'Microsoft.Graph.PatternedRecurrence'. Make sure to  only use property names that are defined by the type.
    ...
     + CategoryInfo          : InvalidOperation: ({ UserId = c2d6...GraphTodoTask }:<>f__AnonymousType71`3) [New-MgUserTodoListTas     k_Create1], RestException`1     + FullyQualifiedErrorId : invalidRequest,Microsoft.Graph.PowerShell.Cmdlets.NewMgUserTodoListTask_Create1