Define a unique/continous ID for a specific work item type?
![]() Hello, There is a need to have an integer attribute for a specific work item type which will start with 1 and keep increasing sequencially/continously when new items are (being) created. What is the (best) way to implement this (including the coverage of synchronization if multiple users are creating new work items at the same time)? Thanks much in advance |
2 answers
![]()
the problem with Default value (and javascript implementation) in my mind is that the number needs to increment before it is shown, and the save of the workitem could be abandoned, thus causing gaps in the numbering.
if you don't care about gaps in the numbering sequence. My users would ask, why are 4, 20 and 27 missing, and I would have to go off and figure out why,. is it a bug, or an operation problem, or result of some user action.. race conditions are always fun the persistent storage of the last assigned number will need to be someplace reliable.. a web service maybe.. so, for me the participant gets the next number from the web service, which implements all the concurrency/race condition handling code. the workitem is already saved at this point, and you get the unique value (guaranteed from the web service) and apply it to the workitem presented to the participant. |