Forums

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

How to create custom fields in JIRA SM with dependent relations?

Kumar Ankit January 6, 2025

Hello,

I am working on creating custom fields in JIRA SM. My requirement is following.

There are 2 fields - FieldA and FieldB. 

When I select a particular value in FieldA, FieldB should pop up with a set defined list of values, and when I go back and select a different value in FieldA, the feildB should reset and allow me to select a different value for it.

I have tried achieving these using behaviours in scriptRunner but I have encountered the following problem -

1. It doesn't work on view screen. It only seems to work on create/edit screen.

2. When I change the value in FieldA, FieldB doesn't reset to default.

 

2 answers

0 votes
Aron Gombas _Midori_
Community Champion
January 6, 2025

Using native Jira DC features you can't define dependency between two separate fields.

Nevertheless, ScriptRunner allows you implement so-called behaviors. Behaviors can implement what you requested here. This article is a good starter: https://library.adaptavist.com/entity/control-field-selected-checkbox

 

Kumar Ankit January 6, 2025

@Aron Gombas _Midori_ Behaviours doesn't work on view screen. If I want to achieve this feature on inline fields, I cannot do that using behaviours. It only works on create/edit screen.

Aron Gombas _Midori_
Community Champion
January 6, 2025

@Kumar Ankit Let me summarize your requirements. When in "view" mode you click a "select" field to indicate that you want to change its value, you want another, separate field also turn to "edit" mode immediately?

Honestly, to me it sounds a bit weird interaction...

But, if that's what you need, I can't help I am afraid.

0 votes
Harshit Grover
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.
January 6, 2025

Hi @Kumar Ankit ,

 

You can create a Cascading (List Type) custom field in your JSM which will fulfil your requirement. 

 

Kindly follow : 

https://confluence.atlassian.com/jirakb/jira-data-center-how-to-create-dependent-cascading-lists-in-jira-1142426572.html

 

Regards,

Harshit

 

Kumar Ankit January 6, 2025

Hello @Harshit Grover ,

Thanks for the quick response. I tried using your approach, but this method only allows me to select certain values based on the first value selected, all in the same field. 

test.PNG

However, what I want is to have the second value to be a different field altogether. For ex - If test dependent field == Test1, then a new field called - Test123 == Value1.

Suggest an answer

Log in or Sign up to answer