Maximum date change: 10 days from the current date.
The restriction should work on the editing and viewing screens.
Any ideas?
Hi @Ivan Ivanov ,
To my knowledge this is not possible out of the box. You could use an add-on for that, such as scriptrunner's behaviours.
Antoine
@Antoine Berry It’s probably not possible to configure the restriction. The field Due Date is missing when configuring through scriptrunner's behaviours.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Ivan Ivanov you should be able to select the Due Date field in behaviours :
You can then use this script snippet to restrict the due date :
import groovy.transform.BaseScript
import com.onresolve.jira.groovy.user.FieldBehaviours
import java.sql.Timestamp
@BaseScript FieldBehaviours fieldBehaviours
def duedateField = getFieldById("duedate")
def duedate = duedateField.getValue()
def maxDate = new Timestamp(new Date().getTime() + 10 * 24 * 60 * 60 * 1000);
if (duedate != "" && new Timestamp(duedate.getTime()).compareTo(maxDate) > 0){
duedateField.setError("The due date cannot be set further than 10 days.")
}
else {
duedateField.clearError()
}
Hope that works for you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Antoine Berry We do not have this field in the search. Probably, we have the old version of the plugin installed. I will try to do it after the update. Thank you very much!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Make sure you have not selected it previously in the configuration, because this field has been around for a long time.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No, we have not selected it previously in the configuration. And now the field is not in the list.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Ivan Ivanov , similar question was asked in past. Please see https://community.atlassian.com/t5/Jira-questions/Restrict-due-date-using-simple-script-validator/qaq-p/1017764
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Fazila Ashraf This option will work on the transition. I need to set restrictions when editing a task.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.