I don't want issues to transition to done unless there is time logged.

Antonio Smith
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 2, 2022

So, like the question says... I want to make a rule where issues won't be able to transition to done unless there is time logged.

1 answer

0 votes
Kevin Dalton
Contributor
November 2, 2022

Go to the workflow used in that issue type and for the close transition add a validator "Field Required Validator" and then select "Time Spent" field.

Also make sure for the close transition there is a transition screen with the "Time Spent" field incase it is not populated.

Hamza Chundrigar
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.
November 2, 2022

I don’t think this is the right approach. 

For example, say there are 3 statuses

  • To Do > In Progress > Done
  • User logs work while the ticket is in the ‘In Progress’ status/column so time spent on an issue is now > 0 (here OP’s condition would be satisfied since there has been time logged already. Adding a field required validator on the ‘Done’ status with a respective transition screen mandating the user to log time again when he has already done so in the past would not make sense then).
Kevin Dalton
Contributor
November 2, 2022

If you have script runner you could try a simple script

issue.timeSpent || issue.modifiedFields.containsKey("worklog")

Or you could do something more complex with 

import com.atlassian.jira.issue.ModifiedValue
import com.atlassian.jira.issue.MutableIssue
import com.onresolve.scriptrunner.runner.util.UserMessageUtil

Map<String,ModifiedValue> modifiedValues = ((MutableIssue)issue).getModifiedFields()

return modifiedValues.containsKey("worklog") || (issue.timeSpent > 0)

 Both should check if time is logged or if the worklog is modified on the transition.

Antonio Smith
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 3, 2022

It looks like you're not able to add a validator when your project is Team-based and I don't think I'll get the budget to get a script runner. Any other options?

Here is what I have tried... there doesn't seem to be a way to check if the syntax is correct.

 

automation.png

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events