Forums

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

Display a customfield depending on another customfield

Rene Hegewald
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 22, 2021

Hi there,

firstup, I'm no programmer, so I'm a bit in a loss here.

 

I've got two customfield (Checkbox). One called Server/Dienst with the values Server and Dienst and the other called Taetigkeit with the values Inbetriebnahme and Ausserbetriebnahme.

I also got four checklist customfields called ServerIn, ServerAus, DienstIn and DienstAus.

I want the script (We have Scriptrunner) to do the following:

  • Display ServerIn if a) Server/Dienst == Server AND Taetigkeit == Inbetriebnahme
    • Display ServerAus if b) Taetigkeit == Ausserbetriebnahme
  • Display DienstIn if c) Server/Dienst == Dienst AND Taetigkeit == Inbetriebnahme
    • Display DienstAus if d) Taetigkeit == Ausserbetriebnahme

I already got the following:

 

switch (customfield_12508) // Server/Dienste
{
    case "Server":
        switch (customfield_12503){ //Taetigkeit
            case "Inbetriebnahme":
                //display ... customfield_12504 //ServerIn
                break;
            default: // Ausserbetriebnahme
                //display ... customfield_12505 //ServerAus
        }
    case "Dienst":
        switch (customfield_12503){ //Taetigkeit
            case "Inbetriebnahme":
                //display ... customfield_12506 //DienstIn
                break;
            default: // Ausserbetriebnahme
                //display ... customfield_12507 //DiensAus
        }
}

 

My Question is: How do I do the display part? How do I tell Jira to display one specific customfield and otherwise hide it altogether? The fields should also be hidden if no value is (yet) chosen as described in my pseudocode above.

1 answer

1 accepted

0 votes
Answer accepted
Ram Kumar Aravindakshan _Adaptavist_
Community Champion
November 22, 2021

Hi @Rene Hegewald

A similar question was earlier asked, answered and accepted in this community post.

The concept is the came, i.e. you will need to create two Server-Side Behaviour configurations.

Thank you and Kind Regards,

Ram

Suggest an answer

Log in or Sign up to answer