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
05-29-2025 07:03 AM - edited 06-02-2025 01:21 PM
I suggest you post the definition of your UI Action, then you may get some useful suggestions.
See Time worked fields here:
concept/c_TimingFunctionality.html
Time worked fields
The Task [task] table provides a time-tracking field called Time worked. This field measures how long a record has been viewed in order to measure work time on a ticket.
Any table that extends Task can use this field. To add the field, Personalize a form.
As the record is viewed, the timer counts upward. To pause the timer, click the stop icon ()
To resume the timer, click the start icon ().
When the task is saved, the amount of new time in the timer is used to generate a record on the Time Worked [task_time_worked] table. This table can be viewed as a related list on the task form.
By default, the time displayed in the Time worked field displays a cumulative value stored in the task record. If you modify a Time Worked record, the changes will not be reflected in the task timer.
You can set the property com.snc.time_worked.update_task_timer to enable updating of the task timer value based on changes to the time worked records. This is accomplished through the Update task timer business rule.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2025 03:10 PM
@Bert_c1 , Thanks for your reply.
I do understand how the time worked fields work. the issue we are having here is when a user uses the Close SIR UI action, that opens up a modal to complete closure information, any information on the record that needs to be saved that has changed, including accumulated time worked is not saving. In my responses to Ankur below, you'll see that I am able to now get time worked, etc to save, but the modal is not staying visible long enough to complete action needed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2025 07:04 AM
is that an OOTB ui action or a custom one?
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-02-2025 08:36 AM
Hello @Ankur Bawiskar , this is a Custom UI Action for our Security Incidents.
Here is the current script for this UI Action called "Close SIR". The modal will open when clicking on "Close SIR", analyst completes entering resolution notes and "submits". The resolution notes and state will update, but any time worked that has accumulated does not save. Example: if 1:42 was showing as time worked when started timer.....worked on record....by the time they 'submitted" after completing the "close SIR" UI action, the time that has passed (assuming at 5:42 now) does not save.
Here is the script below
Any ideas what the issue could be?