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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,467,463
Community Members
 
Community Events
177
Community Groups

REST API: Create Object with References Example

Would it be possible to provide here or via the REST API documentation 

https://documentation.riada.se/display/ICV50/Objects+-+REST

an example of creating an object which includes a referencedObject attribute? 

I'm not overly sure what's required and haven't had luck with my tests. 

1 answer

1 accepted

0 votes
Answer accepted

Hi Chad,

This is an example where I set an object referenced:

{
  "objectTypeId": 10834,
  "attributes": [
    {
      "objectTypeAttributeId": 90041,
      "objectAttributeValues": [
        {
          "value": "Test object"
        }
      ]
    },
    {
      "objectTypeAttributeId": 94875,
      "objectAttributeValues": [
        {
          "value": "IN-247"
        }
      ]
    }
  ]
}

What you have to set as the value is the KEY for the object.

Best Regards
Alexander

Thanks! Worked like a charm. 

Great :)

Thanks for the example! I'm doing something similar. However, what if you need to add multiple references in the same attribute?

For example, I have the Insight attribute called "Entity" that can have more than one reference object in there. Effectively, I'm trying to do something like:

 

{

    "objectTypeAttributeId": 68,

    "objectAttributeValues": [

        {

            "value": "SC-363||SC-300||SC-301"

        }

    ]

}

 

EDIT: I got it working

{

    "objectTypeAttributeId": 68,

    "objectAttributeValues": [

        {

            "value": "SC-363"

        },

        {

            "value": "SC-300"

        }

    ]

}

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events