Forums

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

How to hide/show screen tabs based on status?

Digvijay Singh Gehlot May 10, 2024

I want to hide/show screen tabs based on statuses. I am new to groovy and behaviors in scriptrunner.

I have 3 tabs on a screen: Tab A, Tab B, Tab C. I want to show Tab A on first three Statuses, hiding Tab B and Tab C. Then show Tab B on the next 3 Statuses, hiding Tab A and Tab C and so on.

I am trying to run the below script in Initializer section under a behavior. 

hideTab(1)

hideTab(2) 

if (underlyingissue.getStatus(). getName() == "Status A" || "Status B" || "Status C") {

hideTab(0) 

showTab(1)

hideTab(2) }

 

And so on. 

I want help with a script where I can hide tabs for multiple statuses and then show the same tab on other statuses. Please guide me further. Thanks

1 answer

0 votes
Tinker Fadoua
Community Champion
May 11, 2024

@Digvijay Singh Gehlot 

Your Initializer should run when the form gets loaded. What you are trying to achieve happens during the issue transition from one status to another.

Your behaviour should apply under a field. Do you have a field that should meet a certain condition so that your code goes underneath and that's where you can specify the statuses.

Do you get my point?

Best,

Fadoua

Suggest an answer

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

Atlassian Community Events