Hello Guys,
After creating a new JIRA service desk ticket using REST API, trying to add attachment to the ticket. Everything seems to be working fine from code perspective (Able to post the content and getting the response back with image details), though when opening up the ticket in Service desk web portal only a default thumbnail is showing up.
When clicking on the thumbnail following is on the top let corner of screen:
C# Code:
JiraIdentifier is ticket identifier, filestream is the attachment as stream. This code was working till last week I think. Already tried changing the content type to JSON and event octa stream with no luck.
NOTE: I am able to upload the image files from local machine but not from web app hosted on Azure server.
Any help is much appreciated.
Thanks in advance.
Hi Rahm,
I understand that you're using Jira Service Desk (JSD) Cloud and trying to upload an attachment using the REST API. JSD tends to manage attachments in a slightly different manner than other Jira Software/Core projects will. This is due in large part to the fact that JSD has a customer portal. This allows for unlicensed users to create/access their own requests, but it does not provide full access to Jira.
Your REST call seems to be calling the Add attachment - POST /rest/api/3/issue/{issueIdOrKey}/attachments endpoint. But since we know you're using Jira Service Desk, I would not have the expectation that a user in the customer portal will have access to that attachment in all cases. This happens because users in the customer portal don't have access to the issue itself, but rather only the request. So not all attachments on a Jira issue are expected to be visible to users in the customer role that can only see the customer portal. If an Agent shares that attachment/image with an customer in a response, then they can see it, but out of the box customers don't see all attachments on a Service Desk request.
Which is why you might have to do something a little different in the case of Service Desk projects. Instead, try using the endpoint Attach temporary file - POST /rest/servicedeskapi/servicedesk/{serviceDeskId}/attachTemporaryFile. Once this is a temporary file in Service Desk, you can then call the other endpoint Create attachment - POST /rest/servicedeskapi/request/{issueIdOrKey}/attachment. This should at least make sure that the attachment is added in the manner that a user in the customer portal would be able to do so.
Try this, and let me know if this helps.
Andy
Thanks for the suggestion.Will try and will update you once I test it to dev server or production after updating as per your suggestion.
(As attachments end point seems to be working fine while creating the tickets from localhost - local environment, issue only seems to be happening when creating them tickets from production environment).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.