> For the complete documentation index, see [llms.txt](https://help.resouris.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.resouris.com/set-up-what-you-schedule/create-a-service-line.md).

# Create a service line

**Who:** roster-area admin. **Perm:** `roster.update`. **Time:** \~10 minutes for a straightforward SL; longer if you're configuring split-shift patterns.

A service line is a workstream: e.g. "CT scanning", "outpatient ultrasound", "breast-screening clinics", "neonatal on-call". Everything the solver rosters is inside a service line.

## Before you start

You need:

* At least one **activity** catalogue entry for the SL to reference.
* At least one **room** catalogue entry.
* Optional: a **worker position** definition if you'll be tying eligibility to positions (P22).

## 1. Navigate

Sidebar → **Organisation** → **Services** (`/ui/admin/service-lines`), then add one. ⓘ The screens say **Services**; this documentation says *service line*, and they are the same thing.

## 2. Identity + priority

Fill:

* **Code** — short, uppercase, up to 64 chars. Used in reports and API calls.
* **Display name** — human-readable.
* **Department** — the roster area that owns this SL.
* **Priority** — solver's lex-priority weight. Higher = allocated first. Default 100.
* **Priority override** — optional per-tenant override; leave blank unless you know you need it.
* **Target roster tier** — the seniority band expected. Used to bias the solver toward tier-appropriate candidates.

## 3. Activities

Under the **Activities** section, add the activities this SL produces. Each row:

* **Activity** — pick from the catalogue.
* **Requires competency** — the competency (or family, e.g. `CT-*`) staff must hold.
* **Splittable** — **new in v1.6.2**. If checked, the solver may split a slot for this activity into multiple sub-window sub-assignments. Combined predicate is `(service_line.allow_split_shifts AND service_line_activity.splittable)`.
* **Renewal points** — how much this activity contributes to competency renewal (v1.5+ renewal-points work).

## 4. Rooms

Rooms attach to SLs via **patterns** (day-of-week × sub-slot) and per-date **overrides**. This is the P24 replacement for the old single-room-per-SL model.

**Set a pattern:**

1. Click **Rooms → Add pattern**.
2. Pick the day of week (0..6) and the sub-slot index (0..47 for a 48-sub-slot day; smaller if your tenant sets a coarser `subslot_minutes` in Deployment settings).
3. Pick the room.
4. Save.

Repeat for every (day, sub-slot) combo the SL should use. The bulk-write presets (AM / PM / DAY) let you populate common patterns in one click.

**Overrides:**

1. Click **Rooms → Add override**.
2. Pick a specific date + sub-slot + room.
3. Save.

Overrides take precedence over patterns. Solver reads override first, falls back to pattern.

## 5. Split-shift configuration (optional)

If any activities you added are `splittable`, decide:

* **Allow split shifts** — checkbox at the SL level. If unchecked, no splits happen regardless of activity flags. This is your feature gate.
* **Handover minutes** — 0..60. The paid overlap between sub-window staff during a handover. Default 15 minutes; clinical-safety range per RCN 08/2019 + BMA Junior Doctors Handover Toolkit 2020.

Use the divided-cell view on `/ui/rosters` after your first solve to see how the splits actually landed. Adjust `handover_minutes` if you're seeing over/under-coverage.

## 6. Save

Click **Save**. The SL is created in `draft` state.

## 7. Publish (activate)

You cannot roster off a `draft` SL. Click **Publish** to move it to `active`. The publish action:

* Emits `service_line.published` audit event.
* Signals the roster-generation queue that this SL should be considered on the next solve.
* Makes the SL visible in the rostering grid.

## 8. Verify on next solve

Trigger a roster generation covering a horizon that includes this SL. Check the grid: your SL should appear as a workstream row (or column, depending on view mode). If the solver reports `PRE_FILL_CONFLICT` for cells owned by this SL, one of your patterns is inconsistent — probably a pattern points to a room the room's own configuration doesn't allow.

## Common issues

* **"No candidates for this cell"** — no staff holds the required competency for this activity in your target roster tier. Add competencies or lower the tier.
* **Solver picks unexpected splits** — check the `splittable` flag per activity and the `handover_minutes` value. A handover of 0 with splittable activities usually produces more splits than admins expect.
* **Room double-booked across SLs** — the pattern catalogue is per-SL; two SLs pointing at the same room in the same (day, sub-slot) is a config error. `test_room_sl_pattern_uniqueness` catches this in CI, but a fresh install can hit it.

## What comes next

* Configure or verify the allocation policy → [Author an allocation policy](/set-up-what-you-schedule/author-an-allocation-policy.md).
* Trigger a solve and inspect results → [Quick start](/start-here/quick-start.md#5-trigger-a-roster-generation).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.resouris.com/set-up-what-you-schedule/create-a-service-line.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
