Forums

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

How to write a Jira Expression to the custom validator (jmweapp) to not allow the Exe attachment

Sunilkumar k
Contributor
June 14, 2022

Hi,

 

Need a jira expression to add a custom validator (using JMWE) app to validate that wether the given attachment by user is exe if it is exe then the user should not be able to create an issue, and if the attachment is any other type except exe then, the user should be able to create a issue,  and user should also be able to create the issue if there is no attachment attached,  how to write jira expression for this scenario

1 answer

1 accepted

1 vote
Answer accepted
David Fischer
Community Champion
June 14, 2022

Hi @Sunilkumar k 

you can create a Build-your-own Validator with this Jira expression:

!issue.attachments.length || !issue.attachments.some(it => it.filename.match("^(?i).*\.exe$"))

However, I haven't tested it when create a JSM Request from the customer portal, some validators just don't work in that specific case because of JSM limitations. 

Sunilkumar k
Contributor
June 15, 2022

Thanks @David Fischer 

 

I tried this and it is working fine as needed.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events