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

ASSET API to get the import result

Samuel Gatica _ServiceRocket_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 6, 2024

 

Hi All,

I need to get the details of the import using the API. 

I discovered in the API documentation that the endpoint "Get importsource {importSourceUuid} executions {importExecutionUuid} status" might be applicable to my needs. However, I am uncertain about the required parameters.

  • importExecutionUuid
  • importSourceUuid

Could you please let me know where I can obtain them?


Thanks in advance!

1 answer

1 accepted

0 votes
Answer accepted
Marini Marini August 14, 2024

Hi @Samuel Gatica _ServiceRocket_ 

If I understand correctly, you have triggered an Asset Import and it is a long running import and would like to get the details of the import such as the status or progress. In this case, you can use the same API to start the import to get the status or progress in percent.

// To trigger an Assets import
curl --request POST --url https://api.atlassian.com/jsm/assets/workspace/<workspace-id>/v1/import/start/<import configuration id> --header 'Accept: application/json' --header 'Authorization: Basic <encoded api token>'

// To check the import status (only work if the import is still running. Otherwise, you will get 404 error.)
curl --request POST --url https://api.atlassian.com/jsm/assets/workspace/<workspace-id>/v1/import/start/<import configuration id>/properties/status --header 'Accept: application/json' --header 'Authorization: Basic <encoded api token>'

// To check the import progress in percent (only work if the import is still running. Otherwise, you will get 404 error.)
curl --request POST --url https://api.atlassian.com/jsm/assets/workspace/<workspace-id>/v1/import/start/<import configuration id>/properties/progressInPercent --header 'Accept: application/json' --header 'Authorization: Basic <encoded api token>'

Take a look at the Response from the above start the import API and you will see importExecutionUuid. I guess you can only get the importExecutionUuid if you trigger the import from an API, not from the GUI.

While for the importSourceUuid, if I can guess, it is maybe referring to the Import Configuration ID as in this KB article.

I hope it helps.

-Marini

Samuel Gatica _ServiceRocket_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 16, 2024

Thanks @Marini Marini 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events