Forums

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

How to show custom field B on dynamically selected option in another custom field A on JSM Portal

AnoopTripathi October 14, 2024

Hello!

 

So far I was able to show another custom field (B) based on selecting an option in custom field (A)

 

Now, I want to show this on Jira customer portal. Any suggestion what next I need to do??

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

 

// Get the value of the custom select list "Yes or No" and pop up "Explain Mitigation" field

def CheckMitigationField = getFieldByName("Mitigation in place?")
def ShowMitigationTextField = getFieldByName("Explain Mitigation")


CheckMitigationField.setRequired(true)

if(CheckMitigationField.value == "Yes") {
 
ShowMitigationTextField.setHidden(false)
ShowMitigationTextField.setRequired(true)  
} else {

ShowMitigationTextField.setHidden(true)
ShowMitigationTextField.setRequired(false)
}

1 answer

0 votes
Joseph Chung Yin
Community Champion
October 14, 2024

@AnoopTripathi -

Are you using ScriptRunner for Jira's Behavior component for the control?  If so, the script needed to be associated against the "Mitigation in Place" custom field.

Please advise.

Best, Joseph Chung Yin

AnoopTripathi October 14, 2024

Thank you Joe for your kind response. Yes I am using ScriptRunner’s behavior for control and the script is also associated with “Mitigation in Place” custom field still I can’t see the right behavior at Jira portal side. Please suggest what I may be missing.

Joseph Chung Yin
Community Champion
October 14, 2024

@AnoopTripathi -

Try this after you defined the custom field variable  (You will need to get the value of the field for the comparison...

Example - 

String CheckMitigationFieldValue= (String) CheckMitigationField.getValue()
Then use CheckMitigationFieldValue  variable in the if clause
f(CheckMitigationFieldValue == "Yes")
Hope this helps.
Best, Joseph
AnoopTripathi October 14, 2024

Thank you Joe for checking and responding back. I implemented the change as per your suggestion but the issue is still same.

The create screen on Jira side is working fine but the service desk portal is not reflecting the as per the expectation. Please see the attached screenshot of the screens and behavior.

 

JiraSide-Working.pngJiraSide-Working2.pngScript-Behavior.pngServiceDesk Portal.pngServiceDesk Portal-Yes.png

AnoopTripathi October 14, 2024

RequestType-Fields.png

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events