- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2024 09:23 PM
Scenario: In a table like 'Incident', if their state changes from New to In Progress then i need to print the time in millisecond that in how much time their state changes from New to In Progress.
Note: There may be multiple incident record to check.
How to achieve this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2024 10:25 PM
The field 'created_at' stores the date and time when the record was created. However, it only stores information at the second level, and milliseconds are not stored.
※All datetime fields work in this manner.
Therefore, you need to create a custom field to store the milliseconds when a record is created (state = new). Afterward, create a business rule (BR) to capture the state change and calculate the duration from [New] to [in Progress].
Finally, you can store the result in another custom field or simply print it to logs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2024 09:41 PM
it's not really clear why you need this. I just can tell you that there is already a metrics definition available in your instance (URL: /nav_to.do?uri=metric_definition.do?sys_id=35f2b283c0a808ae000b7132cd0a4f55) which captures the duration between two state changes. So no need to calculate anything. Just use the corresponding metrics instance records.
Maik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2024 10:25 PM
The field 'created_at' stores the date and time when the record was created. However, it only stores information at the second level, and milliseconds are not stored.
※All datetime fields work in this manner.
Therefore, you need to create a custom field to store the milliseconds when a record is created (state = new). Afterward, create a business rule (BR) to capture the state change and calculate the duration from [New] to [in Progress].
Finally, you can store the result in another custom field or simply print it to logs