Hello,
I have a requirement to show mandatory field labels in Red in Create/Edit screens in Jira.
I believe we can manipulate the field labels using javascript. But my question here is - How do the system know that what are all the mandatory fields available in the screen just before the transition. Because, once we know the mandatory fields, then we can change the label color to red only for those mandatory fields.
For example: I am transitioning from screen A to screen B. In screen B, I have few system and custom mandatory fields (some of them are conditionally mandatory). So, while transitioning to screen B, immediately when the screen opens, all the mandatory fields labels should be in Red color.
Thanks for your help!
Kumar
So far in my investigation, I am able to get the mandatory field labels as Strings in Adaptavist Scriptrunner Behaviors script. But I am not able to turn these mandatory fields (both System and Custom fields) to Red color. Below is the code snippet I tried.
// requiredFields has the list of mandatory field labels.
for(String field in requiredFields){
field = field.trim()
String js = "<script>\n"+
"AJS.\$(\"label[for="+field+"]\").parent('label').css('color','red');\n"+
"</script>"
def FormField f = getFieldByName(field)
f.setLabel(js)
}
Any help is highly appreciated!
Thanks!
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.