Search code examples
restyoutrackyoutrack-api

Apply Command to String-type custom fields with YouTrack Rest API


and thanks for looking!

I have an instance of YouTrack with several custom fields, some of which are String-type. I'm implementing a module to create a new issue via the YouTrack REST API's PUT request, and then updating its fields with user-submitted values by applying commands. This works great---most of the time.

I know that I can apply multiple commands to an issue at the same time by concatenating them into the query string, like so:

Type Bug Priority Critical add Fix versions 5.1 tag regression

will result in

  • Type: Bug
  • Priority: Critical
  • Fix versions: 5.1

in their respective fields (as well as adding the regression tag). But, if I try to do the same thing with multiple String-type custom fields, then:

Foo something Example Something else Bar P0001

results in

  • Foo: something Example Something else Bar P0001
  • Example:
  • Bar:

The command only applies to the first field, and the rest of the query string is treated like its String value. I can apply the command individually for each field, but is there an easier way to combine these requests?

Thanks again!


Solution

  • This is an expected result because all string after foo is considered a value of this field, and spaces are also valid symbols for string custom fields.

    If you try to apply this command via command window in the UI, you will actually see the same result.