The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Set Log Work Mandatory based on a select list field

JIRA Administration
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 27, 2020

Hi,

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Ram Kumar Aravindakshan _Adaptavist_
Community Champion
January 15, 2021

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:-

behaviour_config.png

 

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

Kamila Więcław
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!
July 11, 2022

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

TAGS
AUG Leaders

Atlassian Community Events