Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

iCal rest API -- limit Date range?

Justin A
Contributor
January 16, 2024

Can I either specify a date range using the Team Calendars API when fetching iCal/.ics files, or limit the calendars date range from within Team Calendars' UI?

I built a booking/reservation system using Jira issues as "events", with two custom field for the specific assets being booked (multi select, two types of assets)... Think conference rooms, or vehicles from a motor-pool, etc. Each event has a Start-date/time and End date/time. Each asset has it's own calendar, and in Confluence I have a common calendar that shows all the reservations.

I also have an external website with the FullCalendar JavaScript library, and I fetch iCal files (.ics) from Team-Calendars using the Rest API, one for each calendar, and populate FullCalendar.

Now, this system has been in place for five years, and the number of total events is quite large. For every page load of the external website I fetch nine .ics, each between 500KB and 2MB. I am working on caching these, but then new reservations won't show up until the cache expires.

How can I limit the iCal data in the .ics files to only the current year, or past 180day, etc?

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
David Berclaz _Apwide_
Community Champion
March 30, 2025

Hi Justin,

I don’t have a perfect solution for this issue - it seems that filtering ICS feeds from Team Calendars by date isn’t supported... That said, I’ve worked on booking systems for quite some time (also using Jira issues as events), and I’d be really interested to learn more about how your setup works.

Would that make sense to set up a lightweight proxy server that fetches the .ics files from Confluence, filters out old events (e.g. using ical.js or another parser), and returns a smaller .ics to FullCalendar?

Or if you already have your bookings in Jira, why not using an app to display them in Jira or Confluence? Do you have viewers who don't have access to your Atlassian tools?

Otherwise, you could use Jira Automation: for each new booking, you could trigger an update to a custom .ics feed you generate yourself - might be overkill but ensures freshness without re-fetching everything.

I hope you'll find a good option.

++

David

TAGS
AUG Leaders

Atlassian Community Events