How do I get working days and hours settings for a project (or maybe issue)

I’m developing a listener plugin that will set the due date for an issue. The conditions are as following:

  1. If issue has been assigned to a user
  2. If an estimate has been set (like 4 days 5 hours)

The idea is to

  1. Get all the open issues assigned to the user,
  2. Order them by priority and created date
  3. Take those (if any) that come after the current issue(due dates of these issues will be shifted forward by the amount of time needed for the current)
  4. Take the due date of the issue (if any) that comes right before the current issue.
  5. Set the due date of the current issue based on previous issue due date.
  6. Shift the due dates of the issues that come after the current issue accordingly

For this, I need to take working days and hours (also non-working days) into account to get an accurate due date. How do I access that information? Also, does it matter if it’s agile or basic software development project?

P.S. I know that there are still more concerns about the logic of the plugin, like what if due date is set manually. I tried to concentrate on the main issue here.

1 Like

Intriguing idea! But I wonder if that’s how our customers use Due Date. Your interpretation is one valid use: it’s the date when the work might be completed. But another use is as an external constraint. Like the Due Date for filing my taxes is 18 April. It doesn’t matter how much work I prioritize before filing my taxes, that Due Date doesn’t move. When I coach people on using JIRA, that’s the meaning I suggest.

Anyway, to attempt answer your questions…

Unfortunately, I can’t find any API for the working days. But, even if there were an API, I don’t think the relationships work out well for your use case. Here are some troublesome aspects:

  • Both working days configuration for boards and estimates for issues “belong” to JIRA Software.
  • The working days belong to a JIRA Software board, not to a user. Issues can be found on more than 1 board, each with different working day configurations. This makes it hard (maybe impossible) know the schedule for a given user.
  • The boards are configured only with working days and timezone, not working hours. I suppose you could assume 8 hour days like JIRA does.
  • Time-based estimation is only 1 strategy. JIRA Software also uses Story points and Issue counts to help limit work-in-progress. That could make it hard when 1 person is on multiple teams using different strategies.

Taken as a whole, the existing fields and configuration aren’t built to support your scenario. My suggestion would be to avoid all the existing ambiguity and create what you need as part of your own add-on. For example, using entity properties to store your own “estimated delivery date”, to avoid the “Due Date” ambiguity. Or, having your own user configured “working day calendar” (perhaps reading from a Google Calendar). Controlling all of these within your add-on means you know the data will exist and the data means what you think it means.

Just one man’s thoughts. :wink:


Can’t think of a possible better answer. Thank you a lot.

1 Like