Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Ability to fetch attachments from Jira issue and send to Freshservice via Rest API

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!

1 answer

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 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?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events