Import REST API doesn't support automatic numbering

In the YouTrack web interface, new issues are automatically assigned a new ID based on the last ID that was stored.

I'm importing work items into YouTrack using REST import. I want the new items to be automatically numbered. However, if the "numberInProject" field is not specified, the response is "Field is required".

Is there a way to find the last ID that was stored so I can use it in the numberInProject field?

One way: use import/{project}/issues?test=true passing in new numberInProject values until I get a good status code. There must be a better way.
1 comment
Comment actions Permalink
https://youtrack.jetbrains.com/issue/JT-26487 is related, but doesn't describe any solutions.

Perhaps the solution is to use a combination of PUT /issue and then POST /issue/{issue}/execute to add the other fields? Seems counterintuitive to use two web requests per issue rather than a single request with all the new work items. If this is indeed the right solution I second JT-10043: please add a way to do this in a single call per issue, and ideally in a single call for all new issues.
0

Please sign in to leave a comment.