Forums

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

REST for creating Asset object with Jira Project attribute

johanzetterlund
January 30, 2026

I have trouble creating object with a Project attribute using "Create object": https://developer.atlassian.com/server/jira-servicedesk/rest/v1103/api-group-assets---object/#api-assets-1-0-object-create-post

It's working fine for the Text attributes, 

I have tried:

"objectAttributeValues": [ { "value": "project key" } ]

"objectAttributeValues": [ { "value": "project name" } ]

"objectAttributeValues": [ { "key": "project key" } ]

"objectAttributeValues": [ { "value = { "key": "project key" } } ]

2 answers

1 accepted

2 votes
Answer accepted
Jorge Cammarota
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 Champions.
January 30, 2026

How to Send a Project-Type Attribute in the Create Request

The POST structure to create the object is as follows (simplified):
json

POST /rest/assets/1.0/object/create
{
"objectTypeId": 2154,
"attributes": [
{
"objectTypeAttributeId": 1234, // ID of the "Project" attribute in the Assets schema
"objectAttributeValues": [
{
"project": {
"key": "PROJKEY" // or "id": 10000
}
}
]
}
]
}

Key Points:

Use project, not value

For a Project-type attribute, the value should be placed in the project field, for example:

json

"objectAttributeValues": [
{
"project": {
"key": "MYPROJ" // project key
}
}
]

You need the correct objectTypeAttributeId

This is the ID of the attribute within the Assets object type (not the project ID).

You can find this ID via:

REST: GET /rest/assets/1.0/objectType/{objectTypeId}/attributes

Or by inspecting the UI (it may appear in the URL or network calls).

More "Realistic" Complete Example

Assume:

objectTypeId = 2001 (object type “Server”)

Attribute “JSM Project” (type Project) has objectTypeAttributeId = 3005

You want to link to the project with key SUPPORT

Request:
bash

curl --request POST \
--url 'https://your-jira/rest/assets/1.0/object/create' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"objectTypeId": 2001,
"attributes": [
{
"objectTypeAttributeId": 3005,
"objectAttributeValues": [
{
"project": {
"key": "SUPPORT"
}
}
]
}
]
}'

If preferred, you can use the project ID:
json

"project": { "id": 10001 }

This should help if any problems arise; please post them here so the community can assist you.

johanzetterlund
January 30, 2026

I have the objectTypeAttributeId. Tried this, where "IK" is the key of the jira project:

{
  "objectTypeId": 631,
  "attributes": [
    {
      "objectTypeAttributeId": 5322,
      "objectAttributeValues": {
        "project": {
          "key": "IK"
        }
      }
    },
    {
      "objectTypeAttributeId": 5319,
      "objectAttributeValues": [
        {
          "value": "foo"
        }
      ]
    },
    {
      "objectTypeAttributeId": 5323,
      "objectAttributeValues": [
        {
          "value": "bar"
        }
      ]
    }
  ]
}



But I get this error:

Cannot deserialize value of type `java.util.ArrayList<com.riadalabs.jira.plugins.insight.channel.web.api.rest.model.ObjectAttributeValueInEntry>` from Object value (token `JsonToken.START_OBJECT`) at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 89] (through reference chain: com.riadalabs.jira.plugins.insight.channel.web.api.rest.model.ObjectInEntry["attributes"]->java.util.ArrayList[0]->com.riadalabs.jira.plugins.insight.channel.web.api.rest.model.ObjectAttributeInEntry["objectAttributeValues"])
0 votes
johanzetterlund
January 30, 2026

It's working, thank you!

objectAttributeValues needs to be an array, like so:

 

{
  "objectTypeAttributeId": 5322,
  "objectAttributeValues": [
    {
      "project": {
        "key": "IK"
      }
    }
  ]
}

Suggest an answer

Log in or Sign up to answer