Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Set Log Work Mandatory based on a select list field


I m using the script runner and I want to make log work mandatory if select list is not empty. 

Any suggestions please.

1 answer


For your requirement, you should look into ScriptRunner's Behaviours. 

To start, you should look at the Behaviours documentation at] along with the Behaviours tutorial at

Below is an example Server-Side Behaviour code which shows how you can make the Log work field(s) mandatory:-

def required = getFieldById(fieldChanged)
def requiredValue = required.value.toString()

def logwork = getFieldById("log-work-time-logged")
logwork.required = false

if(requiredValue == "Yes") {
  logwork.required = true

Below is a print screen of the Behaviour configuration:-



Below is a print screen of how the Behaviour works:-

behaviour_sample.pngWhen the issue is being created, if the option selected in the Required list is Yes, the Time Spent field becomes mandatory else it is not.

Hope this helps to solve your question :)

Hey, @Ram Kumar Aravindakshan _Adaptavist_! Do you know what is the name to interact with field "Work Description"? ("log-work-...?")

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira

Online AMA this week: Your project management questions answered by Jira Design Lead James Rotanson

We know that great teams require amazing project management chops. It's no surprise that great teams who use Jira have strong project managers, effective workflows, and secrets that bring planning ...

214 views 1 6
Read article

Atlassian Community Events