It's all about the answers!

Ask a question

Validator for work item type in parent-child attribute


Luca Martinucci (1.0k294112) | asked Jun 13 '12, 4:04 a.m.
I'm a newbie in RTC customization, and I need to define a validator for a links-type attribute.
This attribute must contain (as children) only work items of a certain type.
So, the validator should check for the type attribute of children and return an error if one of the children is not of the "right" type.
Can anybody provide me a sample .js code that does this validation?

Accepted answer


permanent link
Ralph Schoon (63.1k33646) | answered Jun 13 '12, 4:11 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi Luca, as far as I know this can not be done with a scripted extension. Java Script only allows you to access and manipulate certain types of attributes. Relationships are not included.

I would suggest reading https://jazz.net/library/article/784. It points to many resources. The Extensions Workshop https://jazz.net/library/content/articles/rtc/3.0.1/extensions-workshop/ is a good way to start writing these extensions. It shows development of a followup action. you want a precondition, but the basics are the same.

 
Luca Martinucci selected this answer as the correct answer

Comments
Vladimir Amelin commented Jun 14 '13, 6:31 a.m.

Hi Ralph,

Are there any enhancements in 4.0.x regarding relationships validation?


Ralph Schoon commented Jun 14 '13, 6:39 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Vladimir Amelin commented Jun 14 '13, 6:46 a.m.

Thank you!

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.