It's all about the answers!

Ask a question

Validator scripting help


Paul Grayem (21710) | asked Sep 18 '12, 4:09 a.m.
 Hi I'm trying to code a validator but struggling to get it working.

I have a WI and one of the tabs has a 20 or so review questions which has the custom enumeration values PASS and FAIL.

The reviewer should be able to answer these questions as necessary when in the REVIEW state so that any rework can be carried out by the producer. However once the review has been passed and sent to moderation state all the questions must be in a passed state. 

I have looked at examples to ty and code this but nothing seems to work

One answer



permanent link
Ralph Schoon (58.7k23642) | answered Sep 18 '12, 5:42 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Paul,

I am not sure what you try. If you try to make sure the work item can only moved into the Moderation State if all questions/answers are pass then I think you can't do this with a validator.

I think you would have to use a java based plug in precondition or advisor. It can detect a state change to the Moderation State and prevent the work item from saving. https://jazz.net/library/article/1000 has some gudance how this works. It implements a follow up action, but an advisor is only different as
  • It uses com.ibm.team.process.service.operationAdvisors
  • It also uses com.ibm.team.workitem.operation.workItemSave as operation ID (see https://jazz.net/wiki/bin/view/Main/CustomPreconditionsTable#operations for all id's)
  • It needs to implement IOperationAdvisor
The rest is pretty much the same.

Your answer


Register or to post your answer.