Hi Dear Colleagues,I need a script for behavior, that will not allow selecting past date when creating a ticket for the date-time picker field. I have a scriptrunner and want to do it with behavior. Or advise another solution.
A server-side script attached to the date field works like this:
import com.onresolve.jira.groovy.user.FormFieldFormField dateField = getFieldById(getFieldChanged())Date value = (Date) dateField.getValue()Date today = new Date()if (value != null && value.before(today)) dateField.setError("Date must not be in the past")else dateField.clearError()
Hi @Gor Greyan
I have provided a similar solution in this Community Post.
In the Community Post link provided, the Behaviour will throw an error if the Completion Due date is before the Issue Submission date.
Please take a look and let me know if you need further help with the code.
Thank you and Kind regards,Ram
Hi, Dear @Radek DostálThanks for the provided script, it worked for the create screen, but from the Customer Portal it is not working, but I did mapping with the issue type.Please advice.
You need to add service management mapping to the behaviour to make it work on portals (software and service desk both need specific mapping in behaviours). Other than that I think the same thing should work, so just the mapping.
Dear @Radek DostálIt worked. Thanks a lot!
It looks like you're new here. Sign in or register to get started.