Timepiece - Time in Status for Jira

How to Send SLA Breach Notifications for Unresolved Issues via Timepiece Integration

Business Need

You need an automated process that periodically checks all unresolved issues in a project, calculates their cycle time using Timepiece, and posts a comment on any issue that has exceeded a defined SLA limit.

Solution

“DURATION BETWEEN STATUSES” report type of Timepiece, combined with Jira Automation, can be used for this purpose.

Step 1: Configure and Save the Timepiece Report

First, create a Timepiece report...

  • Open the Timepiece reporting page.

  • Select the project in which the support issues reside (Let’s presume you have selected the ABC project).

    • Any filter selection at this point works. The selection made at this stage is not critical, as it will be overridden later during the automation configuration.

  • Switch to the “DURATION BETWEEN STATUSES” report type.

  • (Optional) Select your business calendar if you have one.

  • Create a metric where the start and end points reflect your SLA metric.

    • This example uses a metric where the start is "First transition to In Progress", and the end is "Last transition to Resolved".

Duration Between Status Report Cycle Time Metric
  • Use an appropriate name for your metric

    • This example names the metric as "CycleTime".

  • Filters issues that have a Cycle Time greater than 3 days.

A Timepiece report filter configuration
  • Go to settings and save it via "Save report parameters".

    • The parameter set name should be like "ABC Project Cycle Time Automation".

    • Make sure you select the "Share with everyone" option so others can use the param set as well.

A Timepiece Duration Between Statuses report dashboard displaying a list of issues filtered by Custom JQL for ABC Project showing columns for Key Summary and Cycle Time


Step 2: Create a Jira Automation & Set General Flow Details

Navigate to Jira Automation and start a new rule.
Before configuring the automation logic, you must define the administrative settings in the Flow Details section.

Step 3: Define the Trigger

Use the "Scheduled" trigger to run the automation on a recurring basis. This step ensures the automation runs daily and scans all relevant issues automatically.

First step of Timepiece automation flow showing a scheduled trigger configured to run every day at 5 30 PM

Step 4: Add Action - Timepiece: Run Report

After defining the trigger and conditions, add a “Timepiece: Run Report” action that will fetch the required data from Timepiece.

Timepiece automation interface showing an Add a step menu to choose an Action Condition Branch or Controls for the flow
An Add an action window with Timepiece Run Report selected as the action
  • Select the report (Parameter Set) you created for this automation in the Report Settings field. Ensure that the report has been previously saved using the “Save Report Parameters” option.

Timepiece Run Report settings configuration window with a chosen report and custom JQL parameter overrides JSON fields

Parameter Overrides

Override some report parameters with a custom JSON. We’ll override the report filter so it returns data only for issues in the relevant project that are not in “Done” status. It ensures the automation fetches only active issues instead of a general dataset.

Parameter Overrides: {"filterType": "customjql","customJql": "project = ABC AND statusCategory != Done AND key = {{issue.key}}","viewFormat": "days"}

Step 5: Add Log Action (Optional)

Add a Log Action to your flow. This step is necessary if you want to monitor the automation and is helpful for debugging in the event of an error.

Log Message: resultList: {{fetchedTimepieceResultList}}

Timepiece automation interface configuring a Log action to add values to the audit log

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

Step 6: Create Lookup Table

This step creates a dynamic lookup table named CycleTimeTable by mapping each issue key to its corresponding cycle time value from the fetched report data, making it easy to retrieve and use these values in subsequent automation actions.

Timepiece automation interface configuring a Create dynamic lookup table action

Table variable name: CycleTimeTable

Dynamic Source: {{fetchedTimepieceResultList}}

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

Add a Branch block and define a “For: JQL” loop within it to iterate over each issue returned from the Timepiece report.

Timepiece automation interface configuring a Branch flow related work items step

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

Step 8: Add Comment To Work Item

In the Comment on work item step, the automation adds a comment directly to the issue. By using this step, the information about the issue exceeding the SLA limit is added directly to the work item.

Add a comment for this automation:

This issue has exceeded the expected 3-day SLA limit by spending {{CycleTimeTable.get(issue.key).asNumber().round()}} days in cycle time.

Timepiece automation interface configuring a Comment on work item action


Step 9: Enable the Rule

Click the "Turn on rule" button to activate the automation. From this point forward, every day at 17:30 (Europe/Istanbul), the automation will automatically find issues that have exceeded the 3-day SLA limit and add a comment to them.

A Jira activity section showing an automated comment from Automation for Jira stating that the issue has exceeded the expected 3 day SLA limit