It's all about the answers!

Ask a question

Is there a script to help auto Increment a data field in a work item


Aaron Garcia (837) | asked May 29 '15, 12:51 p.m.

I need work items to increment sequentially for Rational Team Concert work items.

Specifically I have a Defect work item that has a defect number field that has the following convention (YYYY-nnn)starts with the current year and then wil lincrement 001, 002, 003.

Additionally, I have a Change Request work item that has a CR Number with this convention (Proj-CR-nnn) where Proj is the project name for the respective project, CR identified teh woek item and nnn is teh number of the CR and would increment sequentially.

Since RTC does not support independent and sequential numbering for unique work items, is there  script that can be modified to auto increment a field?  

2 answers



permanent link
Ralph Schoon (63.5k33646) | answered Jun 01 '15, 10:22 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Jun 01 '15, 10:32 a.m.
Aaron. please have a look at https://rsjazz.wordpress.com/2015/04/13/some-community-extensions-for-rtc/ especially RTC Work Item Numbering. You need to get an account on Dev Ops Services. I hope this helps.

Comments
Aaron Garcia commented Jun 01 '15, 11:07 a.m.

Comment, I appreciate the links however, I am having some difficulty trying to download this information form the Link. The server where my RTC is located has no access to the internet. Secondly, The version of IE we use her on my government location is not complatible with IBM Blumix DevOps. I can see the code with Firefox howver, I cannot see a way to download it.

Do you have any suggestions on how I can download and import this into a project on my RTC server?

I am not a developer so please be patient with me, I just want to find a solution to my issue.


Ralph Schoon commented Jun 01 '15, 11:15 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Sorry, I can't help you with that. Get a machine with internet access and install a vanilla RTC client to download the code. I can't attach or send that code.


permanent link
Donald Nong (14.5k614) | answered May 31 '15, 9:53 p.m.
RTC does maintain a sequence on the repository level. Since you can change the type of a work item in RTC, it does not make sense to maintain a sequence for each type. To that end, you will have to implement your own sequence, which can come in varied forms. I suggest you develop a RTC extension for this purpose. Ideally the sequence should be read and updated only on the server side to avoid conflicts. You can store the sequence (the current number) in a file on the server or in the database.

Comments
Aaron Garcia commented Jun 01 '15, 10:08 a.m.

Donald, I appreciate your answer, however, I understand how RTC works and why. What I need is a method to implement my own sequence. I do not want the new attribute filed to supercede the actual work item ID, I simply want to be able to increment an additional value that will increment each time a new work item of that type is created. Currently, I have to input these values manually buy looking at the last number in my query.

What I am hoping to do is to automate that process. I am sure this can be done with a script, however, I do not have the knowledge to write such a script and am looking for assistance from the forum.

Do you have experience with value provider script customization?


Donald Nong commented Jun 01 '15, 8:44 p.m.

If you want to use a client side JavaScript (calculated value or something else), you have some undesired results. For example, if two users try to create the same type of work items at almost the same time, you will end up with the same "sequence number". Also, there is no easy way to get the "maximum" number for a particular type on the client side. Besides, there may be performance hit if such query is run quite often. There are some of the reasons that I suggest against the "client side" idea.

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.