Breadcrumbs

RAG - due date traffic light

πŸ“š

Return a traffic light based on the current date and the due date of the work item.

🟒 - the work item is due in more than 2 weeks (14 days)

🟑 - the work item is due in more than one week (7 days) but less than 2 weeks (14 days)

🟠 - the work item is due in less than a week (7 days)

πŸ”΄ - the work item is overdue

βšͺ - the work item has no due date or it is already resolved

Configuration

Create a Custom smart text fields and use the General parsing mode.

Expression

%{{issue.dueDate} = null or %{issue.resolution} != null? "βšͺ" : 
(addDays({system.currentDateTime}, 14, RUN_AS_LOCAL) < {issue.dueDate} ? "🟒" :
(addDays({system.currentDateTime}, 7, RUN_AS_LOCAL) < {issue.dueDate} ? "🟑" :
({system.currentDateTime} < {issue.dueDate} ? "🟠" : "πŸ”΄")))}
image-20250916-112726.png


Used parser functions

The links lead to the JWTC documentation, as the parser expression is a shared functionality.

Details

1. What does the expression do?

This parser expression returns a colored traffic light symbol (πŸŸ’πŸŸ‘πŸŸ πŸ”΄βšͺ) for each work item, based on how close its due date is to the current date. It helps you quickly see which work items are overdue, due soon, or have plenty of time left.

2. Step-by-step breakdown

Let’s break it down:

  • %{{issue.dueDate} = null or %{issue.resolution} != null? "βšͺ" : ...}

    • If the work item has no due date, or if it is already resolved, show a white circle (βšͺ).

  • addDays({system.currentDateTime}, 14, RUN_AS_LOCAL) < {issue.dueDate} ? "🟒" : ...

    • If the due date is more than 14 days (2 weeks) away from today, show a green circle (🟒).

  • addDays({system.currentDateTime}, 7, RUN_AS_LOCAL) < {issue.dueDate} ? "🟑" : ...

    • If the due date is more than 7 days (1 week) but less than or equal to 14 days away, show a yellow circle (🟑).

  • {system.currentDateTime} < {issue.dueDate} ? "🟠" : "πŸ”΄"

    • If the due date is less than or equal to 7 days away but not overdue, show an orange circle (🟠).

    • If the due date has passed (overdue), show a red circle (πŸ”΄).

Technical terms explained:

  • addDays(timestamp, numberOfDays, timeZone): Adds a number of days to a date. Here, it is used to calculate the timestamps after 14 and 7 days have passed.

  • {system.currentDateTime}: The current date and time.

  • {issue.dueDate}: The due date of the work item.

  • {issue.resolution}: Resolution of the work item or nothing if it is unresolved.

3. Examples

  • A work item with no due date or already resolved: βšͺ

  • Due date is 20 days from today: 🟒

  • Due date is 10 days from today: 🟑

  • Due date is 3 days from today: 🟠

  • Due date was yesterday: πŸ”΄

4. Real-life use cases

  • Project dashboards: Instantly see which tasks are at risk of being overdue.

  • Team meetings: Quickly identify which work items need urgent attention.

  • Personal task management: Prioritize your work based on how soon items are due.

  • Reporting: Provide a visual summary of project health for stakeholders.