JIRA创建界面Summary字段验证规则异常问题求助
Fixing Jira Workflow Validator to Match "Test" Anywhere in Summary
Got it, let's resolve this issue where your Jira workflow validator only passes when the Summary is exactly "Test"—but you want it to pass whenever "Test" appears anywhere in the field. Here are two reliable solutions depending on your Jira setup:
Option 1: Use Jira's Built-in Text Field Contains Validator (Server/Data Center & Cloud)
This is the simplest approach if your Jira version supports it:
- Navigate to your workflow editor and locate the transition where you've set up the validator.
- Go to the Validators tab, then remove the existing exact-match validator for the Summary field.
- Click Add validator, then search for and select the Text Field Contains validator (usually under the "Field validation" category).
- Configure the validator:
- Select Summary as the target field.
- Enter
Testin the "Text to contain" field. - If you want the match to be case-insensitive (e.g., pass for "test", "TEST", etc.), check the corresponding "Case insensitive" option.
- Save your changes and publish the workflow to apply the update.
Option 2: Use a Groovy Script Validator (with ScriptRunner Plugin)
If you're using the ScriptRunner plugin (common for advanced Jira customizations), a short Groovy script will give you full control:
- In your workflow transition's Validators tab, add the Script Validator from ScriptRunner.
- Paste the following script into the editor:
// Get the Summary field value def summary = issue.summary // Check if Summary contains "Test" (case-insensitive) return summary?.toLowerCase()?.contains('test') // For case-sensitive matching, use this line instead: // return summary?.contains('Test')
- Save the validator and publish the workflow.
Testing Tips
- Test scenarios like:
- Summary = "Test" (should pass)
- Summary = "This is a Test Case" (should pass)
- Summary = "test run" (passes if using case-insensitive match)
- Summary = "Sample Case" (should fail)
内容的提问来源于stack exchange,提问作者Raju
相关产品推荐
相关产品推荐

