Trigger - Move expired single calendar event


(Shane) #1

Hi,

 

New to Squiz, struggling to find practical examples, currently trying to create a trigger that will move a single calendar event asset into an event archive area. (Currently Squiz 5.0 but upgrading next week to 5.2 or 5.3)

 

- Currently have an Exhibitions folder that has current single calendar events

- Have a Past Exhibitions folder to move exhibitions that have finished into.

 

Currently just manually move events once the end date has passed from Exhibitions folder to the Past Exhibitions folder.

 

I have been trying to create a trigger but have not been able to successfully get it working, so generally require:

 

-When single calendar event in the Exhibitions folder reaches the end date

- Move that event to the Past Exhibitions folder.

 

Thanks

DM

 


(Bart Banda) #2

Hi DM,

Unfortunately there is no trigger event to let you do that yet. You could potentially use a trigger that sets a metadata date field that is the end date of the calendar event and use the metadata expired trigger condition to trigger the move, however I haven't tried this myself so not sure if it works.

 

It has come up a few times in the past so I've asked the developers to review this as a new feature to see if it's something that can be added into a future release. https://squizmap.squiz.net/matrix/3484


(Mitchell Essex) #3

Hi DM,

 

This might work for you. We use a couple of triggers one to archive the event, and the second one to move any archived events off to an archived events folder. You could adjust these to suit. 

 

First trigger - Event when Asset created > Condition Asset is of Single calendar event > Action > Set future status to archived > Determined by start_date (you can use end_date if all events have an end date) we then offset this by a day to be after the event for us (you can do it on the end date). We have another trigger that runs when the Event is altered in case a user needs to change the date which deletes the future status of archived and does the same thing (resets its future status) based on the new date.

 

Second trigger - Condition > Asset is of type Single calendar event, Asset Status Asset has status of archived > Action link as child of our archived events folder (you could use Past Exhibitions folder) and Unlink this asset from all its existing parents. You could use the trigger to set the event status back to live when it moves to your Past Exhibitions folder.

 

Mitch