How to get difference of two custom fields in JIRA

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

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

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

Have you record time spent against the issues in question?

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"

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

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.

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.

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. :)

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

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Tuesday in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

197 views 1 18
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you