I am trying to use a server side script to disable a tab (based on the value of a field). For simplicity, I'll omit how I check the value of that other field and the corresponding conditional.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.security.JiraAuthenticationContext
import com.atlassian.jira.issue.fields.screen.FieldScreenTab
FieldScreenTab tab = getFieldScreen().tabs.find {return (it.name.toLowerCase() == "executable")}
hideTab(tab)
When I include the hideTab(tab) the Static type checker says Cannot find matching method Script847#hideTab(com.atlassian.jira.issue.fields.screen.FieldScreenTab) and the rest of the script stops working.
I am sure the tab exists because tab.getName() does properly return the name of the tab I am trying to hide.
Hi @jgiraldo1 ,
Not sure if your method is supposed to work, butaccording to scriptrunner's documentation, you could use
hideTab(1)
I have been successfully using
hideTab("Name of the tab")
Hope that helps.
If I this the way I described in the initial posting I see the following error:
groovy.lang.MissingMethodException: No signature of method: Script1.hideTab() is applicable for argument types: (com.atlassian.jira.issue.fields.screen.FieldScreenTabImpl) values: [com.atlassian.jira.issue.fields.screen.FieldScreenTabImpl@1a963a0d] at Script1.run(Script1.groovy:33)
And if I do it simply with hideTab("<Tab Name>") where the Tab Name is "Executable" the error says:
groovy.lang.MissingPropertyException: No such property: Executable for class: Script1
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Could you please screenshot it your behaviours configuration & script ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@jgiraldo1 : can you please tell if "hideTab" also works on View Screens in your instance ?
currently i'm facing the problem, that it only works on edit/create screens.
thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.