# Troubleshooting Workflows

If you encounter problems when writing workflows or attaching workflows to projects, review the following list of conditions to determine how to resolve the situation.

| Condition | A workflow rule doesn't behave as expected and you want to inspect diagnostic messages from the script. |
| --- | --- |
| Cause | Workflow script messages are displayed in the workflow editor console, not in the browser developer console. |
| Solution | Add logging statements to the rule with `console.log()`, `console.warn()`, or `console.error()`, then reproduce the condition that triggers the rule.     Open the rule in the web-based workflow editor and check the Console pane. If you're troubleshooting a scheduled rule, also verify the `cron` expression. When a malformed cron expression prevents a rule from being scheduled, the error is recorded in workflow logs.     For YouTrack Server installations, workflow log entries are also written to the `workflow.log` file. For YouTrack Cloud instances, use the workflow editor console and contact the YouTrack support team if you need help checking instance logs.   |

| Condition | You can't create an action rule. YouTrack returns the error `Action rule can't have same event name as another action rule`.  |
| --- | --- |
| Cause | The name of the action rule matches an existing command. The name of the action rule is assigned to the command that runs the rule. Commands must be unique per server.  |
| Solution | Use another name for your action rule. |

| Condition | The workflow rule throws an error for a missing issue field, but the requires setup flag is not displayed in the workflows list.  |
| --- | --- |
| Cause | The field is not added to the [requirements](requirements.html) section.  |
| Solution | Add the field to the [requirements](requirements.html) section.  |
| Cause | The reference to the field in the [requirements](requirements.html) section is written in the wrong case.  |
| Solution | While the administrative check for requirements in workflow scripts is case-insensitive, the workflow accesses the issue fields case-sensitively. Compare the name of the field on the Custom Fields page with the reference in the [requirements](requirements.html) section of the script. Update the reference in the requirements section to match the case that is used for the name of the custom field.  |

| Condition | Changes have been applied to a custom script but the behavior is not changed. |
| --- | --- |
| Cause | Custom scripts are only reloaded when other scripts that reference them are updated or at application start.  |
| Solution | Make a minor change in a script that references the custom script (for example, add new line) and save it.  |

