Setting a Default Description
This simple example can be used as a tutorial.
To create a new Behaviour. Go to the Administration screen, and click the Behaviours link in the Behaviours section, or press
gg
or.
and type Behaviours.Enter a Name and Description for the new behaviour.
Click on Fields.
Click the Create Initialiser link.
Enter the following in the Script section (leave the first two fields blank):
def desc = getFieldById("description") def defaultValue = """h2. How to reproduce * step 1 * step 2 h2. Expected Result The widget should appear h2. Actual Result The widget doesn't appear""".replaceAll(/ /, '') if (!underlyingIssue?.description) { // <1> desc.setFormValue(defaultValue) }
Click Update.
Click the Add one now link to map this behaviour to a project.
Select one or more projects, then click Add Mapping.
This is a very simple configuration and should be used to check everything is working. For information about Jira Service Management mappings, see Behaviours with Service Management.Create a new issue in the project associated with this behaviour. You should see the default description.