How is the canvas node/element id determined

What I’m trying to do

Hi there - I’m wondering if anyone knows how is the canvas node/element id determined? Or does it not matter, as long as it’s unique? I’m looking to play around with editing a canvas programmatically and this is the 1st question that came to mind

Things I have tried

Searched on the forum

1 Like

I’ve put together small tool in Python that will dive into Jira, pick out a series of defined epics and the stories in those epics, and format them in a canvas (epic with arrows to the subordinate stories). I used a UUID4 for the node and edge ID, and it works perfectly.

Everything goes well as long as it’s 16 characters and unique.

By unique, do you mean unique for the canvas?

Tx for sharing. I’m not familiar with UUID4 so will take a look at that.

Is it hashed from the note title or time based? Sorry if obvious, I’m new to UUID

Correct. Even if a nested canvas shares a UUID with its parents, it’s not going to cause a problem.

UUID is a Universally Unique IDentifier. There’s a few different versions. Version 4 is pretty much the go-to unless you have a special reason to choose otherwise.

Wikipedia has details on it here. It’s useful because the way it’s generated, the collision risk is vanishingly small. To get a duplicate you’d need to be generating 1 billion UUIDs per second for about 85 years.

Ah great! Thanks for the explanation!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.