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

Error casting types #112

Closed gh-pp closed 3 years ago

gh-pp commented 3 years ago

Expected behavior

Valid casting EnumBundleElement

Actual behavior

While Im trying to fetch data via issueService.GetIssue after upgrade to version 2021.3.3 I get an error

Unable to cast object of type 'YouTrackSharp.Generated.EnumBundleElement' to type 'YouTrackSharp.Generated.StateBundleElement
rekolobov commented 3 years ago

@gh-pp Could you please provide a bit more details about configuration and values of particular field in your tracker? Thanks!

gh-pp commented 3 years ago

Thats is what i've found in api response:

Screenshot 2021-07-29 at 11 10 37
rekolobov commented 3 years ago

Released 2021.3.4 and published to NuGet

Please check if your issue was indeed diagnosed correctly and fixed

gh-pp commented 3 years ago

Everything works fine, thank you

robbrunato commented 1 year ago

We are seeing the opposite trying to get an issue with a state machine attached. image

If I remove the state machine we are able to get the issue. YouTrackSharp 2022.3.0 and YouTrack 2022.3.63553.

rekolobov commented 1 year ago

@robbrunato Hello, thank you for the report and sorry for the extremely late reply. I've committed the fix in ae84138575a0bcd08414805a87bf626367a87036 along with the tests for all field types to not miss similar stuff again. Expecting to release it in the scope of 2022.3.1 tomorrow