Lets start with the basics, remember you can’t run unless you walk first, unless you’re an Avengers then you can do whatever you want. Use behaviors to control your fields on the Create screen, only this screen. Remember that!

  1. Set up your behavior: Once you name your new behavior you have the options to add the fields that you want to modify. How this works is if you add the “Component/s” field, the behavior will run the groovy script you add whenever the field is changed. The script can modify, hide, or make another field required.
  2. The Initializer: The code you enter here will run right when the user enters the Create screen. Below is a sample initializer, it gets the custom field with its name, hides it (hidden(true)), and makes it required (required(true)).
  3. Further configure your behavior to work with fields, such as the “Component/s” field. You can unhide and make a custom field required if the “Component/s” field has a value (code snippet below).
  4. Lastly, you need to map the behavior with the project and issuetype. Behaviors even work with Service Desk projects and their request types! You can choose to apply the script to all projects, a specific project, all issuetypes, or a specific issuetype.