Forums

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

how write the expression that attachment is not null

Sunilkumar k
Contributor
June 14, 2022

How to write the Jira Expression that attachment is not null

2 answers

0 votes
Oliver Siebenmarck _Polymetis Apps_
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.
June 14, 2022

Hi @Sunilkumar k ,

With Jira Expressions, the attachment attribute is never null – it's always a list. 

Now, if you want to check if there's an attachment to your issue, here's how to do that:

issue.attachments.length > 0

Above expression will be false unless an attachment has been added to the issue. 

Hope that helps,

 Oliver

Sunilkumar k
Contributor
June 14, 2022

Thanks @Oliver Siebenmarck _Polymetis Apps_ , its working fine as i need now

0 votes
Rob Horan
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.
June 14, 2022

Hi @Sunilkumar k ,

You can use the following JQL:

Search for issues that have attachments:
attachments IS NOT EMPTY  

Search for issues that do not have attachments:
attachments IS EMPTY 

Sunilkumar k
Contributor
June 14, 2022

Hi Rob Horan

 

It is throwing me a error i need jira expression to write in the custom validator that allow if attachment is some type or allow if attachment is null,

 

i am able to allow only excel attachments but i need to write the expression to allow if the attachment is null, an you please help me on this please

Rob Horan
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.
June 15, 2022

Hi @Sunilkumar k ,

That wasn't really clear.  I assumed you were searching based on attachments.

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