Hi,
I m using the script runner and I want to make log work mandatory if select list is not empty.
Any suggestions please.
Hi,
For your requirement, you should look into ScriptRunner's Behaviours.
To start, you should look at the Behaviours documentation at https://scriptrunner.adaptavist.com/latest/jira/tutorials/behaviours-tutorial.html] along with the Behaviours tutorial at https://scriptrunner.adaptavist.com/latest/jira/tutorials/behaviours-tutorial.html.
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:-
When 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-...?")
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.