Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Rrestricts tickets being created with summary that contains the string “test” and reported by your o

Michel saliba December 17, 2023

Hello,

 

i have jira app (data center) Jira Data Center 9.12 and ScriptRunner 8.17.0 installed.

The intergration between Jira on premise data center and Gmail to create issue when received an email to gmail email linked to the project is working properly
An email received to gmail is created by Jira as task
the Mail handler  under system....> incoming mail handler has been created as below :

server:test

dealy:1

handler : create a new issue or add new comment 

project: linked to my project
issue type :task

Also Custom script validator under scriptRunner ....> workflow for restricting ticket being created with summary that contains the string “test”  is working properly 
If I will try to create a ticket manually with summary containing test is failing.

import com.opensymphony.workflow.InvalidInputException

def summary = issue.summary
// Check if the summary contains the string "test"
if (summary && summary.toLowerCase().contains("test")) {
   // Issue creation is not allowed
   throw new InvalidInputException("Issue creation with 'test' in the summary is not permitted.")
}

But the question please an email received with subject test is creating normally as JIRA ticket with summary test  the number of transaction for Custom script validator is still the same

To note that the mail handler is creating the issue with having type as service request instead of task  and the mail hanlder is configured as issue type = task


I need to let the mail handler to use the defalut workflow in order to match the workflow used by customer script validator
can you please advise urgently ?

Please advise 

Regards

1 answer

0 votes
Mirek
Community Champion
December 30, 2023

Hi @Michel saliba 

Rather than finding a way to prevent creating a tickets by handler on Jira side.. I suggest to log in to your mailbox that is connected and create a rule there to move the emails with "test" in a Subject to a different folder than Inbox (not processed by Jira).

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events