Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Calculate custom field date values

Vishal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 25, 2022

Hi Guys,

I have two date fields StartDate & EndDate & one text field called Days, I would like to calculate the number of days by subtracting StartDate from EndDate & would like to set that as value of Days field on create screen itself.

I would need Days = EndDate - StartDate

I am trying to do it using scriptrunner, can someone suggest how can I achieve that ?

Thanks

1 answer

2 votes
Pramodh M
Community Champion
January 25, 2022

Hi @Vishal 

Here's a sample code you could try with

https://library.adaptavist.com/entity/calculate-the-difference-between-two-dates

Thanks,
Pramodh

Suggest an answer

Log in or Sign up to answer