You can control project’s permission schema to control who can log work on an issue or use workflow status properties to control on which statuses work can be logged on an issue but sometimes you may need more complex controls. Following scripts are just examples of such conditions all of which are required by some of our customers.
Don't Allow Logging Work If Remaining Estimate is Zero or Not Specified
Following scripts do not allow any worklog if remaining estimate of an issue is zero or not specified. This script works on 'Before Worklog Create/Update' script type.
Code Block |
---|
def issue = worklog.getIssue();
def remainingEstimate=issue.getEstimate();
if (remainingEstimate== null || remainingEstimate == 0 ) { //no remaining estimate on issue, don't allow logging work
return "Can't log work because the remaining estimate is '0' or 'Not Specified'";
} |
Don't Allow Logging Work Higher Than Remaining Estimate
...