today state value changes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2023 04:09 AM
Usecase: I need a today state values change to new to InProgress incident records through script .
Could you please help any one
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2023 04:11 AM
your question is not clear.
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-16-2023 04:36 AM
Hello @vinod6 ,
Could you please provide additional details or screenshots related to your requirement? This would allow us to offer more precise assistance in resolving your query.
Thank You,
Aniket

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2023 11:03 AM
@vinod6 The following script should give you the list of those incidents whose state changed from New to In Progress today.
var list = new GlideRecord('sys_history_line');
list.addEncodedQuery('update_timeONToday@javascript:gs.beginningOfToday()@javascript:gs.endOfToday()^old_value=1^new_valueSTARTSWITH2^field=state^set.table=incident');
list.query();
var incidentArray = [];
while (list.next()){
incidentArray.push(list.getDisplayValue('set'));
}
gs.info(incidentArray);
Hope this helps.