Log work during a transition Edited


my question relates to this one.

I want to validate for a transition that some work has been logged for the issue. It works (with JMWE Field is required validator) if the user has already logged work before the transition. If the user hasn't logged work before the transition and logs work in the transition screen, the validator seems not to be able to access this new work log and does not allow to execute the transition.

I also tried to create a simple scripted validator using Scriptrunner but the behaviour is the same (the new worklog entry is not yet available).

Any ideas how to solve this?

1 answer

1 accepted

In the meantime I did find a solution how to check a user logs work in the transition screen using a Simple scripted validator (Scriptrunner Validator):

import com.atlassian.jira.issue.ModifiedValue
import com.atlassian.jira.issue.MutableIssue

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

return modifiedValues.containsKey("worklog")

And if you want to check some work has been logged for the issue (during the transiton or already before): 

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)

Jira 7.1.2

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,129 views 13 19
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot