I am working out the Rest API integration with our company's Freshservice cloud. I am able to create a Jira issue from Freshservice in Jira software (Cloud) and send updates in both directions.
The hump I encounter relates to sending over an attachment that is attached to the Jira issue to Freshservice, as Freshservice API needs a file location to fetch the attachment from.
Is there a way in Jira automation to fetch a (the latest) added attachment from the Jira issue, and store it somewhere, E.g. on a Sharepoint folder and then call the Freshservice API that get's it and uploads that attachment in the Freshservice ticket or in a note to the ticket?
Thanks for your suggestions!
I believe you can pull attachments if the FS user account has permissions, using the rest path in https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-attachments/#api-rest-api-3-attachment-content-id-get
Haven't used it myself, but PostMan seems to return a file.
To get attachment IDs, I would try #1 if automation is initiated in FS, #2 if initiated in Jira
1. first make a call using the rest path in https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-get which returns JSON that will include an array of attachments and their IDs
-or-
2. send over the ID(s) from JIra when pushing to FS
I'm not sure about how to get the last attachment. The closest I could find (for the Jira Automation side) was this: https://community.atlassian.com/t5/Jira-Software-questions/Get-last-added-attachment-to-issue-using-smart-values/qaq-p/1479825#M123079 but it looks like it didn't work for them as expected since .last refers to the place in the list, not the greatest ID.
HTH!
Erin
Hi Erin,
Thank you for your response. I am able to fetch the attachment from the Jira issue, with it's ID, the type etc. The problem that I have is that I cannot store it with automation on a filesystem path from where I can fetch it again for the second part of my function, that is is sending the attachment in a note to FreshService. The FreshService API needs a file path to fetch the attachment from.
I did not discover that ability in the Rest API documentation that you shared, or might I have missed that?
Thank you for your help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You didn't miss anything - I missed the requirement that FS needs a filepath.
What about using PowerAutomate to get the attachment via API and push it to Sharepoint or OneDrive?
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.