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.netformat - Server/Data Center: Uses custom domain like
https://jira.company.com - Local Development: Can use
http://localhost:8080for testing
Fieldsยง
ยงlogin: StringJira 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: StringBase 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
impl JiraConfig
Sourcepub fn module() -> ConfigModule
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.
Sourcepub fn init(config: &Option<Self>) -> Result<Self>
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
- Username: Prompts for Jira username (or email for cloud instances)
- 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
impl Clone for JiraConfig
Sourceยงfn clone(&self) -> JiraConfig
fn clone(&self) -> JiraConfig
1.0.0 (const: unstable) ยท Sourceยงfn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more