You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

On this page

Use case

Update a number field with the difference in days between two dates obtained from two Date Picker fields.

Prerequisites

Set up the custom field

Create a Number custom field

Name: Time Difference

Add it to the screens of your choice.



Configuration

Add the post function Update fields to the transition of your choice.

Target issue*

Select current issue

Fields

Field*

Select Time Difference, the field previously created

Value*

Select Set field value manually (parser expression) and enter the following expression:

((new Date(issue?.customfield_10043  + "T00:00:00").getTime() - new Date(issue?.customfield_10040 + "T00:00:00").getTime())) / 1000 / 60 / 60 /24

Replace the field codes of the expression with the ones of your Date Picker fields.

With the current configuration, this expression will return the number of days between the first date and the second one. In order to display the number of hours, remove /24 from the expression.




If you still have questions, feel free to refer to our support team.