rujira 0.4.1

This module provides an API for working with Jira
Documentation
use dotenv::dotenv;
use rujira::*;
use serde_json::json;
use tracing_subscriber::{fmt, EnvFilter};

#[tokio::main]
async fn main() {
    dotenv().ok();
    fmt()
        .with_env_filter(EnvFilter::from_default_env())
        .compact()
        .init();
    let bot = Rujira::new().from_env_handler();
    let Ok(me) = crate::api::myself::get(bot.clone()).apply().await else {
        todo!()
    };
    tracing::debug!(?me);
    let Some(name) = me.data["displayName"].as_str() else {
        todo!()
    };
    let Ok(project) = crate::api::project::create(bot.clone(), "ITMG", "iTmage", "software", name)
        .add_payload("description", json!("Custom field added by bot"))
        .apply()
        .await
    else {
        todo!()
    };
    tracing::debug!(?project);
    let fields = json!({
        "project": { "key": "ITMG" },
        "summary": "BOT: added a new feature.",
        "description": "This task was generated by the bot when creating changes in the repository.",
        "issuetype": { "name": "Task" },
    });
    let Ok(issue) = crate::api::issue::create(bot.clone(), fields, false)
        .apply()
        .await
    else {
        todo!()
    };
    tracing::debug!(?issue);
    let project = crate::api::project::delete(bot.clone(), "ITMG")
        .apply()
        .await;
    tracing::debug!(?project);
}