lvermeulen / Bitbucket.Net

C# client for Atlassian Bitbucket Server
MIT License
32 stars 18 forks source link

Getting comments and tasks under a comment in a pull request? #17

Closed jlpatte2 closed 3 years ago

jlpatte2 commented 3 years ago

I love this library, and am trying to understand if I am just misunderstanding how it works, or if I have a feature request ;) when I look at the json data for a pull request, there is a comments and tasks parameter array. However this library doesn't have a comments nor tasks array inside of Comment. I can't figure out how to recursively dig into the tree of comments.

Thank You, Josh

jlpatte2 commented 3 years ago

So I was able to "enable" both of these features with the following simple addition: comment.cs: public List Comments { get; set; } public List Tasks { get; set; } Additionally while playing with this I think I identified another bug where Comment.cs uses type Participant for Author, when it should use type User.

jlpatte2 commented 3 years ago

src/Bitbucket.Net/Models/Core/Projects/Comment.cs | 6 +++++- src/Bitbucket.Net/Models/Core/Projects/CommentAnchor.cs | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/Bitbucket.Net/Models/Core/Projects/Comment.cs b/src/Bitbucket.Net/Models/Core/Projects/Comment.cs index cdcdcf3..555b479 100644 --- a/src/Bitbucket.Net/Models/Core/Projects/Comment.cs +++ b/src/Bitbucket.Net/Models/Core/Projects/Comment.cs @@ -1,6 +1,8 @@ using System; using System.Collections.Generic; using Bitbucket.Net.Common.Converters; +using Bitbucket.Net.Models.Core.Tasks; +using Bitbucket.Net.Models.Core.Users; using Newtonsoft.Json;

namespace Bitbucket.Net.Models.Core.Projects @@ -14,7 +16,9 @@ namespace Bitbucket.Net.Models.Core.Projects public DateTimeOffset? CreatedDate { get; set; } [JsonConverter(typeof(UnixDateTimeOffsetConverter))] public DateTimeOffset? UpdatedDate { get; set; }

lvermeulen commented 3 years ago

Thanks, @jlpatte2 ! It's in release 2.1.12