UI Action "Close SIR" is not saving time worked to time card

kdelbridge
Tera Expert

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.

6 REPLIES 6

Bert_c1
Kilo Patron

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.

 

Time Worked Bert_c1_0-1748895585714.png

 

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 (Bert_c1_1-1748895585714.png)

 

To resume the timer, click the start icon (Bert_c1_2-1748895585713.png).

 

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.

Note: Timer fields, such as Time Worked, do not display correctly in Service Portal. For more information and a workaround, see the Timer fields do not display the correct data in Service Portal [KB0752404] article in the Now Support Knowledge Base.

@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.

 

Ankur Bawiskar
Tera Patron
Tera Patron

@kdelbridge 

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.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

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

kdelbridge_1-1748878555570.png

 

Any ideas what the issue could be?