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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,460,387
Community Members
 
Community Events
176
Community Groups

limit time to reopen ticket

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

0 votes
Fazila Ashraf Community Leader Jun 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? 

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

 

this script is done at "condition" at transition

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events