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

How to hide and unhide a custom field based on another field's value

Zeeshan Ahmed Khan January 30, 2023

I have come across this JSON but don't know how to hide or unhide a custom field. Field name is "Impacted Service:" and I want to hide it based on user selecting "Other:" in another field.

{
"update": {
"Impacted Service:": [
{
<<<<<<How to hide the field>>>>>>>>
}
]
}
}

 The only supported action here seem to be "set" which is not what I need.

That's what my automation flow look like:

Screenshot 2023-01-31 151657.png

2 answers

0 votes
Tzirel Shaffren June 28, 2023

I'm a relative newbie to Jira Administration, but there is a custom field type called "Select List (Cascading)". Might that solve your problem?

zzSelectCascading2023-06-28_17-02-29.png

Zeeshan Ahmed Khan June 29, 2023

This feature of cascading select list is helpful if you have a field (say city selection) dependent on the parent field (say country selection). It cannot be used as a hiding/unhiding requirement. Anyhow, I have got what I needed by using custom Forms which is an in-built feature in Jira Service Management Cloud. 

Like Tzirel Shaffren likes this
0 votes
Joseph Chung Yin
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 30, 2023

@Zeeshan Ahmed Khan -

Unfortunately, the Automation for Jira functionality doesn't support field hiding/unhiding based on other custom field's value.  Therefore, automation rule will not work for you.

Currently, the only thing I know that it may work in the Cloud env is ScriptRunner for Jira add-on Behavior component.  However, the vendor is still working with Atlassian to develop the full capability to provide the functionality just like what they have for the DataCenter (on-prems) env.

I would recommend you to search Atlassian Marketplace for other third party add-ons that may provide the functionality -

Example

https://marketplace.atlassian.com/apps/1212161/extension-for-jira-service-management?tab=overview&hosting=cloud

https://marketplace.atlassian.com/apps/1228522/behaviours-scriptrunner-for-jira-cloud?tab=overview&hosting=cloud

Lastly, out of the box in JSM, it is not possible.

Hope this helps.

Best, Joseph Chung Yin

Jira/JSM Functional Lead, Global Technology Applications Team

Viasat Inc.

Zeeshan Ahmed Khan February 2, 2023

Thanks Joseph for the detailed response.

Zeeshan Ahmed Khan February 5, 2023

image.png

Hi @Joseph Chung Yin , I have got the ScriptRunner and the bahavior add-ons added. My script is shown above. What else is missing ? Its not accepting SetVisible() methods saying "Property 'setVisible' does not exist on type 'Field'. Did you mean 'isVisible'?(2551)"

Joseph Chung Yin
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 5, 2023

@Zeeshan Ahmed Khan -

It is "setHidden" is the method and not "setVisible".

Hope this helps.

Best, Joseph

Zeeshan Ahmed Khan February 5, 2023

@Joseph Chung Yin, I just changed the affected field to be "Other impacted service" and the code errors seems to have been gone. Even setVisible() is looking acceptable.

image.png 

It doesn't seem to work regardless. Just to share more information, I have this kind of Incident raising form (refer below) 

image.png

 

and I want the "Other Impacted Field" to appear (become visible) whenever the user selects "Other" in "Affected Service" field. 

image.png

Joseph Chung Yin
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 5, 2023

@Zeeshan Ahmed Khan -

Please note that Behavior component for Cloud is still under enhancement between the vendor and Atlassian.  So please refer to the following vendor documentation for is supported at this time (especially dealing with custom fields) - https://docs.adaptavist.com/sr4jc/latest/features/behaviours?_ga=2.183995044.340474686.1675660571-414402845.1665030927#id-.BehavioursvCurrent-BehavioursSupportedFunctionsBehavioursSupportedFunctions

Best, Joseph

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
TAGS
AUG Leaders

Atlassian Community Events