Skip to main content

JiraConfig

Struct JiraConfig 

Source
pub struct JiraConfig {
    pub login: String,
    pub api_url: String,
    pub completed_statuses: Vec<String>,
}
Expand description

Configuration for Jira API integration.

This structure holds the necessary information for connecting to Jira instances, including both cloud and server/data center deployments. The configuration is designed to be serializable for storage in configuration files.

ยงSecurity Notes

  • Passwords are never stored in configuration files
  • Only usernames and API endpoints are persisted
  • Session tokens are cached separately with encryption
  • Configuration files should have restricted permissions

ยงSupported Jira Instances

  • Atlassian Cloud: Uses https://company.atlassian.net format
  • Server/Data Center: Uses custom domain like https://jira.company.com
  • Local Development: Can use http://localhost:8080 for testing

Fieldsยง

ยงlogin: String

Jira username for authentication.

This should be the actual username, not an email address, unless your Jira instance is configured to use email addresses as usernames. Check with your Jira administrator if unsure.

For Atlassian Cloud instances, this is typically the email address used to register the account.

ยงapi_url: String

Base URL of the Jira instance.

Examples:

  • Atlassian Cloud: https://company.atlassian.net
  • Server/Data Center: https://jira.company.com
  • Local development: http://localhost:8080

Do not include the /rest/api/ path as it will be added automatically. The URL should point to the root of your Jira installation.

ยงcompleted_statuses: Vec<String>

Deprecated: previously used in status in (...) for completed-issue search.

Kept for config compatibility. Discovery now filters by resolved date only, because non-existent status names (e.g. English โ€œDoneโ€ on a Russian Jira) make the whole JQL fail.

Implementationsยง

Sourceยง

impl JiraConfig

Source

pub fn module() -> ConfigModule

Returns the configuration module metadata for Jira.

Used by the configuration system to identify and manage Jira-specific settings during interactive setup. This provides the human-readable name and internal key for the module.

ยงReturns

A ConfigModule with Jira identification information.

Source

pub fn init(config: &Option<Self>) -> Result<Self>

Runs an interactive configuration setup for Jira integration.

Prompts the user for Jira instance URL and username, using existing configuration values as defaults if available. This method provides a user-friendly way to configure Jira integration during initial setup or reconfiguration.

ยงInteractive Prompts
  1. Username: Prompts for Jira username (or email for cloud instances)
  2. API URL: Prompts for Jira instance URL with validation hints

Both prompts will show existing values as defaults if configuration already exists, making it easy to update only specific values without re-entering everything.

ยงConfiguration Validation

While this method doesnโ€™t validate the actual connection to Jira, it provides helpful prompts and examples to guide users toward correct configuration values.

ยงArguments
  • config - Existing Jira configuration to use as defaults (if any)
ยงReturns
  • Result<Self> - New Jira configuration with user input
ยงErrors

Returns an error if:

  • Terminal input/output fails
  • User cancels the configuration process
  • Input validation fails
ยงExample
let existing_config = Some(JiraConfig {
    login: "olduser".to_string(),
    api_url: "https://old-jira.com".to_string(),
    completed_statuses: Vec::new(),
});

let new_config = JiraConfig::init(&existing_config)?;

Trait Implementationsยง

Sourceยง

impl Clone for JiraConfig

Sourceยง

fn clone(&self) -> JiraConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) ยท Sourceยง

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Sourceยง

impl Debug for JiraConfig

Sourceยง

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Sourceยง

impl<'de> Deserialize<'de> for JiraConfig

Sourceยง

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Sourceยง

impl Serialize for JiraConfig

Sourceยง

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementationsยง

Blanket Implementationsยง

Sourceยง

impl<T> Any for T
where T: 'static + ?Sized,

Sourceยง

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Sourceยง

impl<T> Borrow<T> for T
where T: ?Sized,

Sourceยง

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Sourceยง

impl<T> BorrowMut<T> for T
where T: ?Sized,

Sourceยง

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Sourceยง

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Sourceยง

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Sourceยง

impl<T> CloneToUninit for T
where T: Clone,

Sourceยง

unsafe fn clone_to_uninit(&self, dest: *mut u8)

๐Ÿ”ฌThis is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Sourceยง

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Sourceยง

impl<T> From<T> for T

Sourceยง

fn from(t: T) -> T

Returns the argument unchanged.

Sourceยง

impl<T> Instrument for T

Sourceยง

fn instrument(self, span: Span) -> Instrumented<Self> โ“˜

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Sourceยง

fn in_current_span(self) -> Instrumented<Self> โ“˜

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Sourceยง

impl<T, U> Into<U> for T
where U: From<T>,

Sourceยง

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Sourceยง

impl<T> PolicyExt for T
where T: ?Sized,

Sourceยง

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Sourceยง

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Sourceยง

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Sourceยง

impl<T> Same for T

Sourceยง

type Output = T

Should always be Self
Sourceยง

impl<T> ToOwned for T
where T: Clone,

Sourceยง

type Owned = T

The resulting type after obtaining ownership.
Sourceยง

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Sourceยง

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Sourceยง

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Sourceยง

type Error = Infallible

The type returned in the event of a conversion error.
Sourceยง

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Sourceยง

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Sourceยง

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Sourceยง

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Sourceยง

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Sourceยง

fn vzip(self) -> V

Sourceยง

impl<T> WithSubscriber for T

Sourceยง

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> โ“˜
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Sourceยง

fn with_current_subscriber(self) -> WithDispatch<Self> โ“˜

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more