JetBrains / YouTrackSharp

.NET Standard 2.0 Library to access YouTrack API.
https://www.jetbrains.com/youtrack
Apache License 2.0
134 stars 105 forks source link

Cant return customFields #126

Closed EzioAuditore01 closed 1 year ago

EzioAuditore01 commented 1 year ago

Hi,

I am having problem with returning custom fields while using YouTrackSharp method " AdminProjectsIssuesGetAsync".

CustomFields fields is null and also "Begin date".Please see code below.

var res = await client.AdminProjectsIssuesGetAsync("0-6", customFields: "Begin date", fields: "summary,id,description,reporter(fullName)", top: 3);

Returning regular fields works fine.

Thank you in advance.

Best regards,

Boris

rekolobov commented 1 year ago

Hello,

customFileds param is used to filter out custom fields and leave only the one with matching name. But respective fields query is still required

So a proper way to call this would be

var res = await client.AdminProjectsIssuesGetAsync("0-6", customFields: "Begin date", fields: "summary,id,description,reporter(fullName),customFields($type,id,name,value($type,id,name))", top: 3);

If you think that we could add some wrapper to IssuesService for your convenience, please ping us back

EzioAuditore01 commented 1 year ago

Hi Roman,

Thank you very much. That's it :).

rekolobov commented 1 year ago

You're welcome! Glad I could help