Dojo Script for Modified date
2 answers
The JavaScript attribute customization does not provide any means to perform automation on state change. It is not possible to detect a state change and to do something based on it. You can only get the current work item information e.g. the state or attribute data.
I know some users have used tricks storing timestamps e.g. the last modified time to be able to detect a state change had happened and do something with that information. I am not necessarily a fan of those approaches.
Please check https://rsjazz.wordpress.com/2016/07/15/rtc-process-customization-what-you-can-and-cannot-do/ which is a summary of what I learned and what my best practice have been die to that.
The JavaScript attribute customization only works when an item is edited.
If you want to see items that are not changed for a certain amount of time, use Queries.
You could use an asynchronous task to send email notifications based on the modified date. See https://rsjazz.wordpress.com/2015/10/16/due-date-notifier-an-asynchronous-task-example/ .