Are attachment IDs in Jira Server incremental?

Alpha Dawg April 13, 2020

I am working on a project that has about 50 attachments per Jira Issue. These attachments are processed automatically by our system. Recently, someone raised a question regarding the attachment IDs (numbers at the end of attachment URIs), whether they're incremental or not. Could you please share an insight on the same? Are they incremental on a per-issue basis, or are they incremental for a Jira project?

1 answer

1 accepted

1 vote
Answer accepted
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 13, 2020

They are sort-of incremental, but not by issue or project.  If you look at the pattern of IDs, you'll see it continually increasing, but in small hops. 

For example, a small Jira I have here has attachment ids like 10400, 10401, 10410, 10420, 10421. 

I can tell you that each attachment was added in that order - lower numbers = earlier time of attachment.  But there's no relation to project or issue.  And the holes are caused by Jira allocated a handful of ids to avoid clashing with other attachment processes.

This begs the question of why they're interested?

Alpha Dawg April 13, 2020

The way we currently process attachments is by sorting them by attachment ID. Now the ask is use the "created" date of the attachment to ensure that the attachments are always processed in the order they were uploaded, since it has been claimed (by an "expert") that sorting by attachment IDs doesn't assure that they are processed in the order they're uploaded. Hence my question. It would be OK if they're sort-of incremental for our use-case. 

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 13, 2020

It is close enough - you may find the odd one where a lower id is used for a more recent upload, but that will only happen when people hop over each other.  If, for example, I start an upload, then you start one, yours completes before mine - I will have the later create date, but the lower ID.  It's likely to be seconds or minutes.

Alpha Dawg April 14, 2020

Thanks for your help on this, Nic

Suggest an answer

Log in or Sign up to answer