Require Comment For Action
Conditions can also be set based on workflow transitions or states. In the following example, we show you how to make the comment field required when an issue is moved from Done to Reopened.
Workflow functions
If you want more information about workflow functions and ScriptRunner workflow functions, check out our Workflow Functions Tutorial
- Make sure you know which workflow action you want to associate this behaviour to. For this example, we want to associate this behaviour with the Reopen issue transition in a default Jira workflow. For example:
- Make sure the workflow transition you want to associate this behaviour to includes a screen. For example:
- From ScriptRunner, navigate to Behaviours.
- Select Create Behaviour.
- Enter a name for the behaviour. In this example we enter
Require a comment when reopened
. - Optional: Enter a description for the behaviour.
- Select Create Mapping.
- Select the project and issue type(s) to map this behaviour to. In this case we chose the ITSM project and All issue types.
- Select Add Mapping to confirm the mapping.
- Select Create to create the behaviour.
You're taken to the Edit Behaviour screen where you can configure the behaviour further.
- Select a Guide workflow. This is the workflow you want to associate this behaviour to. In this example we select the
Jira Service Management default workflow
. - Scroll to the Add Field field, select the Comment field, and then select Add.
Change the Optional/Required field to display Required.
- Select Add new condition. The Add condition pop-up displays.
- Configure the condition as follows:
- Select When for Applicability.
- Select Workflow Action for Condition.
- Select Reopen issue for Workflow Action.
Select Add.
- Select Save Changes.
You can test to see if this behaviour works. The comment field will display as required when a completed issue is reopened. The field will also display a warning if a user tries to transition the issue without adding a comment.