Welcome to the Jazz Community Forum
How to create a Condition for Dynamic Required Attributes?

Hi,
I've got a "Dynamic Required Attributes" precondition on the Save Work Item (server) operation, and I've created a Condition for one of my work item types according to the skeleton on https://jazz.net/wiki/bin/view/Main/AttributeCustomization#Conditions But at this point in the configuration I've got stuck - when I go to Attribute Customization in order to add the condition I don't see a Category for that, only Default Values, Calculated Values, Value Sets and Validators. Am I looking in the right place?
Andrew.
I've got a "Dynamic Required Attributes" precondition on the Save Work Item (server) operation, and I've created a Condition for one of my work item types according to the skeleton on https://jazz.net/wiki/bin/view/Main/AttributeCustomization#Conditions But at this point in the configuration I've got stuck - when I go to Attribute Customization in order to add the condition I don't see a Category for that, only Default Values, Calculated Values, Value Sets and Validators. Am I looking in the right place?
Andrew.
4 answers

Which client version are you using? The Wiki page specifically mentions 3.0.1. I am using 3.0.1.2 and "Conditions" shows up between "Value Sets" and "Validators" on my Attribute Customization page.
Millard
Ah, that's probably it - although the server's running 3.0.1.1, the plugin version in our corporate locked-down pre-packaged desktop client installations is 3.0.0! So the Dynamic Required Attributes precondition is available in the list since it's on the server, but the client doesn't know about the Conditions that I need to configure it. And the web interface doesn't appear to include the Attribute Customization section, so I can't do it through that either...
Thanks for the clue. Guess I need to pester our support helpdesk for a plugin upgrade :-)
In the meantime, can anyone post a sample of the equivalent Process Configuration Source XML (both com.ibm.team.workitem.configuration.providers configuration-data and com.ibm.team.workitem.advisor.requiredAttributes precondition sections) so I can edit it directly? Hopefully, since the server's the right version, that'll let me get it working.
Andy.

In the meantime, can anyone post a sample of the equivalent Process Configuration Source XML (both com.ibm.team.workitem.configuration.providers configuration-data and com.ibm.team.workitem.advisor.requiredAttributes precondition sections) so I can edit it directly? Hopefully, since the server's the right version, that'll let me get it working.
Andy.
I did a quick Condition configuration using the sample JS (offered by the configuration dialog you can't see yet) and setup with Due Date as the dynamically required attribute. Here are the snippets of XML per your request:
[configuration-data xmlns="http://com.ibm.team.workitem/providers" final="false"
id="com.ibm.team.workitem.configuration.providers"]
[conditions]
[condition id="com.ibm.team.workitem.valueproviders.CONDITION._ZdvbcEkPEeGoL__Ovvw9JA"
name="SampleCondition"
providerId="com.ibm.team.workitem.shared.common.internal.valueProviders.ScriptAttributeValueProvider"]
[script class="com.example.Condition" path="/workitem/scripts/common/sample-condition.js"/]
[/condition]
[/conditions]
[/configuration-data]
[precondition xmlns="http://com.ibm.team.workitem/requiredAttributes"
description="Verifies that a work item can only be saved if all required attributes are given."
id="com.ibm.team.workitem.advisor.requiredAttributes" name="Dynamic Required Attributes"]
[requiredAttributes ruleId="com.ibm.team.workitem.valueproviders.CONDITION._ZdvbcEkPEeGoL__Ovvw9JA"]
[attribute id="dueDate"/]
[/requiredAttributes]
[/precondition]
Hope that helps! Sorry about the brackets, but I completely failed in my attempts to format the XML to display reasonably here.
Millard Ellingsworth
IBM Rational Team Concert Development