Behaviour: Validation on FieldChange - how to get originalIssue Value?


I want to create a field check in a behaviour.

When the field “duedate” is changed, i want to validate if the new value is in the future. If it’s not changed, it can be also in the past.

As far as i know i cannot use “issue” in behaviour, instead of it i must use underlyingIssue.

To compare if a field is changed i use usualy the simple line:
issue.duedate != originalIssue.duedate

Is there anything similar i can use in behaviour?

Best Regards

Hi @Man
If the behaviour is configured to be executed only when the date changes you have a method available to obtain the information of the updated field.

def dueDate = getFieldById(getFieldChanged())

With this line you obtain the field that has been updated, and you are able to obtain the value using

def selectedOption = dueDate.getValue() // Here be careful with the variable types.

after that, you will have the new value for due date, and you can compare it with the value stored in the underlyingIssue variable.

Let me know if this helps!

Thanks, Ivan.