allow to assign automatically current user on new work package
This commit is contained in:
@@ -1,18 +1,22 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
use crate::gitlab::issue::IssueBundle;
|
||||
|
||||
#[derive(Serialize, Debug)]
|
||||
pub struct WorkPackageWriterAssignee {
|
||||
pub(crate) href: String,
|
||||
}
|
||||
#[derive(Serialize, Debug)]
|
||||
pub struct WorkPackageWriter {
|
||||
subject: String,
|
||||
pub(crate) subject: String,
|
||||
#[serde(alias = "type")]
|
||||
work_type: String,
|
||||
description: DescriptionWriter,
|
||||
pub(crate) work_type: String,
|
||||
pub(crate) description: DescriptionWriter,
|
||||
pub assignee: Option<WorkPackageWriterAssignee>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Debug)]
|
||||
pub struct DescriptionWriter {
|
||||
format: String,
|
||||
raw: String,
|
||||
pub(crate) format: String,
|
||||
pub(crate) raw: String,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Debug)]
|
||||
@@ -20,17 +24,3 @@ pub struct WorkPackage {
|
||||
pub id: u64,
|
||||
pub subject: String,
|
||||
}
|
||||
|
||||
impl From<&IssueBundle> for WorkPackageWriter {
|
||||
|
||||
fn from(value: &IssueBundle) -> Self {
|
||||
WorkPackageWriter {
|
||||
subject: format!("{} ({}/{})", value.issue.title, value.project.name_with_namespace, value.issue.iid),
|
||||
work_type: "TASK".into(),
|
||||
description: DescriptionWriter {
|
||||
format: "markdown".into(),
|
||||
raw: format!("From gitlab: {}", value.issue.web_url)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user