Due Date Validator Scriptrunner

Hector Hood July 30, 2021

Issue:

Issues that transition to "Close" with a Due Date that is 7 days or more past Due from Current Date at the time of transition cannot Close. Due date must be changed before transition is allowed.

Need:

I have been looking for a code that will work for Scriptrunner. I have not found one. Would anyone have a suggestion I could try?

Jira DC is what we are using.

1 answer

0 votes
Mohamed Adel
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 30, 2021

Hi @Hector Hood  

 

You need to add a validator on the transition you want with the following simple script validator 

 

import java.sql.Timestamp
def duedate = issue.DueDate
def copareToDate = new Timestamp((new Date() -7).getTime())

duedate > copareToDate

 

Thanks in Advance 

Mohamed 

Suggest an answer

Log in or Sign up to answer