What I have now shows as "Correct" but it hides the field NOWHERE. I have played around with this a lot and can only either get it to hide regardless of component or show regardless of component. The bug checker always shows a valid script...
//import com.atlassian.jira.bc.project.component.ProjectComponent
import com.atlassian.jira.ComponentManagerdef formComponent = getFieldById("components")
def formCapability = getFieldByName("Capability")formComponent.getValue()
formCapability.setHidden(true)
if (formComponent.Value.toString().contains("Policy 2013"))
{
formCapability.setHidden(false)
}else if (formComponent.Value.toString().contains("Policy 2013"))
{
formCapability.setHidden(false)
}
else formCapability.setHidden(true)
Hi Lacey,
Try something like
def formComponent = getFieldById("components") def formCapability = getFieldByName("Capability") def componentFieldValues = formComponent.value if (componentFieldValues*.name?.contains("Policy 2013")) formCapability.setHidden(false) else formCapability.setHidden(true)
regards, Thanos
I am facing similar challenge. Can you please point me to where you need to insert these scripts to change the intended behavior? I have not plug-ins installed such as Scriptrunner in my environment.
I would think this allowed out of the box configuration by Atlassian without any purchase... I can't seems to find place to enter the code in vanilla Jira.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You da boss.
This works:
def formComponent = getFieldById("components") def formCapability = getFieldByName("Capability") def componentFieldValues = formComponent.value if (componentFieldValues*.name?.contains("Policy 2013")) formCapability.setHidden(false) else if (componentFieldValues*.name?.contains("Policy 2015")) formCapability.setHidden(false) else formCapability.setHidden(true)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There are times that is safe to ignore STC, give it a go ....
PS: Assign it to Component/s field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
nope; we have a static type checking error where no such property exists name for class java.lang.Object for "componentFieldvalues*.name?" at line 6 col 5
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Lacey,
Doe the script below works ?
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.