It's all about the answers!

Ask a question

REST API command to find the next available work item ID (or the highest used ID)?


Mike Shkolnik (9809161143) | asked Mar 21 '14, 12:56 p.m.
I need a single HTTP command to return data that includes the next available work item ID or highest used ID for the currently logged-in repository.

Comments
Geoffrey Clemm commented Mar 21 '14, 1:42 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Just for interest's sake, what would you use that information for?


sam detweiler commented Mar 21 '14, 2:16 p.m.

and not to be a downer, but I don't think that info is available.  query for the highest is by project area, not server wide. and could change instantaneously anyhow.  


Mike Shkolnik commented Mar 21 '14, 2:22 p.m.

"for x := 1 to maxworkitemid do..."


Mike Shkolnik commented Mar 21 '14, 2:23 p.m.

Sam, what is the query by project area?


Geoffrey Clemm commented Mar 21 '14, 2:26 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Note that the work item ID's are unique across the entire repository ... not per project area.   So if a work item in some project area is number 15347, then that is the only work item in the repository that can have that ID.


Mike Shkolnik commented Mar 21 '14, 2:32 p.m.

I know that, but I'll take any query I can get right now that gives me a reasonably close number. :) I am not looking for an available number to create, just a max number for testing the data. I could even overshoot and be ok, but the more I overshoot, the longer it will take to run the report.


sam detweiler commented Mar 21 '14, 2:34 p.m.

you could query all the workitems in a project, sorted by id, highest to lowest. set the pagesize small, get the first page full and take the first. 


but they won't be sequential. 

but more importantly, why are you traipsing thru all the workitems? this is very negative behavior for a system.
 


Mike Shkolnik commented Mar 21 '14, 2:36 p.m. | edited Mar 21 '14, 2:36 p.m.
showing 5 of 8 show 3 more comments

Be the first one to answer this question!


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.