how to fetch attachment details of issue from jira using rest api

Ramji September 17, 2018

Hi,

currently I'm working in a project say 'xxx' and has a fixVersion say 'yyy' and cyclename say 'Zzz' 

i wrote query to search for all the issue in that cycle and want to check whether all issue has attachment file present in it.

only some issue is returning attachment file in json file even though all issue is properly attached with files.

please help me with this problem

2 answers

0 votes
Mahesh Pawar September 17, 2019

Fields & expand should be a List

 &fields=[attachment]

0 votes
Charlie Misonne
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 17, 2018

Hi @Ramji

What I understand from your question:

Based on a JQL query you want to retrieve attachment details from all issues in that query. Your problem is that not all returned issues have attachment details in the json. Is that correct?

Can you post you jql query and REST call here?

 

Make sure you check the REST API documentation: https://docs.atlassian.com/software/jira/docs/api/REST/7.12.0/#api/2/issue-getIssue

Ramji September 18, 2018

Hi @Charlie Misonne

 

Yes that's the question

here is my jql query:

htttp://<URL>/jira/rest/api/2/serach?zql=project = <projectName> AND fixVersion = <fixversion> AND cycleName = <cycleName>

Thank you.

Charlie Misonne
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 18, 2018

try adding this to the end of your url: &fields=attachment

Ramji September 18, 2018

Hi @Charlie Misonne

 

I tried fields but its not working, Also i tried 

htttp://<URL>/jira/rest/api/2/issue/{issueid} url on two different issues from same cycle, 

one of the issue is fetching attachments while other is not but both the issue has file attached to it respectively.

 

Thank you.

mksiva January 21, 2019

Hi Ramji @Ramji,

I am also facing the same issue: I tried:

htttp://<URL>/jira/rest/api/2/issue/{issueid} url on two different issues from same cycle, 

one of the issue is fetching attachments while other is not but both the issue has file attached to it respectively.

Is there any solutions or findings on this?

 

Thanks

Siva Kalidasan

Suggest an answer

Log in or Sign up to answer