Hi Team,
We want to un-hide the field "Production Ready Date"( type is Select list (single Choice)) , when Requester Dept. = Retail Delivery solutions. I am using behaviors, but its not working expected. Can you please check the below and suggest me on this.
import com.onresolve.jira.groovy.user.FieldBehaviours
import org.apache.log4j.Logger
import org.apache.log4j.Level
import groovy.transform.BaseScript
def productionField = getFieldByName("Production Ready Date")
def requesterField = getFieldByName("Requester Dept.")
def requesterdeptValue = requesterField.value as List
@BaseScript FieldBehaviours fieldBehaviours
def log = Logger.getLogger(getClass())
if (requesterdeptValue == ["Retail Delivery Solutions"])
{
productionField.setHidden(false)
}
else
{
productionField.setHidden(true)
}
Hi @Lakshmi CH , can you try to change the script and use:
def requesterdeptValue = requesterField.value
@BaseScript FieldBehaviours fieldBehaviours
def log = Logger.getLogger(getClass())
log.error("Req Dept Value:" + requesterdeptValue)
if (requesterdeptValue == "Retail Delivery Solutions")
{
productionField.setHidden(false)
}
else
{
productionField.setHidden(true)
}
I also added one log.error so in case it is not working, can you check log file and row starting Req Dept Value:
Thank you @Martin Bayer _MoroSystems_ s_r_o__ . The script is working as expected.
import com.onresolve.jira.groovy.user.FieldBehaviours
import org.apache.log4j.Logger
import org.apache.log4j.Level
import groovy.transform.BaseScript
def productionField = getFieldByName("Production Ready Date")
def requesterField = getFieldByName("Requester Dept.")
def requesterdeptValue = requesterField.value
@BaseScript FieldBehaviours fieldBehaviours
def log = Logger.getLogger(getClass())
log.error("Req Dept Value:" + requesterdeptValue)
if (requesterdeptValue == "Retail Delivery Solutions")
{
productionField.setHidden(false)
}
else
{
productionField.setHidden(true)
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Cool, I suggest you using log when the behavior is not as expected. Happy to help :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sure @Martin Bayer _MoroSystems_ s_r_o__ . I will do.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.