It's all about the answers!

Ask a question

Generate a unique consecutive id for a workitem type

Prakash Behrani (28910) | asked May 31 '13, 3:56 p.m.

How can I generate a unique string id for records of a work item type.

For instance, I have a work item of type SCR (custom type).

I would like the first SCR to get an id of SCR00001 (value of a custom attribute) and the second one to get an id of SCR00002 and so on.

Is this possible with RTC?  This was really easy to perform with ClearQuest. 

Are there any code samples etc. available that show how to do this?


2 answers

permanent link
Stephanie Bagot (2.1k1513) | answered Jun 04 '13, 11:38 a.m.
This is not available out of box with RTC, since our work item ID's are purely numbers. What you could do is set up a script based condition so that when a new work item is created, it sets a custom attribute to your SCR number + 1. Therefore, all your queries can point to that custom attribute and not the ID of the work item.

Prakash Behrani commented Jul 16 '13, 1:05 p.m.


How would I get the previous SCR number?

Is there is global attribute which can hold a SCR number value for the last SCR that was created?



permanent link
Stephanie Bagot (2.1k1513) | answered Jul 17 '13, 9:15 a.m.
You would have to find a way to script it.
There is nothing out of the box that would suffice your request, and thus no global attributes. This would all need to be customized.

Your answer

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.