Insight: REST and IDs

Johannes Buverud
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.
November 10, 2017

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

2 votes
Answer accepted
Chad Peters November 10, 2017

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.  

Alexander Sundström
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.
November 13, 2017

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

Johannes Buverud
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.
November 15, 2017

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
TAGS
AUG Leaders

Atlassian Community Events