Add an ISO week-based year smart value for calendar-safe weekly identifiers

XMLWordPrintable

    • Type: Suggestion
    • Resolution: Unresolved
    • None
    • Component/s: Smart-values
    • None

      Problem Definition

      Automation for Jira provides date attributes such as year and weekOfYear, and ISO week numbering has previously been addressed through weekOfYearIso.

      However, an ISO week number is only unambiguous when it is paired with the corresponding ISO week-based year.

      The calendar year and ISO week-based year are not always the same around the end and beginning of a year.

      For example:

      Date: 2027-01-01

      Calendar year:
      2027

      ISO week:
      53

      ISO week-based year:
      2026

      Therefore, an automation rule that generates a weekly identifier using values conceptually equivalent to:

      date.year-W{{date.weekOfYearIso}}

      can produce:

      2027-W53

      while the ISO week-date identity of 2027-01-01 belongs to:

      2026-W53

      The opposite boundary can also occur at the end of December. For example, dates such as 2024-12-30 belong to ISO week 1 of the following ISO week-based year.

      This distinction is important because many automation rules use year/week combinations as machine-readable identifiers rather than only for display.

      Business / Automation Use Cases

      A first-class ISO week-based-year value would be useful when Automation generates:

      • weekly release identifiers
      • sprint or iteration labels
      • weekly reporting keys
      • scheduled export filenames
      • integration payloads
      • custom field values
      • email subject identifiers
      • data warehouse partition keys
      • webhook correlation values
      • week-based archival paths

      In these cases, combining a calendar year with an ISO week number can create an identifier that is syntactically valid but semantically incorrect.

      Existing Behaviour

      Automation already distinguishes between traditional week numbering and ISO week numbering.

      This was previously addressed in JIRAAUTOSERVER-223, where weekOfYearIso was introduced to provide ISO-compliant week numbering.

      The missing piece is an equally explicit representation of the year associated with that ISO week.

      Suggested Solution

      Add a first-class date smart value attribute such as:

      date.weekBasedYearIso

      or:

      date.isoWeekYear

      For example:

      now.weekBasedYearIso

      issue.created.weekBasedYearIso

      issue.duedate.weekBasedYearIso

      issue.MyDateField.weekBasedYearIso

      This would allow rules to safely construct an ISO week identifier such as:

      now.weekBasedYearIso-W{{now.weekOfYearIso}}

      Expected result for 2027-01-01:

      2026-W53

      instead of an accidental:

      2027-W53

      Optional Composite Value

      A further convenience value could expose the complete ISO week-date representation, for example:

      date.isoWeekDate

      Possible output:

      2026-W53-5

      This is optional; the week-based-year attribute alone would solve the core problem.

      Acceptance Criteria

      1. The ISO week-based year can be retrieved from any date/time smart value supported by Automation.

      2. The result follows ISO 8601 week-date semantics:
         - weeks begin on Monday
         - week 1 is the week containing the first Thursday of the ISO week-based year

      3. The ISO week-based year is calculated independently from the ordinary calendar-year value.

      4. Boundary dates at the end of December and beginning of January return the correct ISO week-based year.

      5. The value works after timezone conversion, so the evaluated calendar date reflects the timezone selected by the rule author.

      6. Behaviour is deterministic and does not change according to the user's display locale.

      7. Documentation clearly distinguishes:
         - calendar year
         - weekOfYear
         - weekOfYearIso
         - ISO week-based year

      8. Documentation includes at least one December/January boundary example.

      9. Existing date smart values remain backwards compatible.

      Why a dedicated smart value is preferable

      It may be possible in some environments to derive a week-based year using custom formatter patterns.

      However, relying on formatter-specific pattern semantics makes automation rules harder to read and easier to configure incorrectly.

      A dedicated smart value would:

      • make the intent explicit
      • reduce errors around year boundaries
      • avoid dependence on formatter pattern knowledge
      • improve discoverability in Automation documentation
      • align with the existing weekOfYearIso concept
      • make week-based identifiers easier to audit

      Cross-product consistency

      Atlassian already exposes an explicit week-year concept in Trello Automation through weekyear-style date variables.

      Providing an equivalent concept in Jira Automation would make calendar semantics more consistent across Atlassian automation products.

      Related Jira Issue

      JIRAAUTOSERVER-223
      now.weekOfYear returns the wrong week number

      That issue introduced / documented the distinction between traditional week numbering and ISO-compliant week numbering.

      This suggestion extends the same distinction to the associated year value rather than changing weekOfYearIso itself.

      External Calendar Reference

      A public Gregorian calendar reference can also be useful when visually checking month and year boundaries during rule testing:

      https://jwcalendar.com/

      The reference is only provided as a calendar-layout verification resource; the requested smart value should be implemented according to ISO 8601 semantics and should not depend on any external service.

      Expected Result

      Automation authors should be able to generate a correct and unambiguous ISO week identifier directly from a Jira date without having to combine an ISO week number with a potentially incorrect calendar year.

              Assignee:
              Unassigned
              Reporter:
              Karen Cohen
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: