How to Hide the Screen Tab in JIRA via Script Runner

Sharadkumar Bangera July 23, 2019

Hello,

I am working on Change Management Jira Workflow 

I want to HIDE the Screen(Tab 2) of "Approver" for Issue Type "Change" when Change Type "Standard"(Field) Selected

Can you please provide the script and where in Script runner should i update this, is this Script Listener-Custom Listener.

 

1 answer

0 votes
PVS
Banned
July 23, 2019

Hi @Sharadkumar Bangera 

You should be able to do it with behaviors. see https://scriptrunner.adaptavist.com/latest/jira/recipes/behaviours/operations-on-tabs.html

Or This 

https://www.idalko.com/use-behaviour-functionality-script-runner-show-hide-fields/

 

 

def issueType = getIssueContext().getIssueType().getName()

FieldScreenTab tab = getFieldScreen().tabs.find {
return (it.name.toLowerCase() == "test")
}

if (issueType == "test") {
if (tab) {
hideTab(tab)
}
} else {
showTab(tab)
}
Sharadkumar Bangera July 24, 2019

Thanks, I tried with below script and it is working fine but the Challenge where i am facing now is, the field which i want HIDE those are Mandatory field (*). Those fields are hidden when i select Change type "Standard" but i cannot create a ticket until and unless i update the value in those hidden fields.

Can you please provide a workaround for this

Below is my script

 

def changetype = getFieldById("customfield_11661")
def TechopsApproval = getFieldById("customfield_12550")
def DevopsApproval = getFieldById("customfield_12100")
def Bizopsapproval = getFieldById("customfield_12101")
log.debug("changetype Value" + changetype.getValue())

if (changetype.getValue() == "Standard") {
DevopsApproval.setHidden(true);
TechopsApproval.setHidden(true);
Bizopsapproval.setHidden(true);

} else {
DevopsApproval.setHidden(false);
TechopsApproval.setHidden(false);
Bizopsapproval.setHidden(false);


}

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events