UI Action "Close SIR" is not saving time worked to time card
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2025 06:59 AM - edited 05-29-2025 12:02 PM
I am investigating an issue that involves an issue when an SIR Analyst uses our "Close SIR" UI action button to close a Security Incident, the time worked is not saving to the time card.
This is my first go at researching this type of issue.
Any ideas where to get started or what the issue might be?
This is a custom UI action that we created. It is not OOB.
User should be able to click this button to close the Security Incident record and any time worked should save after they input resolution info.
(Ie: if they started working response, if time worked was 2:42 and they started the timer. Completed worked and when click on "Close SIR" if time worked has now clicked off to 7:42 upon completing resolution steps, once record saves, time worked should be 7:42 and no longer 2:42.
Currently, the time worked is not capturing that last 5 minutes and still shows 2:42 afterwards.
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2025 09:18 AM
I believe it's because you might be updating the value via UI page and the form field still shows the earlier value.
what you will have to do is, pass the time worked field from form to UI page and then use that value to update
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
06-03-2025 03:07 PM
Hello @Ankur Bawiskar,
Thanks for your reply.
I have modified the script 2 times and each version will save the time worked and any other changes on the record that might exist, but in both cases, when the modal does finally open, it does not stay open long enough to complete the closure information so that info can be submitted and saved.
1st script.
2nd script
Thoughts on how to still save time worked and any other information that needs saving and keeping that modal open long enough?