Forums

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

JSM Assets API - how to add a field for referenced objects via api?

Günter Halmans August 5, 2025

Hi,

I would like to add a field from type "Object" to an object type via the Asset REST API, but I always get an error message "The input is not valid...".
Here is my payload:
payload = {
"name": "GH Services",
"type": "1",
"description": "This is my first test column",
"typeValue": "123", ## id of the object type the field should be referenced to.
"additionalValue": "123"
}

The request itself works, e.g. in case I add a default text field. 

Any idea how I could make it?
Thanks in advance!

1 answer

0 votes
Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 6, 2025

HI @Günter Halmans 

So you want to update an object in an asset schema via the API?

What is the API you are making?

Can you also show the object and the object type attributes?

 

Günter Halmans August 6, 2025

H Marc,

thanks for your reply!

Yes, I would like to add a new attribute to a given objecttype via API.
I'm using the following API "Post objecttypeattribute {objectTypeId}"

My request looks like this:
Screen 01.png
...and the attributes of objecttype with ID 141 like this:
Screen 02.png
Best regards,
Günter

Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 6, 2025

Hi @Günter Halmans 

Are you sure the id of the object type you are referencing is 123

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

The reference id is this also correct 123

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

This all needs to be correct, you can't just set random numbers.

Günter Halmans August 6, 2025

Hi Marc,

in reality the objectTypeIDs are as follows (I only used numbers for illustration...):
1. Objekttype "Application" has the ID 141 and for this the reference field should be generated. This ID is used to define in which objectType the new field should be inserted.

2. Objecttype "Service Cataloge" has the ID 143 and should be the target objecttype from which elements should be selected for a specific application. Therefore, I used this ID to define the parameters "typeValue" and "additonalValue".

I have tested the request with these two IDs

In case I would configure the field for the "Application" objectType, it would look like this:
Screen 03.png

By the way: for me it seems that the two parameters "typeValue" and "additonalValue" are redundant for Object references, correct?

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