How to add an attachment to an Insight Object using REST API

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform Notice: Cloud, Server, and Data Center - This article applies equally to all platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Purpose

This article walks through the process of uploading an attachment to an Insight Object via the REST API.

Solution

Attachment can be added to Insight Object by using /rest/insight/1.0/attachments/object/<objectID> Given below is a sample Example:

curl -D- -u <username>:<password> -X POST -H "X-Atlassian-Token: nocheck" -F "file=@<File_Path>" http://<base-url>/rest/insight/1.0/attachments/object/<objectID> 

Example: 
curl -D- -u admin:jira -X POST -H "X-Atlassian-Token: nocheck" -F "file=@/root/Rest-api/test-attachment" http://192.168.0.108:20201/rest/insight/1.0/attachments/object/1

More information are available on Insight REST API

STR-RestApi.mov



Last modified on May 11, 2023

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.