I have an Auction model with several attributes, two of which are current_auction:boolean and scheduled_start:datetime. How can I make the boolean (false by default) become true when the scheduled_start becomes the current time? Please tell me if you need more information. I’m assuming that I will need to use script/runner, but have no experience with it.
I have an Auction model with several attributes, two of which are current_auction:boolean and
Share
I wouldn’t store the current_auction as a property. Current_auction is rather a state that depends on the scheduled_start time vs. the current time. Don’t put it in the database, but rather add it as a method on your model that compares the scheduled_start with the current time and returns true/false based on the calculation.
If you need to select based on whether it is current or not, use selection logic that depends on the scheduled_start time rather than current/not current.