The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
  • Community
  • Q&A
  • Jira
  • Questions
  • How to create a custom field that counts the days that have passed since a task has expired in Jira?

How to create a custom field that counts the days that have passed since a task has expired in Jira?

Héctor Daniel Reyna Bermúdez
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 8, 2021

I'm trying to create a custom field where the business days (not Saturday and Sunday) elapsed since the due date of a task are counted but I can't find where to enter the formula for this to work.

 

Please guide.

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Nic Brough -Adaptavist-
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 Champions.
January 9, 2021

People who ask for a field like this often fall into a bit of a minefield, and I would encourage you to think it through before you try to implement anything like this.

At first look, the simple human description of "number of days that have passed since" (or "number of days to", or other variants with hours, weeks, minutes, and other dated milestones) are instinctively very simple.  There is nothing wrong with thinking in that way, it's normal for humans, and also very useful.

But computers store static data, not dynamic.  The number of minutes that have passed since you asked the question, you got a reply, I replied, and you read each answer has changed every elapsed minute.

The field you could call "minutes passed since someone responded to this post" can only hold valid data for 60 seconds.  You would need to update it every 60 seconds to keep it valid.

I've used minutes to emphasise that a "time since" field is either wrong or imposes massive load in updating it a LOT, but the principle is the same whether it's seconds or years - do not try to do this with the data.

Very broadly, you have two options:

  • Recalculate a stored value every X seconds/minutes/hours/etc
  • Read a static piece of data, and base a calculation on it and the current time

Obviously, the first option is utter rubbish.  Logically, it works, but in real life, it won't scale beyond a couple of thousand items if you choose minutes, and even if you go for weeks, I'd say you need to be below 10,000 issues.

The second one requires some form of injection of a dynamic display.  You'll need to find or write an app that can look at a date/time field and calculate a new number from it to display.

0 votes
Kristján Geir Mathiesen
Community Champion
January 8, 2021

Hello @Héctor Daniel Reyna Bermúdez  and welcome to the Community!

I believe you need a plugin to achieve this, like Jira Misc Custom Fields. With it, you should be able to create a custom field and whip up a formula to calculate this. Not totally sure about minus the weekends though.

Btw, I am not affiliated with Innovalog (the vendor).

HTH,
KGM

TAGS
AUG Leaders

Atlassian Community Events