Condition to make attribute mandatory on the basis of specific State and specific option from drop-down
Hi All,
I need little more help from you guys as i need to make a condition which will make another drop down mandatory in specific state, i have created a script for that but its not giving expected result.
could you please check if there is any mistake in following script, i'll be very much thankful to you. Scenario: There is an attribute(dropdown-1) which has two radio button (Yes / No), two states (FLA & SLA) and there is another attribute (dropdown-2) which in located on other tab if user select No from dropdown-1 and workitem reach to the State (FLA or SLA) then on other tab dropdown-2 while become mandatory Script: dojo.provide("org.example.workitems.providers.RFCIsaProjectNoFLASLA"); dojo.provide("com.ibm.team.workitem.api.common.WorkItemAttributes"); (function() { var WorkItemAttributes = com.ibm.team.workitem.api.common.WorkItemAttributes; dojo.declare("org.example.workitems.providers.RFCIsaProjectNoFLASLA" , null, { matches: function(attributeId, workItem, configuration){ var state = workItem.getValue("WorkItemAttributes.STATE"); var rfcvalue = workItem.getValue("attribute.rfcisaproject"); console.log(typeof (state)); if(state == "arabbank.workflow.rfcworkflow.state.s5" || rfcvalue == "enumeration.rfcisproject.literal.l3"){ return true; } return false; } }); })(); |
Accepted answer
when using custom attributes,
var rfcvalue = workItem.getValue("attribute.rfcisaproject"); you need to use the ID of the attribute.. mine are usually 'com.sd.workitemtype.attribute.name' com.sd.defect.attribute.some_name var rfcvalue = workItem.getValue("com.sd.defect.attribute.some_name"); Ralph Schoon selected this answer as the correct answer
Comments sam detweiler Thanks for the prompt response but the ID is correct i have already use the same ID for another condition, also have define my own naming convention for the attribute ID's
kindly please look into the script again.
sam detweiler
commented Aug 23 '15, 8:41 a.m.
Ok, many folks post something slightly different than actual values..
Sajjad Ali Khan
commented Aug 23 '15, 9:26 a.m.
sam detweiler you mean to say my script is correct i just need to correct '===' sign in my script ? right
if there is any other error in my script then please specify dear
sam detweiler
commented Aug 23 '15, 9:54 a.m.
I don't 'see' anything wrong specifically.
Don Yang
commented Aug 23 '15, 7:28 p.m.
Hi, Sajjad
|
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.