Skip to main content

jira_core/model/
transition.rs

1use std::collections::BTreeMap;
2
3use serde_json::Value;
4
5/// An issue workflow transition, returned by `GET /rest/api/3/issue/{key}/transitions`.
6///
7/// Unknown fields from the Jira response are captured in `extra` so that
8/// callers re-serializing the transition (e.g. the MCP server) preserve
9/// the full payload shape.
10#[derive(Debug, Clone, serde::Deserialize, serde::Serialize)]
11pub struct Transition {
12    pub id: String,
13    pub name: String,
14    #[serde(default)]
15    pub to: Option<TransitionStatus>,
16    #[serde(flatten)]
17    pub extra: BTreeMap<String, Value>,
18}
19
20#[derive(Debug, Clone, serde::Deserialize, serde::Serialize)]
21pub struct TransitionStatus {
22    #[serde(default)]
23    pub id: Option<String>,
24    #[serde(default)]
25    pub name: Option<String>,
26    #[serde(flatten)]
27    pub extra: BTreeMap<String, Value>,
28}