From 3f42a08bcb8c421db421d14be9db309c939c2cf1 Mon Sep 17 00:00:00 2001 From: "Brian J. Tarricone" Date: Wed, 20 Sep 2023 18:17:27 -0700 Subject: [PATCH] Use iid field (and not id) field for the correct issue ID --- src/event.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/event.rs b/src/event.rs index 4f1a140..0125d3e 100644 --- a/src/event.rs +++ b/src/event.rs @@ -185,7 +185,7 @@ impl fmt::Display for IssueAction { #[derive(Debug, Deserialize)] pub struct IssueObjectAttributes { - pub id: u32, + pub iid: u32, pub title: String, pub action: IssueAction, pub url: String, @@ -406,7 +406,7 @@ impl GitlabEventExt for GitlabEvent { if object_attributes.action != IssueAction::Other { let title = format!( "Issue #{} **{}**: {}", - object_attributes.id, object_attributes.action, object_attributes.title + object_attributes.iid, object_attributes.action, object_attributes.title ); vec![markdown_link(&title, &object_attributes.url)] } else { @@ -587,7 +587,7 @@ mod test { .. } => { assert_eq!(user.name, "Administrator"); - assert_eq!(object_attributes.id, 301); + assert_eq!(object_attributes.iid, 23); assert_eq!(object_attributes.action, IssueAction::Open); } _ => panic!("not an issue event"),