The CreatorCon Call for Content is officially open! Get started here.

Need to capture the time and date, when assigned to user is updated or added?

Feroz1
Tera Contributor

Hi Team, 

 

once the request is submitted and task is assigned to user. The below mentioned functionality should be implemented: 

 

  1. Created (OOB field - which is available in the instance)  – Which displays Date and time when the task is opened. 

  2. 1st Custom field( Assigned Date – create new field) – When the ticket is assigned to, we have to get the current updated date time and store it in custom field, If reassignment count is 0. ( Validation: If reassignment count is greater than ( > 0) then the custom field should not be updated.

  3. 2nd Custom field(Date Difference – create new field) – This will compare the created by field time duration with (1st custom field - Assigned Date) and will display the time duration in 2nd custom field.

Can any one help me on this task.

Thanks in advance.

1 ACCEPTED SOLUTION

Aman Kumar S
Kilo Patron

Hey,

1. Created field works OOB, no config required for that.

2 & 3. For Assigned date field, you can have a Update-Insert/Before BR in place, with condition:

   Assigned to - changes and Assigned to - is not empty and Reassignment Count - is - 0

   In script you can just write

   var currDate = new GlideDateTime();

   var created = new GlideDateTime(current.getValue("sys_created_on");

   current.assigned_date = new GlideDateTime();

   current.date_difference = new GlideDuration(GlideDateTime.subtract(created , currDate));

 

Note: make sure your 3rd field is a duration field type

   

 

 

Best Regards
Aman Kumar

View solution in original post

7 REPLIES 7

Hi @RK1111 

Yes, it will work in a flow as well, you just need to use the script option available for the field mappings.

Best Regards
Aman Kumar

Hi @Aman Kumar S , 

 

Thanks for replying.

I need to update below 2 fields through subflow.

RK1111_0-1687340664687.png

 

 

I used below script for "Acknowledged at", but it just gave me the current time. 

Actually, the alert is not acknowledged yet. It should give the time when alert is acknowledged.

 

 

@Aman Kumar S ,

 

Script Used:

 

RakshandaKunte_0-1687341060947.png