Forums

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

How can I allow to change status only under certain conditions?

Joerg Domhoefer
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!
November 28, 2019

Our team should always record the time needed to complete a task. To ensure that I would like to enable the change of the status from "In progress" to "done" only if hours are logged. Is there a way to do that?

2 answers

1 vote
Simon K
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 28, 2019

Hi Joerg,

 

Thank you for reaching out to Atlassian Community!

 

You have a couple of options for limiting the transition to "done" to only issues where hours are logged.

 

Option 1 - Add a validator to the transition

You can add a validator that will only allow the transition to be performed when a certain condition is met, f.x. if the Time Spent field has a value. 

Be aware that the transition will give an error if the condition is not met, even if the field is not visible on the screen configured for the transition, so in your case, you might want to add the "Log Work" field to the screen.

 

We have some great pages with step by step guides on how to configure this, f.x.

 

Option 2 - Using a condition to the transition

You can add a condition to the transition to "done" in the workflow to have the transition visible if the condition is met. You can add a condition of the "Value Field" type that only allows the execution of the transition if the value of the "time spent" field is set.

To add a condition to the workflow transition, follow our guide on this page

 

 

I think option 1 is better in your case because it has the option of configuring an error message if the hours are not logged, whereas option 2 simply hides the option of moving the issue to "done" if hours are not logged.

 

I hope this helps.

 

Cheers,

Simon

0 votes
Mirek
Community Champion
November 28, 2019

I think you need to have a plugin to achieve this ..

Few examples..

Jira Suite Utilities - then you need to add 'Time Tracking' field to the required screens and later add a 'Field Required' validator. Finally in the workflow transition entry for 'time' field.

There is also an option using Power Scripts

https://confluence.cprime.io/display/TR/Require+work+log+in+order+to+transition

https://confluence.cprime.io/display/TR/Require+User+to+Log+Work+Before+Transitioning+Issue

And I think also ScriptRunner have this ability (below is a similar thread)

https://community.atlassian.com/t5/Answers-Developer-Questions/How-can-I-use-a-validator-that-time-has-been-logged-previously/qaq-p/568361

Jack Hunter [HeroCoders]
Atlassian Partner
November 28, 2019

When you ask team members to log the time and you check if they did it, you are still not sure how precise their report is.

It might be easier to track time automatically with the Clockwork app provided by my team. This way, when the issue is being closed, the accurate time spent is always there. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events