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

Problem with condition based script

I have a Condition based script. Basically, for a specific WI type, I want to validate a field, and depending on the value selected on that field, I need to make another field mandatory.

My script is basically working right now, but I found another implication of this, and would like to know how to solve.

My problem is that in the way that you configure a condition script, it is not tied to a specific work item, so it runs for every work item type. The first thing that comes to my mind is a performance issue: I'm not facing the performance issue now because I do not have too much conditions implemented, but wondering if this will be a problem in the near future.

What I noticed with this implementation -and here is the deal- is that, as it works for all the work item types, and the attribute that I'm looking for is not present on all the work items, it exists with "return false". This makes all the red asterisks of mandatory fields to dissapear from my UI.
I still get the errors for the remaining fields, but one by one, and no red asterisk.

Is there anything that I should do different on this script or any kind of workaround to my problem? Thanks in advance!
Claudia


dojo.provide("org.example.workitems.providers.WPIOtherChecklists");

dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");

(function() {
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;

dojo.declare("org.example.workitems.providers.WPIOtherChecklists", null, {

matches: function(workItem, configuration) {

var checklists = workItem.getValue("com.ibm.gbs.workitem.wpi.checklists");

if ((checklists == null) || (checklists.indexOf("wpi.checklists.literal.l25") === -1) ) {
// WPI >> Checklists DOES NOT contain the value 'Other' selected
return false;
} else {
// WPI >> Checklists contains the value 'Other' selected
return true;
}
}
});
})();

0 votes



2 answers

Permanent link
One additional information... the problem regarding missing red asterisks for mandatory fields, is happening only on the web client. (eclipse works fine)

0 votes


Permanent link
For those following this threat, I have raised a bug to Rational. Link below.

https://jazz.net/jazz/web/projects/Rational%20Team%20Concert#action=com.ibm.team.workitem.viewWorkItem&id=174570

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

Question asked: Aug 18 '11, 12:12 p.m.

Question was seen: 5,143 times

Last updated: Aug 18 '11, 12:12 p.m.

Confirmation Cancel Confirm