Post

2 followers Follow
0
Avatar

what link object ties CalendarExceptions to Users?

I need to pull (via the REST API) all calendar exceptions out of the system, but when I do I can't see which user is linked to which calendar exception... there's no owner or user field.  So there must be a link object that ties a calendar exception to a user

Lance Luvaul Answered

Official comment

Avatar

Hi Lance,

Sorry for the late response.

Use the "query" API action and create a request like this:

{ 'q':'select Name,EventCalendar FROM CalendarException' }

The "EventCalendar" will show you the User/Organization/Project which is related to the calendar exception.

This is an example of the query response:

{
"entities": [
{
"id": "/CalendarException/1af9893e-6df2-4fcf-905b-33257724b1cd",
"Name": "Company vacation",
"EventCalendar": {
"id": "/Organization/5237vi7an4xa5m7dek3zwomzj1905"
}
},
{
"id": "/CalendarException/1pt7bacfkwkpmwf2u15xeqp1n2",
"Name": "Reserve",
"EventCalendar": {
"id": "/User/5237vi7an4xa5m7dek3zwomzj1926"
}
},
{
"id": "/CalendarException/3f3gt7hpikk3jmyty1p8agzzj0",
"Name": "Project exception",
"EventCalendar": {
"id": "/Project/5tvxdlpe1vrykb0ek0rfgpjmw1"
}
}
],
"paging": {
"from": 7,
"limit": 100,
"hasMore": false
}
}

 

I hope this helps,

Elad

Elad Franklin
Comment actions Permalink

Please sign in to leave a comment.

5 comments

0
Avatar

Thanks Elad.  Is this in effect now?  I ask because I notice the latest product update notification (sent yesterday) indicates EventCalendar will only be available July 1st as part of the Summer 2018, Update 2 release.

Lance Luvaul 0 votes
Comment actions Permalink
0
Avatar

Hi Elad, I now have an issue creating the correct StartDate & EndDate timestamps for the CalendarExceptions that I create via the API (see my solution using just 2 workflow rules at https://success.clarizen.com/hc/en-us/community/posts/360006413234-REST-v2-API-can-t-create-exception-on-a-specific-user-s-calendar).

When I specify '2018-08-01' (for example) as the StartDate, I get a CalendarException that starts on the day prior, or '2018-07-31', as seen on the users calendar. I'm on the east coast of Australia so I suspect some problem with timezones is to blame. But I've tried correcting for the TZ difference by specifying both '2018-07-31T14:00:00' and '2018-08-01T10:00:00' but neither makes a CalendarException that starts on the right date.

What am I doing wrong?

Lance Luvaul 0 votes
Comment actions Permalink
0
Avatar

Never mind Elad: I stopped using my "2 workflow rule hack" and instead used the new ability to directly create CalendarExceptions via the API and it worked fine

Lance Luvaul 0 votes
Comment actions Permalink