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
@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
@Fazila Ashraf This option will work on the transition. I need to set restrictions when editing a task.
@Antoine Berry It’s probably not possible to configure the restriction. The field Due Date is missing when configuring through scriptrunner's behaviours.
@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.BaseScriptimport com.onresolve.jira.groovy.user.FieldBehavioursimport java.sql.Timestamp@BaseScript FieldBehaviours fieldBehavioursdef 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
@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!
It looks like you're new here. Sign in or register to get started.