Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to set a restriction on changing the due date?

Maximum date change: 10 days from the current date.

The restriction should work on the editing and viewing screens.

Any ideas?

 

2 answers

1 vote
Antoine Berry Community Leader Sep 03, 2019

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.

Antoine Berry Community Leader Sep 03, 2019

@Ivan Ivanov you should be able to select the Due Date field in behaviours : 

image.png

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

@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!

Antoine Berry Community Leader Sep 03, 2019

Make sure you have not selected it previously in the configuration, because this field has been around for a long time.

No, we have not selected it previously in the configuration. And now the field is not in the list.

@Fazila Ashraf  This option will work on the transition. I need to set restrictions when editing a task.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Software

How to create Jira issus from Excel file?

When to use CSV importer When managing your processes in Jira, there are many occasions where you need to create a lot of tasks. Creating them one by one will cost you a lot of time and effort and i...

4,490 views 22 32
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you