ScriptRunner to hide/display and optional/required upon Close status and based on type field

VVC
Contributor
February 19, 2025

Need assistance with Scriptrunner code to ensure that a radio button field "Is this still occurring?" is hidden right from the start of ticket creation and irrespective of any status.

Now I need the above radio button field to be dynamically visible on the fly and mark it as required, only when the single-select "Type" field value equals "Standard" and upon status transition to Close.

But if the "Type" value changes to other than "Standard" then the radio button field must be hidden and set to optional. Is this something achievable using Script Runner?

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
Fabio Racobaldo _Herzum_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 20, 2025

Hi @VVC ,

yes, you can do that through a scriptrunner behaviour. Please check documentation here https://docs.adaptavist.com/sr4js/9.7.0/features/behaviours/behaviours-examples/field-required

if you have trouble on that let me know.

Fabio

VVC
Contributor
February 20, 2025

Thanks @Fabio Racobaldo _Herzum_ for sharing this documentation. TBH, what I'm looking to accomplish is using a popup screen during the workflow transition to Close status with the radio button field marked as required, only when Type field is selected as Standard.

Also, suppress or do NOT pop up any screen during the workflow transition to Close status when Type field value is NOT selected as Standard. Is this something achievable using Script Runner in combination with workflows in JIRA DC?

Fabio Racobaldo _Herzum_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 20, 2025

@VVC using a behaviour you can make a field mandatory/optional based on value of other field (both on transition screen). Unfortunately popup will always appear 

VVC
Contributor
February 20, 2025

@Fabio Racobaldo _Herzum_ That's exactly of what I was expecting as well. Hence, I had to workaround on adding this field onto the main ticket screen rather using a popup screen during workflow transition. I will give it a try using behaviors and see how it goes.

Fabio Racobaldo _Herzum_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 20, 2025

@VVC let me know if you need support on that

Like VVC likes this
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events