It's all about the answers!

Ask a question

How can I make one attribute mandatory if another attribute is set to a certain value?


Wei Wei (111) | asked Feb 21 '18, 5:33 a.m.
edited Feb 21 '18, 5:53 a.m. by Ralph Schoon (63.2k33646)

I have 2 customized attribute Promote Status and Promote Date, Promote Status have below 3 possible values:
Not applicable
Deployed
Deferred

I want to make Promote Date mandatory, that requires editor to enter a Date when the Promote Status is set to Deployed.

How can I achieve this ?

Accepted answer


permanent link
Ralph Schoon (63.2k33646) | answered Feb 21 '18, 5:52 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Two options:

  • An attribute customization condition and the required attribute for condition precondition/advisor
  • A custom advisor

I would suggest option 1 go here:

  1. https://jazz.net/library/article/1003
  2. https://jazz.net/wiki/bin/view/Main/AttributeCustomization


Ralph Schoon selected this answer as the correct answer

Comments
Wei Wei commented Feb 22 '18, 8:52 a.m. | edited Feb 23 '18, 2:44 a.m.

Thank you Ralph, I looked into the articles about option 1. This is what I found for script-based condition: condition is not associated with any particular attribute and there is no attributeId argument. I'm not seeing a way to get my desired approach here, to get the value of Promote Status and then based on the value to determine the necessarity of Promote Date.

Am I looking into the wrong direction here ? Could you please elaborate on option 1 here ? Your help would be really appreciated.


Ralph Schoon commented Feb 23 '18, 2:46 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

! and 2 are related. " is the more in depth description.

From https://jazz.net/wiki/bin/view/Main/AttributeCustomization#Conditions :

Whenever the user saves a work item, all conditions will be evaluated. If a condition is met any associated attributes will be required.


I am pretty sure an attribute customization condition together with the operational behavior required attribute for condition is the simplest approach.

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.