Insight: REST and IDs

When creating a REST integrastion in Insight, we have to use the object types and attribures correct IDs.

When exporting a schema from one environement to the next, the IDs change, thus forcing us to change the REST integration.

Is there a way to do this in a more generic way?

1 answer

1 accepted

Accepted Answer
1 vote

While not ideal, I've had to deal with this issue inside my REST integration code as I don't see any way that Insight will be able to "fix" this behavior given it's really a database level issue (IDs are Identity columns). 

My approach has been to loop though the object schemes using the /rest/insight/1.0/objectschema/list end point and look for the name of my object schema. Once I find that and the corresponding ObjectSchemaID, I then load all of the object types for that schema using the /rest/insight/1.0/objectschema/{id}/objecttypes/flat end point.

Once I have the ObjectSchemaId and the catalog of ObjectTypeIds within that schema, I can accomplish pretty much anything else I need to within my REST integration code. 

Just an option - hope that helps somewhat.  

Hi Johannes and Chad,

Just as Chad described, the reason why ids are used is related to the db level, and that names for object types and attributes are not unique. As one example you have the Name, Key, Created and Updated attributes on all  object types, without the id, it would be impossible to know which of them that you're referring to.

Best Regards
Alexander

Thanks for your answers.

Thats sounds like an ok way to solve it, Chad.

The combination of object type and attribute would would give a unique value, but as long as it is the database IDs being used, this will always be a problem (unless if cloning the database which is never an option from test to production).

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Oct 11, 2018 in Marketplace Apps

You + one app + a desert island...

Hi all! My name is Miles and I work on the Marketplace team. We’re looking for better ways to recommend and suggest apps that are truly crowd favorites, so of course we wanted to poll the Community. ...

2,675 views 5 6
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you