Looking for help with Scriptrunner behavior

Leena Siddamshetty March 8, 2024

Hi All,

I am looking for some help to create a behavior in script runner which involves 2 fields.

when value of customfield 1 is "Yes", a certain number of options from customfield2 (Dropdown list) should be available.

When value of Customefield1 is "No", certain number of options from customfield2 must be visible.

How can this be achived?

Thanks!

1 answer

1 accepted

0 votes
Answer accepted
Sebastian Krzewiński
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 8, 2024

Hi @Leena Siddamshetty 

 

Here you can find few scripts that you can combine and build your - https://docs.adaptavist.com/sr4jc/latest/features/behaviours/example-behaviour#example-scripts

 

Regards,

Seba

Leena Siddamshetty March 8, 2024

Thank you @Sebastian Krzewiński ,

I was using this function to test:

 

getFieldById("customfield_18377").setOptionsVisibility(["Data Integrity", "Performance", "System Crash"], true);
by my understanding, the field should only show mentioned values right? But when I save the behavior and try to create an issue, all I get is an empty field with no values at all:
Please suggest what am I doing wrong here in using this function?
Screenshot 2024-03-08 at 10.18.14 AM.png
Kristian Walker _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.
March 8, 2024

Hi Leena,

I can confirm as per the documentation page here you must specify the opton Id's rather than names when calling setOptionsVisibility.

Regards,

Kristian

Like Sebastian Krzewiński likes this
Leena Siddamshetty March 8, 2024

@Kristian Walker _Adaptavist_ , perfect, that worked. I will continue to build my script further.

Thanks a ton!

Like # people like this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events