- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-31-2024 02:17 AM
Hi
How can I fetch the exact time and date of when the state is updated as Fix in progress. We do have updated time which fetches date and time of update in sys_history_line table. But I am not sure how to implement the above said condition and take that particular value.
TIA
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-01-2025 01:21 AM
Thank you for marking my response as helpful.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-31-2024 02:25 AM
it's stored in sys_history_line and sys_history_set
to get the exact time use this filter
Also the Update time it shows on form/list is as per logged in user's timezone
If you open that record and see the value it will always be in GMT
Label - State
Old - Root cause analysis
New - Fix in progress
Use the Update time
So the value you see in activity filter is as per logged in user's timezone
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-31-2024 02:27 AM
something like this in background script
var probRec = new GlideRecord('problem');
probRec.addQuery('sys_id','recordSysId'); // give correct sysId here
probRec.query();
if(probRec.next()){
var history = new GlideRecord('sys_history_set');
history.addQuery('id',probRec.getValue('sys_id'));
history.query();
history.next();
var auditH = new GlideRecord('sys_history_line');
auditH.addQuery('set',history.getValue('sys_id'));
auditH.addEncodedQuery("field=state^newISFix in Progress^oldISRoot Cause Analysis");
auditH.query();
if(auditH.next()){
gs.info('Update time is' + auditH.getValue('update_time'));
}
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-31-2024 09:14 PM
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-01-2025 01:20 AM
Yes @Ankur Bawiskar The code you have given me above does give me a clarity. Thanks! Happy learning.