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
4,361,905
Community Members
 
Community Events
168
Community Groups

Issue Picker Field is not working when set to Required by Behavior during issue transition.

def DJ = getFieldById("customfield_10702")
def TC = getFieldById("customfield_10809")
def TJ = getFieldById("customfield_10703")
def CR = getFieldById("customfield_10700")
def DI = getFieldById("customfield_10500")

if (s == "Duplicate defect" )

{


  TC.setHidden(true)
  DJ.setHidden(true)
  TJ.setHidden(true)
  CR.setHidden(true)
  DI.setHidden(false)
  DJ.setRequired(false)
  CR.setRequired(false)
  TC.setRequired(false)
  TJ.setRequired(false)
  DI.setRequired(true)


}

Here is the condition I am checking but getting Error "Please enter the value for the field"

Even if I choose the issue and test the field showing above mentioned error.

Please help in the scenario.

 

 

1 answer

0 votes

What have you actually configured for the Behaviour, and where is the rest of the script?

Hi Nic Brough _Adaptavist_,

Thanks for your quick reply.

 

We have select list and base on the value of select list issue picker field will appear which is made required.

But when I select value in select list and issue in issue picker field and clicked on trasition then the error like "Please enter the value for the field" is getting appear.

We have checked by logging whether the issue picker is getting value or not but its getting value in field but it is not working for us.

 

Please have a look in to it.

Thanks in advance.

Hi @Nic Brough _Adaptavist_ , 

Please find the exact functionality we are trying to achieve through this behaviour:

  1. We have the following custom fields on a transition screen
    1. S - Select list (single choice) with the following options:
      1. Duplicate defect
      2. Not a defect
      3. Clarification required
    2. DJ - Text field (multi-line)
    3. TC - Text field (multi-line)
    4. TJ - Text field (multi-line)
    5. CR - Text field (multi-line)
    6. DI - Single Issue Picker
  2. On the execution of the transition, the field "S" is a Required field.
  3. On the transition screen if the value of field "S" is selected as "Duplicate Defect" the field "DI" should be displayed on the transition screen and should be a required field
  4. Similarly there are different fields that are displayed if a different value is selected for the filed "S"

The Behaviour is mapped to relevant project / issue type

The  problem we are facing is --> When the transition is executed and the value of the field "S" is selected as "Duplicate defect," the field "DI" is displayed on the transition screen and marked as required. We enter the issue key on the "DI" field and click on the transition button -->  the error message "You must enter a value for this field" is displayed below the "DI" field.

The entire script is provided below for reference:

def s = getFieldById("customfield_10701").getValue()
def DJ = getFieldById("customfield_10702")
def TC = getFieldById("customfield_10809")
def TJ = getFieldById("customfield_10703")
def CR = getFieldById("customfield_10700")
def DI = getFieldById("customfield_11300")


if (s == "Not a defect")
{
DJ.setHidden(false)
DJ.setRequired(true)
CR.setRequired(false)
TC.setRequired(false)
TJ.setRequired(false)
DI.setRequired(false)
TC.setHidden(true)
TJ.setHidden(true)
CR.setHidden(true)
DI.setHidden(true)
}
else if (s == "Clarification Requested"){
CR.setHidden(false)
CR.setRequired(true)
TC.setRequired(false)
TJ.setRequired(false)
DJ.setRequired(false)
DI.setRequired(false)
DJ.setHidden(true)
TC.setHidden(true)
TJ.setHidden(true)
DI.setHidden(true)
DJ.setRequired(false)
}
else if (s == "Duplicate defect" ){
TC.setHidden(true)
DJ.setHidden(true)
TJ.setHidden(true)
CR.setHidden(true)
DI.setHidden(false)
DJ.setRequired(false)
CR.setRequired(false)
TC.setRequired(false)
TJ.setRequired(false)
DI.setRequired(true)
}
else if (s == null ){
TC.setHidden(true)
DJ.setHidden(true)
TJ.setHidden(true)
CR.setHidden(true)
DI.setHidden(true)
DJ.setRequired(false)
CR.setRequired(false)
TC.setRequired(false)
TJ.setRequired(false)
DI.setRequired(false)
}

Hi All,

Is there anyone who can have any update on this so that we can complete this open point?

Suggest an answer

Log in or Sign up to answer
TAGS
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