Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

RTC custom work item script-based validator for unique value

I need to identify a method of ensuring a unique value in a small string attribute of a custom work item within Rational Team Concert (RTC).  Ideally, the simplest solution, such as a database column constraint, would be best.  However, a script-based validator for the attribute would be acceptable as well.  If a script-based validator is the best or only method to accomplish this desired action the actual code to implement this solution would be helpful.

0 votes


Accepted answer

Permanent link

Script-based validators are based on, JavaScript. I would imagine it is painfully slow if you implement it this way. To ensure the uniqueness, you will have to retrieve all existing work items and compare the intended value with the existing values, which can take a long time.

A database unique index may not be easy to implement either because you cannot map the work item type to a table and the attribute to a column. Even you can somehow implement it, how to handle the database exception is another question - you want to capture the exception and throw a new error with your own message telling the users what's happening.

How should this unique value look like? Does a timestamp (in milliseconds) meet the requirement?

Darin Hodgson selected this answer as the correct answer

0 votes

Comments

Unfortunately, a timestamp (in milliseconds) would not meet the requirement.  I understand your response that since the JavaScript would need to "retrieve all existing work items and compare the intended value with existing values..." and that this would be time consuming.  Based on this information we'll not expend any more effort on using a script-based validator for the purpose of preventing a duplicate attribute value from being entered.  Instead, maybe we'll just attempt to train our users to look for the existence of the value before entering a new work item.  Thanks for the response.


One other answer

Permanent link

 Maybe get inspiration here: 
Extension to generate unique custom work item numbers

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 7,496
× 6,122

Question asked: Jun 27 '17, 7:44 p.m.

Question was seen: 2,213 times

Last updated: Jun 28 '17, 1:00 p.m.

Confirmation Cancel Confirm