Let \(\Xi_h = \{i \in \{1,\ldots,n\}: z_i=h \}\) for \(h=1,\ldots,H\). By Example 2.12, \[
\begin{aligned}
f(\sigma^2_h \mid y_{1:n}, z_{1:n}, \mu_{1:H}, \sigma_{-h}^2, \theta)
&= f(\sigma^2_h \mid y_{\Xi_h}, z_{1:n}, \mu_h, \sigma_{-h}^2, \theta) \\
&\propto f(y_{\Xi_h} \mid \sigma^2_h, z_{1:n}, \mu_h, \sigma_{-h}^2, \theta) f(\sigma^2_h \mid z_{1:n}, \mu_h, \sigma_{-h}^2, \theta) \\
&= f(y_{\Xi_h} \mid \sigma^2_h, z_{1:n}, \mu_h) f(\sigma^2_h \mid \mu_h) \\
&\sim \frac{b +(\mu_h-\eta)^2/(2\kappa) +\sum_{i \in \Xi_h} (y_i-\mu_h)^2/2}{\mathrm{Ga}(a+1/2+|\Xi_h|/2)},
\end{aligned}
\] where \(|\Xi_h| = \sum_{i=1}^n \mathbb{I}(z_i=h)\) denotes the cardinality of \(\Xi_h\).
Note: one of you asked why we can drop \(\sigma_{-h}^2\). See the explanation below: \[
\begin{aligned}
& f(\sigma^2_h \mid y_{1:n}, z_{1:n}, \mu_{1:H}, \sigma_{-h}^2, \theta) \\
\propto{}& f(y_{\Xi_h} \mid \sigma^2_h, z_{1:n}, \mu_h, \theta)
\underbrace{f(y_{-\Xi_h} \mid \sigma^2_{-h}, z_{1:n}, \mu_{-h}, \theta)}_{\textrm{does not include }\sigma_h^2}
f(\sigma^2_h \mid z_{1:n}, \mu_h, \sigma_{-h}^2, \theta).
\end{aligned}
\]