Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

×
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

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

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

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
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Nov 02, 2022 • edited

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).

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.

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