---
updatedAt: 2026-05-26T17:45:29.000Z
agentTools:
  projectIndex: https://developer.usertesting.com/llms.txt
---

# Stream Insights into Slack or Jira

_Near real-time polling_

## Introduction

This tutorial demonstrates how to build a *near real-time automation* that monitors UserTesting sessions as they complete, detects important signals (such as failed tasks or notable responses), and pushes alerts into Slack or Jira.

This pattern enables teams to act on research insights immediately, turning UX findings into operational workflows instead of static reports.

The approach uses *polling*, which is supported by the Results API, and sets the foundation for webhook-based integrations with other apps.

### What you'll build

A lightweight service or script that:

1. Polls for newly completed sessions in a test
2. Fetches session details for each new session
3. Applies client-side logic to detect signals (for example, failed tasks)
4. Sends formatted notifications to Slack or Jira

### Target audience

* DevOps engineers
* Product operations teams
* Research operations teams
* Platform and integration engineers

### Prerequisites

* A valid access token (`ACCESS_TOKEN`). Go to <Anchor target="_blank" href="https://developer.usertesting.com/v2.0/docs/authorization">Authorization</Anchor> for details.
* A known `testId`. Go to <Anchor target="_blank" href="https://developer.usertesting.com/v2.0/docs/how-to-obtain-a-testid-uuid">How to obtain a Test ID (UUID)</Anchor> for details.
* A Slack Incoming Webhook URL **or** Jira API credentials
* A scheduler or lightweight worker (cron, serverless function, background job)

### High-level architecture

```mermaid
graph LR
    A["Scheduler / Worker<br/>(every N minutes)"] --> B["List sessions<br/>(polling)"]
    B --> C["Identify newly<br/>completed sessions"]
    C --> D["Fetch session<br/>details"]
    D --> E["Apply rules<br/>(failed task,<br/>sentiment, etc.)"]
    E --> F["Send message<br/>to Slack or Jira"]
```

***

## Steps

### Step 1 - Poll for sessions in a test

**Endpoint**

<Anchor target="_blank" href="https://developer.usertesting.com/v2.0/reference/sessionresultscontroller_getsessionsummaryresults">GET /api/v2/sessionResults</Anchor>

**Why polling works**

* Sessions complete over time
* This endpoint allows you to repeatedly check for updates
* Near real-time behavior is achieved by polling every few minutes

**Example (curl)**

```curl
curl --location 'https://api.use2.usertesting.com/api/v2/sessionResults?testId=TEST_ID&limit=10&offset=0' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer ACCESS_TOKEN'
```

> 👍
>
> **Best Practice**: Always use pagination query parameters (`limit` and `offset`) along with the appropriate logic to ensure all sessions are retrieved.
>
> * Use the response data from `limit`, `offset`, and `totalCount` in the `meta.pagination` property to calculate the number of page iterations needed to collect all sessions in the test.
> * By default, `limit` is set to `25` and `offset` to `0`.
> * In the response, sessions are sorted in descending order, from newest to oldest.

<br />

### Step 2 - Track newly completed sessions

**Best practice**

Maintain a small state store (file, DB, cache) with:

* Last processed `finishTime`
* Or a set of processed `sessionIds`

**Logic**

Ignore sessions with `finishTime` equal to or less than the last processed `finishTime`.

This prevents duplicate notifications.

### Step 3 - Retrieve session details for new sessions

**Endpoint**

`GET /api/v3/sessionResults/SESSION_ID`

**Purpose**

The v3 session-details response includes:

* `tasks[]` for per-task responses and timing
* `taskGroups[]` for score and sequence metadata
* `sessionParticipant` for participant context

**Example (curl)**

```curl
curl --location 'https://api.use2.usertesting.com/api/v3/sessionResults/SESSION_ID' \
--header 'Authorization: Bearer ACCESS_TOKEN'
```

> 👍
>
> Most actionable signals usually come from `tasks[]`. Use `taskGroups[]` when you need session-level metadata such as `QX_SCORE` or `BALANCED_COMPARISON` sequence.

<br />

