pub struct JiraMetadata {
pub flavor: JiraFlavor,
pub projects: HashMap<String, JiraProjectMetadata>,
pub structures: Vec<JiraStructureRef>,
}Expand description
Metadata for Jira project(s), used for dynamic schema enrichment.
Supports both single-project and multi-project configurations. Multi-project unions enum values across projects.
Fields§
§flavor: JiraFlavorJira flavor (affects API version and auth).
projects: HashMap<String, JiraProjectMetadata>Per-project metadata keyed by project key (e.g., “PROJ”).
structures: Vec<JiraStructureRef>Structures the integration user can see across the Jira instance.
/rest/structure/2.0/structure is not keyed by Jira project — it
returns every structure the caller has read access to. Placed here
(on the instance-level metadata) rather than on JiraProjectMetadata.
Empty when the Structure plugin is not installed or the user has no
read access; that is the graceful-degrade signal the schema enricher
keys on to decide whether to enrich Structure tools.
Implementations§
Source§impl JiraMetadata
impl JiraMetadata
Sourcepub fn is_single_project(&self) -> bool
pub fn is_single_project(&self) -> bool
Whether this is a single-project configuration.
Sourcepub fn project_keys(&self) -> Vec<&str>
pub fn project_keys(&self) -> Vec<&str>
Get project keys.
Sourcepub fn all_issue_types(&self) -> Vec<String>
pub fn all_issue_types(&self) -> Vec<String>
Get union of all issue types across projects (non-subtask only).
Sourcepub fn all_priorities(&self) -> Vec<String>
pub fn all_priorities(&self) -> Vec<String>
Get union of all priorities across projects.
Sourcepub fn all_components(&self) -> Vec<String>
pub fn all_components(&self) -> Vec<String>
Get union of all components across projects.
Sourcepub fn all_link_types(&self) -> Vec<String>
pub fn all_link_types(&self) -> Vec<String>
Get union of all link types across projects.
Sourcepub fn all_custom_fields(&self) -> Vec<JiraCustomField>
pub fn all_custom_fields(&self) -> Vec<JiraCustomField>
Union of customfields visible across the first
MAX_ENRICHMENT_PROJECTS projects, deduplicated by name.
First-write-wins on collisions — if Severity exists in
multiple projects with different ids, the schema is built
from the earliest project’s definition (matches HashMap
iteration order; not deterministic across runs but stable
within one). Per-project resolution at dispatch time is done
by Self::custom_field_for_project, which reads the
current project’s metadata directly.
The cap protects token budgets on enterprise instances with
hundreds of projects: enrichment beyond 30 projects emits a
tracing::warn! and silently truncates rather than letting
the schema explode. Selecting the relevant 30 (most-recent
activity, allowlist, etc.) is the metadata loader’s job, not
this crate’s.
Sourcepub fn custom_field_for_project(
&self,
project_key: &str,
field_name: &str,
) -> Option<&JiraCustomField>
pub fn custom_field_for_project( &self, project_key: &str, field_name: &str, ) -> Option<&JiraCustomField>
Resolve a customfield by display name within a specific
project — used by transform_args to pick the right
customfield_* id when the same name maps to different ids
across projects in multi-project mode.
Sourcepub fn custom_field_groups(&self) -> Vec<(String, Vec<JiraCustomField>)>
pub fn custom_field_groups(&self) -> Vec<(String, Vec<JiraCustomField>)>
Group customfields across capped projects by display name —
returns (name, [variants]) pairs sorted by name. A name
with two entries that have different field_types flags a
cross-project shape conflict the enricher resolves with
anyOf instead of first-wins.
Trait Implementations§
Source§impl Clone for JiraMetadata
impl Clone for JiraMetadata
Source§fn clone(&self) -> JiraMetadata
fn clone(&self) -> JiraMetadata
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more