Forums

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

How to restrict .bmp, .exe, .bat, jam.dev, etc attachment types while uploading for an issue in JIRA

Rahul
Contributor
July 17, 2024

 

How to restrict .bmp, .exe, .bat, jam.dev, etc attachment types while uploading for an issue in JIRA

2 answers

1 vote
Rilwan Ahmed
Community Champion
July 17, 2024

Hi @Rahul ,

In native jira, there is NO option to restrict files based on types. There is already a feature request with Atlassian and it is in "Under consideration" status. You can watch and vote for this ticket: https://jira.atlassian.com/browse/JRACLOUD-61024

They have also mentioned the workaround in same ticket. Check if it works for you.

If you have script runner plugin, there is simple scripted validator which can do the task for a extend. 
https://docs.adaptavist.com/sr4js/latest/features/workflows/validators/validating-attachments-links-in-transitions#blocking-files-by-extension

0 votes
Maciej Dudziak _Forgappify_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 18, 2024

Hi @Rahul

It is not possible in Jira out-of-the-box. All you can do is validate the attachment properties during the transition. This can be the create transition or any other transition. It won't stop the user from uploading the attachment; however, it will block the creation of the issue or further transition until the attachment is removed.

You need a Jira expression-based validator provided by any app from the marketplace.

I am from Forgappify, and we developed Jira Expression Validator, which is part of the Workflow Building Blocks for Jira app. The expression you need is as follows:

issue.attachments.every(item => !item.filename.match('(bmp|exe|bat|jam.dev)$'))

I am leaving a link to the app's documentation if you are interested.

I hope it will help.

Cheers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events