How to get difference of two custom fields in JIRA

Alok kumar Singh February 24, 2013

I have created two custom fields, both are containing date. How can I get the difference of both the fields in a single field.

5 answers

1 accepted

0 votes
Answer accepted
Dan Flint
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.
February 25, 2013

I wanted to do this and found a solution that worked for me - see https://answers.atlassian.com/questions/101411/calculate-days-between-dates

Alok kumar Singh February 26, 2013

Hi Daflint, the plugin will definitely help, but when I am using getTimeSpent(key, currentUser()) it shows 0 for every issue.

Dan Flint
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.
February 26, 2013

Have you record time spent against the issues in question?

Alok kumar Singh February 26, 2013

I din't get, "Have you record time spent against the issues in question?". Do you mean to say I should specify let's say spent = "4d"

Dan Flint
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.
February 26, 2013

I believe that does need to be completed as part of the issue for that field to return a value

0 votes
Alok kumar Singh February 26, 2013

Sorry for typo..."it's track the transition"

0 votes
Natalie Hobson
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.
February 25, 2013

Not sure what "trank the transition" means, but the field is calculated dynamically if that makes any difference (will automatically recalculate and update its value when one of the other fields are changed). Sorry my suggestion doesn't fit the bill; hope someone else is able to find you something that works. :)

0 votes
Alok kumar Singh February 25, 2013

Thanks Nat, but I think it would be a nice idea if I can trank the transition and get the desired result. Well this is an awesome suggetion you have given with an awesome plugin, but it won't serve the purpose I think.

0 votes
Natalie Hobson
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.
February 25, 2013

Just going to comment instead of answer, as I'm not sure if this will work - maybe the "Calculated Number Field" from JIRA Misc Custom Fields plugin? I am horrible at math so I have no idea if you are able to create a formula that would work with dates instead of raw numbers.

Suggest an answer

Log in or Sign up to answer