Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How do I check number of attachments?

Victor Maslov April 1, 2012

I'm making Create Issue validator in Jira 3.13, and want to check, if any file was attached OR specific custom field was filled, but `getAttachments` throws `NullPointerException` the same as stated in some old thread http://forums.atlassian.com/thread.jspa?forumID=100&threadID=43248, which has no solution.

Maybe someone already found one?

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
a February 4, 2013

Did you manage to find a solution?

I'm also having the same problem

0 votes
Eva
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.
April 23, 2012

I am not sure if JIRA 3.13 will lwork, but I craeted a plugin for JIRA 4.4.1, and use the following line:

ArrayList attachments = (ArrayList) origIssue.getAttachments();

This works for me. I know it said it return a collection, but putting into arraylist resolve my nullpointer problem.

TAGS
AUG Leaders

Atlassian Community Events