Forums

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

ScriptRunner Field Behaviours Change Select Options for Asset Fields

Amos
Contributor
October 16, 2023

I'm aware that this is potentially achievable using asset custom fields and reference asset custom fields, however I have a unique circumstance that extends beyond this.

Context:

I have an asset model that has four object types:

  • A
  • B (with references to A)
  • C (with references to A)
  • D (with references to A)

I have exposed all these object types through custom fields like so:

  • A (asset field)
  • B (reference asset field) referenced to A
  • C (reference asset field) referenced to A
  • D (reference asset field) referenced to A.

Using ScriptRunner, I want to define a field behaviour whereby options for customfield D (which is object type D) only displays objects D1, D2 and D3 if B1 in customfield B has been selected. Otherwise, I only want D1 and D2 to be selectable. Any assistance with the groovy aspect of this would be much appreciated. I've been able to interact with assets previously using the ObjectFacade, however setting the field options is proving to be slightly more challenging.

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events