How to allow a transition on the following 7 days.

dti.arquitectura@prosegur.com April 3, 2019

Hello everyone! It's a pleasure to be here.

I'll describe my current issue with you and if anyone can offer me some help it will be much appreciated.

What I want to achieve: I want an issue that has been transitioned to status "closed" to be able to move to status "open" with the transition "reopen" for the following 7days after arrives to the status "closed".

What I did at moment:

1. All statuses can go to closed as per image image.png

2. I did set up a postfunction when an issue enters closed status to a custome fieldimage.png

So the custom field get the current date when the issue enter the status.

1.PNG

3. I added a post function from closed to nuevo transition that only allows the transition to work for 7d

image.png

At this point, the transitión button is not even appearing on the issue test, which is really strange. I'm doing wrong the condition that allows to transition? I think it's correct.

Or maybe I missed some step in the middle?

Any help would be much appreciated.

 

As an extra step, it's possible to make the button dissapear after 7days have passed in the view issue screen?

 

Kind regards.

 

 

3 answers

2 votes
Elifcan Cakmak
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.
April 3, 2019

Hello,

First thing that stands out here is that you set the custom field to a date. So your custom field's value will be something like : 04.04.2019. However on the condition you are trying to compare this to "-7d" as date without time. But "-7d" is not a date. 

Instead you can do something like this: Set the custom field value as 7 days from today. For example 11.04.2019. On the condition compare this to today's date. You should set it as if the custom field's value is smaller or equal to today's date.

This way, if the custom field's value is 11.04.2019 and today's date is 12.04.2019 for example, the condition will be applied and the button will disappear after 7 days the issue is closed.

Regards.

dti.arquitectura@prosegur.com April 3, 2019

Elifcan, sorry to ask you again but there is something I'm not able to figure out.

How can I do the "Set the custom field value as 7 days from today. For example 11.04.2019"? I can't figure out the JQL in order to do the current date and 7 days.

Mind to help me with it? Thanks again for your help.

Elifcan Cakmak
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.
April 3, 2019

Hello again, 

No bothers. I didn't test this, but I'm thinking something like that should work: %%CURRENT_DATETIME%%+7d

Also if you have a plugin like script runner, you can set this field with a custom script,too. I'm on the phone right now, I will try to test it when I get to my computer.

Regards.

dti.arquitectura@prosegur.com April 4, 2019

Elifcan, as far as I've been able to investigate, it is not possible to add days using "Update Custom Field" post-function. You can only set it to current date value. So my only alternative is to use Script Runner with a custom script.

Not sure tho if you've been able to make it work because I've not been able to.

Thanks again for your help.

Elifcan Cakmak
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.
April 4, 2019

Hi, yes you're correct I couldn't be able to make it work either :( As you said you can use script runner or apply the solution offered by @Antoine Berry  I also think that is the best solution, too.

Best. 

1 vote
Antoine Berry
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 3, 2019

Hi,

Approving Elifcan solution in your case. That being said, a good practice is having a status "Resolved" before "Closed" from which you can reopen the issue. Let the user decide to close or reopen the issue. If it has not been closed after 7 days, auto-close (with scriptrunner addon for example). This allows for better visibility for the users.

Antoine

0 votes
dti.arquitectura@prosegur.com April 3, 2019

Thanks for both replies. I'll look forward and will get back as soon as I try out. I'll update this comment after.

Suggest an answer

Log in or Sign up to answer