jira-terminal 2.5.0

This is a command line application that can be used as a personal productivity tool for interacting with JIRA
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::config;
use crate::jira::{api, utils};

pub fn assign_task(ticket: String, user: String) {
    let aliased_query = config::get_alias_or(user);
    let account_id = utils::get_account_id(aliased_query);
    let payload = json::object! {
        "accountId": account_id
    };
    let update_response = api::put_call(format!("issue/{ticket}/assignee"), payload, 3);
    if update_response.is_err() {
        eprintln!("Error occurred While assigning the ticket.");
        std::process::exit(1);
    }
    let response = update_response.unwrap();
    println!("Successfully Assigned {response}");
}