How can I access a demand's history via a script (Background script, fix script, or schedule script)

AdrianS
Tera Contributor

Hello and thank you for any help!

 

I have a demand with a custom field called completed date. The completed date is a date field that is updated once a demand is completed/converted to a project.

 

There was an issue in the condition with the BR that updates this field, that allowed this completed date to update on every update made to a completed demand. So now I have a bunch of demands where the completed date is inaccurate.

 

Is there any way to update the completed date for all demands to the date for when the state of demand was most recently changed to completed?

 

Any help is useful! 

1 ACCEPTED SOLUTION

Kieran Anson
Kilo Patron

ServiceNow offer the history walker API. As long as your table and fields are audited, you can work backwards on each record to identify where the state changed, and then use the value of your custom field as part of it 

View solution in original post

2 REPLIES 2

Kieran Anson
Kilo Patron

ServiceNow offer the history walker API. As long as your table and fields are audited, you can work backwards on each record to identify where the state changed, and then use the value of your custom field as part of it 

Thank you Kieran.

 

With the history walker API, I was able to solve my issue.