Forums

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

How can I hide asset field from view screen based on value of another asset field value?

Akhand Pratap Singh
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 29, 2025

Hello Team,

Is it possible to Hide an Asset field from view/edit screen based on the Value of another Asset field. 

We have Scriptrunner plugin, is it possible via that?

Thank-you

1 answer

0 votes
Bert Dombrecht
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 29, 2025

Hello Akhand,

Yes, you can do that with a Scriptrunner Behaviour.

  1. Go to Settings / Apps and in the Scriptrunner section choose Behaviors.
  2. Create a new Behavior.
  3. Select the Events and Views needed.
  4. Add the script.

Here's an example that shows a field and makes it required if another field is set to "Y":

 

const drivingFieldId= "customfield_123"  // Id of the driving custom field
const affectedFieldId= "customfield_456"  // Id of the affected custom field

// Get the affected field by the custom field ID
const affectedField = getFieldById(affectedFieldId) // Affected custom field

// Get the value of the driving field
const drivingValue = getFieldById(drivingFieldId).getValue().value

if (drivingValue== "Y") {
    affectedField.setVisible(true)       // Show affected custom field
    affectedField.setRequired(true)        // Affected custom field required
} else {
    affectedField.setVisible(false)       // Hide affected custom field
    affectedField.setRequired(false)        // Affected custom field optional
}
Akhand Pratap Singh
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 29, 2025

Hello @Bert Dombrecht ,

I tried doing that unfortunately was unable to achieve required goal, is there any script that you can help me with to achieve this?

Bert Dombrecht
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 29, 2025

Sure!

I have edited my comment above with an example.
I hope that helps!

Note: if you are using this on a transition screen, it requires you to enable the "new transition experience" in your personal settings.

Maciej Dudziak _Forgappify_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 29, 2025

Hmm, I don't believe it's possible. As far as I know, the Asset field type is not yet supported by the UI Modification API on Jira Cloud. Or am I mistaken?

Bert Dombrecht
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 29, 2025

You might be right @Maciej Dudziak _Forgappify_ ,
My script is for Jira (Software) Cloud and targets regular fields / custom fields.

@Akhand Pratap Singh let us know if you got it to work.

Akhand Pratap Singh
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 29, 2025

@Bert Dombrecht , unfortunately no, for Asset field it didn't go well :(

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events