Forums

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

How to hide/unhide system field "Component/s" using behaviour

WindHub Support
Contributor
October 24, 2022

I've been searching through the questions but couldn't find a working way to hide the m field "Component/s"

I've been using this formula for custom fields:

def CountryField = getFieldByName("P-Country")
CountryField.setHidden(true);
what would be the equivalent way for "Component/s"?

2 answers

2 accepted

Suggest an answer

Log in or Sign up to answer
1 vote
Answer accepted
Mohamed Benziane
Community Champion
October 24, 2022

Hi,

You can try something like this:

import static com.atlassian.jira.issue.IssueFieldConstants.COMPONENTS
def components = getFieldById(COMPONENTS)



1 vote
Answer accepted
WindHub Support
Contributor
October 24, 2022

I think I've found the answer myself:

def ComponentsField = getFieldById("components")
ComponentsField.setRequired(false); ComponentsField.setHidden(true); ComponentsField.setFormValue(null);
TAGS
AUG Leaders

Atlassian Community Events