“Capacity” field should be an integer value between 1 and 100 inclusive. I’d like to validate that value and throw an error message if outside that range, typically validation done upon hitting “Create”.
Do you have any apps, such as ScriptRunner? Without one of those, I don't know if you can accomplish this.
Yes, I have ScriptRunner.
In that case, one way to accomplish your goal is to create a "Simple Scripted Validator" with a Condition like this:
def capacityField = customFieldManager.getCustomFieldObjectsByName("Capacity")[0]def capacityValue = issue.getCustomFieldValue(capacityField)return capacityValue == null || ((int)capacityValue >= 1 && (int)capacityValue <= 100)
And an error message like this:
Capacity should have a value between 1 and 100, inclusive.
Is it possible to write Behavior for capacity field?
It looks like you're new here. Sign in or register to get started.