Skip to main content

JiraConfig

Struct JiraConfig 

Source
pub struct JiraConfig {
    pub login: String,
    pub api_url: 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.

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(),
});

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<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> 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<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