The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

limit time to reopen ticket

PeterN
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 21, 2021

Hi, I try to limit time (for 3 days) to user can reopen ticket.. I added transition, visible on portal, works fine.. but tried this old java I found, didnt worked.. any help?

 

import java.util.Calendar;
import com.atlassian.jira.issue.Issue;
import java.text.SimpleDateFormat;

Issue issue  = issue;
if(issue.getResolutionDate()!=null){ 
	Calendar now = Calendar.getInstance();
	now.setTimeInMillis(System.currentTimeMillis());
	Calendar resolutionDate = Calendar.getInstance();
	resolutionDate.setTimeInMillis(issue.getResolutionDate().getTime());
	resolutionDate.add(Calendar.DATE, 3);
	if(now.before(resolutionDate)){
		return true;
	} else {
        	return false;
        }
}
return true;

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Fazila Ashraf
Community Champion
June 21, 2021

Hi @PeterN 

Where are you applying this script?

Leaving the script aside, the standard practice is to auto-close the issue (either using automation for jira or scriptrunner script jobs) certain days after resolved. Till then the users can get to reopen the ticket.

 

Why not use that? 

PeterN
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 21, 2021

i dont know how to do that, dont have scriptrunner installed (i think)

 

this script is done at "condition" at transition

TAGS
AUG Leaders

Atlassian Community Events