Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

sanjay July 7, 2020

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

Suggest an answer

Log in or Sign up to answer
0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 7, 2020

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

sanjay July 8, 2020

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.

Bharath Ram July 8, 2020

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

sanjay July 13, 2020

Hi All,

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

TAGS
AUG Leaders

Atlassian Community Events