Timepiece - Time in Status for Jira

How to Automatically Comment on SLA Breaches with Jira Automation

This article explains how to use a Timepiece - Time in Status SLA Report with Jira Automation to identify work items where the first response exceeds the defined SLA target and automatically add a comment when the SLA is breached. The SLA metric measures the First Response Time from Issue Creation to In Progress, with a target of 4 hours. If the work item does not reach In Progress within 4 hours of creation, the First Response Time SLA is considered breached and Jira Automation posts a comment on the work item.

Business Need

You need an automated process that monitors the First Response Time of work items and identifies SLA breaches without requiring the SLA Report to be checked manually.
When a work item does not reach In Progress within the defined SLA target, the team should be notified directly on the work item so the delayed response can be addressed promptly.

Solution

The SLA report type of Timepiece, combined with Jira Automation, can be used for this purpose.

Step 1: Configure and Save the Timepiece SLA Report

First, create an SLA Report that measures the First Response Time from Issue Creation to In Progress and uses a Duration Based target of 4 hours.

  • Open the Timepiece reporting page.

  • Select the project in which the work items reside.

  • Switch to the SLA report type.

  • Open the Metrics panel and add a new SLA metric.

SLA Metrics configuration screen showing Start, Stop, Pause conditions and target duration settings
  • Set Start At to Issue Creation.

  • Set Stop At to In Progress.

  • Set the SLA target type to Duration Based.

  • Set the target to 4 hours.

  • Save the SLA metric configuration.

Timepiece SLA report dashboard showing First Response elapsed, target, and SLA difference metrics for project issues

The resulting SLA metric evaluates whether the work item reaches In Progress within the defined 4-hour target from Issue Creation. If the work item does not reach In Progress within 4 hours, the SLA status becomes breached.

  • In the report filters, set Elapsed Time to greater than 4 hours so that the report includes only work items that have exceeded the 4-hour SLA limit.

Timepiece SLA report dashboard showing the filter pop-up window with a rule set for First Response Elapsed time
  • Go to Settings and save the report using Save Report Parameters.

  • Use a descriptive parameter set name, such as "First Response Time SLA".

  • Select Share with everyone so the parameter set can be used by the automation.

Save Parameter Set modal dialog with input field filled as First Response Time SLA and Share with everyone option checked

Step 2: Create a Jira Automation Rule

Navigate to Jira Automation and create a new rule.

Before configuring the automation logic, define the administrative settings in the Flow Details section.

Step 3: Define the Trigger

Use the Scheduled trigger to run the automation periodically.

First Response Time SLA automation builder showing schedule trigger configuration panel set to run every 15 minutes

Configure the trigger to run every 15 minutes. This allows the automation to regularly check work items against the defined 4-hour SLA target and identify work items whose First Response Time has exceeded the target.

Step 4: Add Action - Timepiece: Run Report

Add a Timepiece: Run Report action to retrieve the SLA results from the saved Timepiece report.

  • Select the First Response Time SLA parameter set in the Report Settings field.

  • Make sure the report has been saved using Save Report Parameters.

Screenshot of Timepiece Run Report automation step showing report selection set to First Response Time SLA and custom JQL parameter overrides in JSON format

Parameter Overrides

Use Parameter Overrides to limit the report to the work items that should be evaluated by the automation.

Parameter Overrides: { "filterType": "customjql", "customJql": "project = SSP AND statusCategory != \"In Progress\"", "viewFormat": "hours" }

Step 5: Add Log Action (Optional)

Add a Log Action to inspect the data returned by Timepiece.

Screenshot of automation workflow displaying Log action step with a smart value expression set to log fetched Timepiece result list

Log Message:

resultList: {{fetchedTimepieceResultList}}

This is useful for verifying the SLA result returned by the report and for troubleshooting the automation if needed.

Note: For more details about logging and debugging, see the documentation.

Step 6: Create a Lookup Table

Create a dynamic lookup table to associate each work item with its SLA result returned by Timepiece.

Screenshot of automation flow step showing dynamic lookup table creation using fetched Timepiece result list with Key and FirstResponse values

Table variable name: FirstResponseTable

Dynamic Source:{{fetchedTimepieceResultList}}

This allows the automation to retrieve the SLA result for each work item while processing the report results.

Step 7: Add Action - Branch / For: JQL Loop

Add a Branch block and select For: JQL to iterate through the work items returned by the Timepiece report.

({{fetchedTimepieceResultList.Key.join(",")}})

Use the keys returned by the Timepiece report to process each work item individually.

First Response Time SLA automation canvas showing Branch flow configured with JQL

Step 8: Add Comment To Work Item

Add a Comment on work item action inside the breached branch.

Use a comment such as:

This work item has exceeded the expected 4-hour SLA limit. Its First Response time is {{FirstResponseTable.get(issue.key).asNumber().round()}} hours.

This adds the calculated First Response time to the work item when the 4-hour SLA limit has been exceeded.

Configuring automated work item comment in Jira automation to notify issue SLA breaches using dynamic lookup table smart values

Step 9: Enable the Rule

Click the Turn on rule button to activate the automation.

Once active, the rule periodically runs the saved Timepiece SLA Report, checks the SLA status of the relevant work items, and automatically adds a comment to work items whose First Response Time has exceeded the defined 4-hour SLA target.

Automated SLA breach notification comment added to a Jira issue by Automation for Jira

For more information about configuring SLA Metrics and targets, see SLA Metrics.