Share this page

# Customize defect workflow

You can add workflow scripts to customize the field layout and field properties of the Defect window when you add or edit defects.

In this topic:

## Overview

You can write workflow scripts to customize the actions that ALM users can perform in the Defect window when they are adding or editing a defect. For example, the available fields, the required fields, the default auto-filled value of a field, and the only valid value of a field.

To write a workflow script, you add JavaScript to event procedures that are triggered by user actions.

Back to top

## Add workflow scripts

Add workflow scripts to customize the execution of the associated user actions.

To add a workflow script:

1. In the top right corner of Web Runner, click Menu > Customize.

2. Under Workflow Scripts > Project Scripts > Defects module script, select the defect event you want to add code to.

   Defect event | Description
   --- | ---
   Bug_New | Add code to this event to customize user actions when a new defect is added. For example, you can assign default values to required field when users add a defect.
   Bug_FieldChange | Add code to this event to customize user actions when the value of a particular defect field is changed. For example, you can hide or show one field depending on the value the users enter into another field.
   Bug_MoveTo |
   Bug_FieldCanChange | Add code to this event to prevent a field from being changed in specific cases. For example, you can prevent users from rejecting a defect (changing the status to Rejected) when its severity is urgent.
   Bug_FieldChange | Add code to this event to perform an action when the value of a particular field is changed. For example, you can show the Closing Date field with a default value when users change the defect status to Rejected.
   Bug_CanPost |
   Bug_CanDelete |
   Bug_AfterPost |
   Bug_DialogBox |

Back to top

## Workflow examples

https://admhelp.microfocus.com ALM 8942
Tips to improve your search results... ALM Help Center ALM Help Center ALM Help 17.0 All View Local Help Center View Online Help Center back Go back in browser history forward Go forward in browser history Remove search highlights next topic Go to next topic previous topic Go to previous topic Print the current topic Version: