Changing Subsystem list via the REST API
Is it possible to modify subsystems list of project via Rest-API?
You have good documentation for getting values of projects subsystem but no any information about modifying collection.
Please sign in to leave a comment.
Hello,
At first you need to get project custom field and setup param set to bundle (https://www.jetbrains.com/help/youtrack/standalone/GET-Project-Custom-Field.html?search=rest), then you'll need to add elements to subsystem bundle: https://www.jetbrains.com/help/youtrack/standalone/Update-Owned-Field-Bundle.html?search=rest .
Can we ask for more examples?
As i understand, i must to invoke get request to `https://{yt_url}/rest/admin/project/{Project_Name}customfield/subsystem`
In the response will be object like
{"name":"Subsystem","type":"ownedField[1]","emptyText":"No Subsystem","canBeEmpty":false,"param":[{"name":"bundle","value":"D8A27AAF-05D6-41A7-AC9F-E69644B231CF"}],"defaultValue":["No subsystem"]}
I must to take `value` from `param` and invoke next request: get
`https://{yt_url}/rest/admin/customfield/ownedFieldBundle/D8A27AAF-05D6-41A7-AC9F-E69644B231CF`
In the response i will see current state of the field. At the next i modify collection (for example add new subsystem sub-object) and invoke request for creating new bundle
put `https://yt.skbkontur.ru/rest/admin/customfield/ownedFieldBundle` (with new name)
But at the last request i got error `{"value":"Unsupported Media Type"}`, in yt logs it seems like
01 Sep 2017 10:48:06,238 WARN [BaseExceptionMapper ] [qtp1210388259-42917 ] [internal@46.17.202.12] REST exception for URL: /rest/admin/customfield/ownedFieldBundle
Can you give more examples? It wiil be great if you give full subset of request, that we need to execute for adding one new subsystem to existing project (with content examples)
Sorry for the misleading, the correct second method is https://www.jetbrains.com/help/youtrack/standalone/Add-Owned-Field-to-Bundle.html?search=rest . There is an example on the page.
Could you please post here your request, if it's unsuccessful.
Also what do you send in header Content-type?
Thanks for you. It works!