Forums

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

Make attachment mandatory for Jira Service Management & set specific message

Vishal
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.
March 10, 2022

Hi Guys,

Is it possible to make attachment mandatory in jira service management portal ? I have tried couple of things but they are not working. Could you please suggest ? I am trying to achieve it using scriptrunner but so far unsuccessful. I want to set specific message & that is what the problem is.

I am using a code 

import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.issue.AttachmentManager;

def attachments = issue.getAttachments();
def Summary = getFieldById("summary")

if(!attachments){
Summary.setError("You must add an attachment xxxxxx")
}

1 answer

0 votes
Sebastian Krzewiński
Community Champion
March 10, 2022

Hi @Vishal 

 

Checking attachments on transition is hard and make a lot of problems.

Why you don't try set attachments required on form and put description for attachment field?

 

Regards,

Seba

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events