Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

how to know the appKey value for getting asset value in Jira cloud

Mohammed Haneefa Farook
Contributor
June 19, 2023

Hi,

I have onboarded some asset to Jira cloud. Now I am trying to get or search particular asset object from Jira.

I have gone through API to get the asset object from Jira but I am unable to get the expected object as output.

API:  https:// --domain--/rest/assetapi/asset/{appKey}/{originId}

Can any one help what I need to enter in the place of  appKey& originId to get either all asset or a particular asset from Jira cloud ?

1 answer

1 vote
Rudy Holtkamp
Community Champion
June 19, 2023

Hi @Mohammed Haneefa Farook ,

Are you creating a script or do you use Automation for Jira. When you have the latter you can use e.g. the lookup object action.

Otherwise you need to take a look at these pages: https://developer.atlassian.com/cloud/assets/rest/api-group-object/#api-object-id-get

If you use Python I recommend to look at this Github repo and use the asset.py which will make your life a lot easier. 

Kind regards,

Rudy

Mohammed Haneefa Farook
Contributor
June 20, 2023

Hi @Rudy Holtkamp 

I have gone through the below link

https://developer.atlassian.com/cloud/assets/rest/api-group-object/#api-object-id-get

but I am not getting any reponce from that API,

Example: https://atlassian.net/jsm/assets/workspace/e7099f2b-2efb-4fee-88dd-2af7b4d8d2f1/v3/object/10100

The above is URL I have used with workspace and object Id but I am getting 404 Error as output.

Rudy Holtkamp
Community Champion
June 20, 2023

 https://atlassian.net/jsm/assets/workspace/e7099f2b-2efb-4fee-88dd-2af7b4d8d2f1/v3/object/10100

 

v3 should be v1, also include the header ('Accept: application/json') in your request.

image.png

Mohammed Haneefa Farook
Contributor
June 21, 2023

Hi,

I am using URL below only but I am getting 404 Error.

https://atlassian.net/jsm/assets/workspace/e7099f2b-2efb-4fee-88dd-2af7b4d8d2f1/v1/object/10100

I have changed the v3 to v1 but still i am getting exception as 404. The below is Image, I am trying to access,

IMG_API.PNG

The above image I tried but getting exception. May I know what is wrong in the above request ??

Rudy Holtkamp
Community Champion
June 21, 2023

Yeah, you still need to provide credentials.

You should create an API key. You can do that here. Then you need to encode it base64.

Go to e.g. https://www.base64encode.org/ you should use as input your_email_address:the_generated_api_key

image.png

E.g. username:apikey will give you this string: dXNlcm5hbWU6YXBpa2V5

With the string you can add a new header

Key          : Value
-----------------------------------------
Authorization: Basic dXNlcm5hbWU6YXBpa2V5

Add this to your request and run it again.

Mohammed Haneefa Farook
Contributor
June 21, 2023

Hi,

As you mentioned I have followed all the steps, but Still I am getting the exception 404 Not found.

The below mentioned Image is how I implemented it,

FYI: I have removed the domain name while posting the image,

 

IMG2.PNG

The below is encoded value of the Emailaddress:API_Key;

[redacted]

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