get attachment file with c#

Kevin Mauriello March 2, 2017

I have been unable to find a method of retrieving a JIRA attachment using the REST API.  So I am wondering if there might be a c# method to retrieve attachments.  Is there a .NET API available for Jira?

1 answer

1 vote
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 2, 2017

JIRA provides a REST API for external systems to talk to it.

c#, .net, java, ook, tcl - the language you are using is totally irrelevant.  The REST API lets you fetch attachments in any language, as long as they can call https://docs.atlassian.com/jira/REST/cloud/#api/2/attachment-getAttachment

Kevin Mauriello March 2, 2017

Unfortunately, that gives me all the information about the attachment, not the actual attachment file.  I am looking for a solution where I can make a rest call to retrieve the file itself or the binary data of the file.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 2, 2017

Not read the "including the URI of the actual attached file" bit of the doc then?

Kevin Mauriello March 3, 2017

Yes, the attachment meta has the URI of the file, however, in this implementation ServiceNow is running in the cloud and does not have access to the URI location.  So, again, I am looking for a solution where I make a call to JIRA and receive the baseencoded64 string in the REST payload.  It is actually amazing to me that JIRA/webhooks does not have the ability to send the actual file.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 3, 2017

You make the "request" by retrieving the URI.  Why can't ServiceNow do that?  It's a simple, basic function used everywhere else.

Kevin Mauriello March 3, 2017

Not if it does not have security access to the location

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 4, 2017

That's noting to do with JIRA, you need to fix your security setup.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events