The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
  • Community
  • Q&A
  • Jira
  • Questions
  • How to restrict .bmp, .exe, .bat, jam.dev, etc attachment types while uploading for an issue in JIRA

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

Comments for this post are closed

Community moderators have prevented the ability to post new 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_
Atlassian Partner
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

TAGS
AUG Leaders

Atlassian Community Events