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
![]()
Ralph Schoon (63.3k●3●36●46)
| answered Apr 28 '21, 2:31 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER 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.
Marcelo Bilezker selected this answer as the correct answer
|
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.