### Step 4 - Detect actionable signals (client-side logic)

The Results API returns raw, structured data. Insight detection happens in your code.

**Example signals**

**Failed task detection**

*Identify task responses where*:

* `type == "RATING_SCALE"` and `response.answer.ratingScale.value` is below a threshold
* `response.skipped == true`
* NPS-style tasks score poorly

**Notable qualitative responses**

* Keyword matches in written responses
* Empty or abandoned tasks
* Unexpected task patterns

**Example rule (pseudo-logic)**

```text
IF task.type == "RATING_SCALE"
AND int(task.response.answer.ratingScale.value) <= 2
THEN flag as "Task Failure"
```

**Another useful rule**

```text
IF task.response.skipped == true
THEN flag as "Skipped or abandoned task"
```

<br />

### Step 5 - Send alerts to Slack

**Slack integration pattern**

* Use an <Anchor target="_blank" href="https://docs.slack.dev/messaging/sending-messages-using-incoming-webhooks/">Incoming Webhook</Anchor>
* Post a concise, actionable message

**Example payload**

```json
{
  "text": "UserTesting Alert\nA participant failed a rating-scale task in Test ABC.\nSession ID: 1234\nFinish Time: 2024-11-21T12:25Z"
}
```

**Best practices**

*Include*:

* Test name or ID
* Session ID
* What went wrong

> 👍
>
> Keep messages short and scannable.

<br />

### Step 6 - Send issues to Jira (optional)

Instead of Slack, you can <Anchor target="_blank" href="https://developer.atlassian.com/server/jira/platform/jira-rest-api-examples/#creating-an-issue-examples">create Jira issues</Anchor> when critical signals occur.

Common input data sample for creating a Jira issue:

```json
{
  "fields": {
    "project": {
      "key": "TEST"
    },
    "summary": "UX Issue Detected in UserTesting Session",
    "description": "Include task details and session context here.",
    "issuetype": {
      "name": "Task"
    },
    "labels": ["usertesting", "ux-research", "regression"]
  }
}
```

<br />

### Step 7 - Control frequency and load

**Recommended polling interval**

* Every 5 to 10 minutes for near real-time use
* Longer intervals for lower urgency

**Rate-limit considerations**

Consider rate-limit error responses (429 status code) and use:

* Exponential backoff
* Small concurrency limits
* Avoid re-fetching session details unnecessarily

***

## Example polling loop (pseudo-code)

```python
last_checkpoint = load_checkpoint()

for page in paginate_sessions(test_id):
    for session in page.sessions:
        if session.finishTime <= last_checkpoint:
            continue

        details = get_session_details_v3(session.sessionId)

        for task in details.get("tasks", []):
            task_response = task.get("response") or {}
            answer = task_response.get("answer") or {}

            is_low_rating = (
                task.get("type") == "RATING_SCALE"
                and "ratingScale" in answer
                and int(answer["ratingScale"]["value"]) <= 2
            )

            is_skipped = task_response.get("skipped") is True

            if is_low_rating or is_skipped:
                notify_slack(session, task, details)

        update_checkpoint(session.finishTime)
```

> 🖥️
>
> **Pseudo-code overview**: The code iterates through completed test sessions since the last checkpoint, fetches v3 session details, inspects `tasks[]` for low scores or skipped tasks, sends a Slack notification when a rule matches, and updates the checkpoint to avoid reprocessing sessions in future runs.

***

## Common pitfalls

| Pitfall          | Recommendation                      |
| ---------------- | ----------------------------------- |
| Duplicate alerts | Persist checkpoints                 |
| Alert noise      | Start with strict rules             |
| Over-polling     | Increase interval if volume is high |
| Missing context  | Include task and test info          |

***

## Summary

You've built a near real-time automation that:

* Monitors research sessions as they complete
* Detects meaningful UX signals from `tasks[]`
* Uses `taskGroups[]` when score or comparison metadata matters
* Pushes insights directly into team workflows

This transforms UserTesting from a reporting tool into a real-time decision engine, enabling faster response and tighter collaboration across teams.