Genesys Cloud - Main

 View Only

Discussion Thread View
  • 1.  Data Action for checking the Schedules current occurence date

    Posted 06-12-2019 23:47
    ​Hi all,

    Hoping someone out there has an answer to this perplexing question.

    I'm building a fairly complex set of schedules for my customer in PureCloud. I'm using a data action to interrogate the schedules, and provide me with the one that is currently active.  The call flow then follows a pre-defined path based on the out come of that data action.

    The Data Action I am using checks the Schedules start and end times and compares them to the current time, which I have in a 3rd variable, when there is a match (ie: True) the call follows that path.

    I've discovered that the "Start Time" that the Data Action gets is the date and time that the schedule first began, not the current occurence,,,,,, so my query worked on that first day.... but after that, the query fails as the data action continues to provide the original start date....eg 06/06/2019 rather than 13/06/2019

    I'm stumped as to how I can find an action that provides me with the start date for the Current occurrence of the schedule rather than the original occurrence.... does anyone know if such a value exists?

    I've built a fairly successful schedule that actually works, except for this one thing which I need answered fairly quickly....

    thanks for any assistance

    #ArchitectureandDesign

    ------------------------------
    Glenn C Fairhall
    Telstra Corporation Ltd
    ------------------------------


  • 2.  RE: Data Action for checking the Schedules current occurence date

    GENESYS
    Posted 06-14-2019 09:50

    If you just run the GET /api/v2/architect/schedules you get the list of schedules, but it doesn't give you enough information:

        {
          "id": "bc987c92-8eec-46af-aabd-1f783460d60e",
          "name": "AdvSalesOpen",
          "state": "active",
          "start": "2019-06-14T06:00:00.000",
          "end": "2019-06-14T22:00:00.000",
          "rrule": "FREQ=WEEKLY;UNTIL=20190630T235959Z;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR",
          "keywords": [],
          "selfUri": "/api/v2/architect/schedules/bc987c92-8eec-46af-aabd-1f783460d60e"
        }

    From that return, you then need to use /api/v2/architect/schedules/{scheduleid} to get each individual schedule.

    You can't use just the start and end dates to compare. Rather, you have to look at the time specified on the start/end date-time, and look at the rrule setting for the frequency to see what days it applies.

    For example, when I query based on the SceduleID I get:

    {
      "id": "bc987c92-8eec-46af-aabd-1f783460d60e",
      "name": "AdvSalesOpen",
      "state": "active",
      "start": "2019-06-14T06:00:00.000",
      "end": "2019-06-14T22:00:00.000",
      "rrule": "FREQ=WEEKLY;UNTIL=20190630T235959Z;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR",
      "keywords": [],
      "selfUri": "/api/v2/architect/schedules/bc987c92-8eec-46af-aabd-1f783460d60e"
    }


    Start is the date I specified for the schedule to start. End seems to be a bit arbitrary, so the UNTIL in the rrule has to be used to figure out when it actually ends.

    In the rrule I can see that it is set for Weekly, to run on weekdays.

    Also in the rrule, I can see that it ends on June 30, 2019.




    ------------------------------
    George Ganahl CCXP, GCP
    Principal Technology Consultant
    Genesys
    ------------------------------



Need Help finding something?

Check out the Genesys Knowledge Network - your all-in-one access point for Genesys resources