RTC: It is possible in a script validator to clean an error mark of another workitem?
I wrote a script validator that checks some data on one field. It returns as Error with:
var Severity= com.ibm.team.workitem.api.common.Severity;
var Status= com.ibm.team.workitem.api.common.Status;
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;var message = "This is an error";
var severity= configuration.getChild("script").getStringDefault("severity", Severity.ERROR.name);
return Status(Severity[severity], message);
this is fine and works ok.
Now, changing other field, (with same validator), I must clean the error in the other field I put before.
Can this be achieved?
Accepted answer
I would strongly recommend to look into https://jazz.net/wiki/bin/view/Main/AttributeCustomization
You do not clear errors for other attributes. The way attribute customization works, especially JavaScript, is that the customization returns information when called. A validator returns a status for the attribute it is configured for. The validator is called on creation, each time the attribute changes its value, and if other attributes that are configured as dependency for this attribute. The validator returns a status every time it is executed.
Attribute customization configured for an attribute never impacts the behavior or value of another attribute in the work item or in any other work item.
So you will have to configure a validator for the second attribute and that validator has to return the correct status for the attribute.