Use Case / Requirements:
Automatically export all Assets data (including all object types and objects) to an S3 bucket (or any external storage).
This should be a scheduled job that runs daily.
What I’ve tried so far:
I came across this community post: https://community.atlassian.com/forums/Jira-Service-Management/Automation-of-Object-schema-export/qaq-p/750997 which mentions an API call & script that can be used for exporting the object schema:
POST https://example.com/rest/assets/1.0/objectschemaexport/export/server
With the following params:
Response:
The problem is — I'm not sure where this ZIP file is getting stored (if anywhere), or whether this approach is officially supported/reliable.
Looking for help:
Has anyone implemented a working solution for scheduled exports of Assets data?
Is there a better/supported way to export object schema data on a schedule and push it to S3 (or any external storage)?
Any ideas or tips around automating this process would be super helpful.
Thanks in advance!
I haven't implemented a fully working solution yet, but you can automate daily exports of Assets data by using the internal export API, downloading the ZIP, and uploading it to S3. Although not officially documented or supported (afaik), some teams use this sort of solution in their production environments.
POST /rest/assets/1.0/objectschemaexport/export/server
GET /rest/assets/1.0/objectschemaexport/export/server/{resourceId}/download
aws s3 cp object_schema.zip s3://your-bucket-name/path/
import boto3
s3 = boto3.client('s3')
s3.upload_file('object_schema.zip', 'your-bucket-name', 'path/object_schema.zip')
I hope this information is helpful.
You might also consider posting such questions in the Atlassian Developer Community for more targeted responses.
Hi @Tuncay Senturk _Snapbytes_
I’ve reviewed your solution. The first API works perfectly, but the second API call returns a 404 Not Found error. I’ve double-checked everything, but I’m not sure why the error is occurring. Do you have any idea on this?
Checked Jira Service Assets REST APIs that doesn't include the second API. Is there any other documentation for Asset REST APIs?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That endpoint is not officially documented, and the 404 error can occur when the export job has not yet finished. The backend creates an export job asynchronously, so you need to wait for it to complete. Another reason for receiving a 404 might be an invalid resourceId. If you are still confident that everything is correct but it still returns a 404, the endpoint might not be available in the latest versions. Since this is not officially documented, I am unsure if it has changed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.