Hello!
I created a scriptrunner behaviour with some custom fields, where selecting a specific select option in Field A reveals and makes mandatory Field B and C. The script runs and works.
The issue is that it does not work for all screens for all users. In Jira server, there are at least two creation screens. The one that appears when you click on Create from a project, issue or agile board page where creation screen pops up. The other is the Create issue page you get directed to after clicking Create button, or when you right-click and Open Link in New Tab / Window.
Behaviour works for all users I tested with for the latter, but for the create popup window, Field B and C do not visually appear for some users after selecting the specific select option of Field A, yet setting them to mandatory part works.
I am not sure if this is a bug jira and scriptrunner behaviour, or permission thing. I just know it works for me the jira/system admin and all of the project users, yet does not for the project admin.
The script does not even have any project role or permissions check, so should be working for everyone that has permission to the project that the script is mapped to.
Any help or something I can check would be appreciated.
Currently Jira 7.13, with Scriptrunner 5.4.45.
Have you looked to see if users have customized their create screen? If they have, then you will know how to replicate as an admin and tweak your script accordingly.
I know that behavior can't override the user's preference and show the field. And I'm not sure if there is a way to detect that a field is hidden like that. I tried a while ago isHidden() but this only reports the status of setHidden(true/false). Maybe this will require a feature request to Adaptavist.
At the least, it would be nice to detect the missing field and provide feedback to the user that they must un-hide it.
Ahhh, completely forgot about that. They had Custom selected with no checkmark for the Field B and C. Thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Melanie Pasztor,
as per my knowledge Scriptrunner's behaviour won't hide any fields unless below code is being used: field.setHidden(true)
Have you checked that those fields are not visible in screen by default for them? if so they have to check "Configure fields" option in top right corner of create screen and select those fields
BR,
Leo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
They are not visible until they are selected. I know of the error you are referring to, as I seen it in the process of troubleshooting the script before. It presently works as intended. Just does not work on one create screen for one user (while working on the other create screen for them), while it works as intended with my and other user profiles.
Here is the server side script for the selectfield:
def impactField = getFieldById("customfield_15890")
def effortField = getFieldById("customfield_15891")
def severityField = getFieldById(getFieldChanged())
def selectedOption = severityField.getValue() as String
def isImprovementSelected = selectedOption == "Improvement"
//severityField.setHelpText("selectedOption=$selectedOption isImprovementSelected=$isImprovementSelected")
impactField.setHidden(! isImprovementSelected)
impactField.setRequired(isImprovementSelected)
effortField.setHidden(! isImprovementSelected)
//effortField.setRequired(isImprovementSelected)
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.