A different calendar per project and per condition

Data Center This page documents Time in status, Timer, Stopwatch and Calendar fields for Jira Data Center and Server. On Jira Cloud? See Time in Status (Forge) for Jira Cloud.

Two questions come up over and over: “how do I set a different calendar for each project?” and “how do I use a 24/7 calendar for critical issues and a business-hours calendar for the rest?”

Neither one needs a feature that does not exist. The first is solved by native Jira field contexts, the second by the goal/condition list that Timer and Stopwatch configurations already have.


A calendar per project

Calendar Select is an ordinary Jira custom field type. It gets the same native contexts every Jira custom field gets, and a context is exactly the “per project” scope you are looking for: one context = one list of calendars plus one default value.

There is no separate “calendar per project” screen in the app, and there does not need to be one.

  1. Create a custom field of type Calendar Select (Calendar field).
  2. Add a Jira field context for each project - or each group of projects - that needs its own calendars.
  3. In each context, restrict the list to the calendars that scope is allowed to use, and set the default value to the calendar that scope should use most of the time.
  4. Point the consumers at the field, not at a fixed calendar:
    • Time in status field - select the Calendar Select field in the field configuration.
    • Timer / Stopwatch - select the Calendar Select field in the goal or in the configuration.
    • Reports - select the Calendar Select field in the report settings.

Every issue in a project now resolves its calendar through the context of that project, and an issue in another project resolves a different one - from the same field, without duplicating field configurations.

The default value of a context applies to issues that have no explicit value. If a project must never fall back to another region's calendar, give its context exactly one allowed calendar and make that calendar the default.

The full resolution order - which calendar wins when the field, the configuration and the goal all name one - is on the Calendar field page.


A calendar per condition

Timer and Stopwatch - several goals in one configuration

A Timer or Stopwatch configuration holds several goals, and each goal carries its own JQL and its own calendar. When the app evaluates an issue, the first goal whose JQL matches wins, and the calendar of that goal is the calendar the field counts by.

That is the whole conditional-calendar mechanism for Timer and Stopwatch: put the narrow conditions first and the catch-all last.

Order JQL of the goal Calendar of the goal
1 priority = Blocker 24/7
2 priority = Critical Extended hours
3 (empty - catch-all) Business hours

An issue at Blocker matches goal 1 and is counted around the clock. An issue at Major falls through to goal 3 and is counted by business hours only. Because the first match wins, a catch-all placed above a narrow condition would swallow everything below it - order the list from the most specific condition to the least.

Goals are edited in the configuration: Timer config, Stopwatch config.

Time in status - a calendar field driven by automation

The Time in status field takes its calendar from the Calendar Select field on the issue. There is no per-goal JQL here, because the field has no goals - but the value of a Jira field is something automation can set, and that is where the condition goes.

  1. Add a Calendar Select field to the issue’s screens and context, with the calendars the project is allowed to use.
  2. In the Time in status field configuration, select that field as the calendar source.
  3. Write an automation rule that sets the value of the Calendar Select field from whatever the condition is - priority, request type, component, label, customer tier.

For example: “when priority changes to Blocker, set Work calendar to 24/7; when priority changes to anything else, set Work calendar to Business hours”. From the moment the field value changes, the Time in status field counts by the new calendar.

The calendar is read from the current value of the field. Changing the value changes how the time is presented from that point on - so make the automation rule fire on the same event that makes the issue critical, not later.

Which mechanism do I need?

You want Use
Each project counts by its own calendar Jira field contexts on the Calendar Select field
Each issue type or project counts by its own calendar, without touching the field Jira field contexts (project + issue type)
A Timer or Stopwatch switches calendar by a JQL condition Several goals in the configuration - first match wins
A Time in status field switches calendar by a condition Calendar Select field on the issue + an automation rule that sets it
A report counts by a calendar chosen per issue Calendar Select field selected in the report settings


JiBrok time in status Time in status | SLA | Timer | Stopwatch
Migration
Release notes
Tutorials
Settings
Troubleshooting
Work calendars
Time in status
Timers and Stopwatches
Stopwatch
Timer
Additional functions
Issue panels
Reports
Field Helpers
Other fields
API
Reference information