Ido Ganzer
Ido Ganzer

Reputation: 88

YouTrack rest api - Get fields metadata

I want to create issues with the youtrack rest api, Currently I'm using:

PUT /rest/issue?{project}&{summary}&{description}&{attachments}&{permittedGroup}

but I want to set other fields (priority, type, subsystem...)

How do I get a list of available fields from the api? and the fields metadata(is mandatory, field type...)?

And after that, How do I set the value of these fields?

I found this in the docs: https://confluence.jetbrains.com/display/YTD6/Apply+Command+to+an+Issue

but it looks too complex for setting a field.

Upvotes: 1

Views: 1930

Answers (1)

Andrey Tigay
Andrey Tigay

Reputation: 444

Issue can be created with following method and fields set only https://confluence.jetbrains.com/display/YTD6/Create+New+Issue . So as you mentioned, it's

PUT /rest/issue?{project}&{summary}&{description}&{attachments}&{permittedGroup}

It's assumed, other fields can be updated within next call. ApplyCommand (https://confluence.jetbrains.com/display/YTD6/Apply+Command+to+an+Issue)method is pretty good example of such a method.

If you need to know all available fields in the projects, here is the method https://confluence.jetbrains.com/display/YTD6/GET+Project+Custom+Fields. Meta can be called with the following https://confluence.jetbrains.com/display/YTD6/GET+Project+Custom+Field. As you can see, details are available on per field basis.

Upvotes: 1

Related Questions