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

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?


 

0 votes


Accepted answer

Permanent link

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

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
× 1,220
× 8

Question asked: Apr 27 '21, 5:43 p.m.

Question was seen: 615 times

Last updated: Apr 28 '21, 2:31 a.m.

Confirmation Cancel Confirm