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

EWM 7.0.2 - Best way to limit hours estimate across whole tool UI

Hi all 


Can anyone recommend the best way to limit the amount of hours estimated against a single task that will work across the different UI elements? i.e. if someone is entering hours in a plan view, or in a standard work item view, or in quick planner, etc. 
e.g. Work Item save won't work if the execution work item estimate is greater than 80 hrs. 

Thanks, 

Glyn

0 votes



2 answers

Permanent link

Hi Glyn,


if you refer to the work item attributes estimate, corrected estimate, the only consistent solution I could come up with would be a pre-condition/advisor extension that prevents a work item save in case the attributes have undesired values.

0 votes


Permanent link
I agree with Ralph - I would use a Validator in the Work Item Attribute Customisation and then attach it to the Estimate attribute. The Estimate attribute is of type Duration so you will need to create a Script based Validator as the built in decimal or integer ones can't be attached to the field.

Something like this will work. Duration is returned in milliseconds, so you'll need to multiply by an appropriate factor - I've made the maths explicit below:

dojo.provide("com.example.estimateTooBig.Validator");

dojo.require("com.ibm.team.workitem.api.common.Severity");
dojo.require("com.ibm.team.workitem.api.common.Status");

(function() {

const Severity = com.ibm.team.workitem.api.common.Severity;
const Status = com.ibm.team.workitem.api.common.Status;

    dojo.declare("com.example.estimateTooBig.Validator", null, {
        validate: function(attribute, workItem, configuration) {
            return parseInt(workItem.getValue(attribute)) < (80 * 60 * 60 * 1000) ?
              Status.OK_STATUS :
              new Status(Severity["ERROR"], "That's way too big!!");
        }
    });

})();

Once you have attached the validator to the Estimate, you will also need to go into the Operation Behaviour section and add the Attribute Validation precondition in order for the validator to be evaluated and the error thrown upon Save

PS: You need to use the EWM Eclipse Client to do this

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
× 12,019

Question asked: Jul 12, 7:03 a.m.

Question was seen: 579 times

Last updated: Jul 14, 4:58 a.m.

Confirmation Cancel Confirm