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

1 vote
Accepted answer

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

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
Published Nov 29, 2018 in Marketplace Apps

How to set up an incident workflow from the VP of Engineering at Sentry

Hey Atlassian community, I help lead engineering at Sentry, an open-source error-tracking and monitoring tool that integrates with Jira. We started using Jira Software Cloud internally last year, a...

1,739 views 3 11
Read article

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