It's all about the answers!

Ask a question

Validator to check and throw an error message when Time Spent attribute value is greater than Estimate attribute value

Divya _ (254) | asked Jul 13 '22, 11:25 a.m.
Hello Team,

We need an error message to be triggered when the Time Spent Value is entered greater than the Estimate/Correction Value and the WI should not be allowed to Save.
I tried writing a script to implement this validation but it is not working as expected. It is not validating the condition when time spent is greater than estimate and throwing the error message irrespective of the value in time spent.
(Version: 7.0.2)

Could you please help and let me know if I'm missing something?


(function() {
    var doDebug = true;
     Status =,
     Severity =,
     timeSpent = "timeSpent",
     estimate = "duration",
     WorkItemAttributes =,
     dojo.declare("", null, {
     validate: function(attribute, workItem, configuration) {                     
return Status.OK_STATUS;
        } else {
            return new Status( Severity["ERROR"], " Time Spent value is greater than the Estimate. Please correct the Estimate value.");

Thanks in advance.

Accepted answer

permanent link
Ralph Schoon (63.1k33646) | answered Jul 14 '22, 2:43 a.m.

 Several suggestions. 

  1. shows definition for a the attribute ID's including the ones you want.
  2. Use console.log. E.g. console.log("Estimated Invest: " + estimatedInvest); 
  3. The log data is in \JazzTeamServer\server\liberty\servers\clm\workarea\org.eclipse.osgi\92\data\temp\default_node\SMF_WebContainer\ccm\ccm\eclipse\workspace.metadata.log if you use Liberty Profile.
  4. More tips in 
  5. I assume you get a string back, so do not assume >= works.
  6. You need to configure the Attribute Validation Precondition for validation to do anything.

Divya _ selected this answer as the correct answer

Your answer

Register or 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.