Available states with YouTrackSharp

Hello,

While using YouTrackSharp, let's say I have a YouTrackSharp.Issues.Issue object, and I queried the field, called "State". It is what you would expect, the field can be Open, In progress, etc.

Is there a way to retrieve the possible values for such a field? I have tried looking at the Admin... functions, but can't figure this out.

Thank you for the help.

3 comments
Comment actions Permalink

Hi!

I'm Sergey from the YouTrack team.

I'm sorry for the delayed reply. Generally, if you'd like to get in touch with our support team directly for a quick answer to your question, please fill in a direct request at https://youtrack-support.jetbrains.com/hc/en-us/requests/new. We'll be happy to help.

Answering your question — you should use this method: AdminCustomfieldsettingsBundlesStateValuesGetAsync("{id}"), where id is the field's database ID. For other field types, the method is similar, e.g., AdminCustomfieldsettingsBundlesEnumValuesGetAsync() for enums and so on.

If any questions appear, please let me know.

0
Comment actions Permalink

Hello. Thank you for this answer. I'll look into it soon.

What if with different projects, we have different possibilities for Status. In that case the ID of Status is actually different for each project? If so, how do I get an ID for the Status of a specific project? Or the result of AdminCustomfieldsettingsBundlesStateValuesGetAsync can be used to check the possible values per project?

Thank you.

0
Comment actions Permalink

Thanks for your response.

One field can have multiple bundles (sets) of values. To find an id in a specific project, you can use AdminProjectsCustomfieldsGetAsync(). Note that it requires Project admin permissions.

Other than that, you can use various workarounds like checking a specific issue in the project and looking up its bundle's id of the required field or trying to create a draft and doing the same. All of these can be done via the library.

0

Please sign in to leave a comment.