...
Both can be done with the Calculate Days Elapsed for Traffic Light Post Function which initialises the information required for tracking the day elapsed.
Adding the Post Function
For the basics on setting up a workflow, please refer to JIRA's documentation on configuring workflows
...