Title: GroupEpic uses "iid" as ID attribute but should use "id"? · Issue #3261 · python-gitlab/python-gitlab · GitHub
Open Graph Title: GroupEpic uses "iid" as ID attribute but should use "id"? · Issue #3261 · python-gitlab/python-gitlab
X Title: GroupEpic uses "iid" as ID attribute but should use "id"? · Issue #3261 · python-gitlab/python-gitlab
Description: Description of the problem, including code/CLI snippet objects.epics.GroupEpic uses iid (group local ID) as ID attribute / encoded_id instead of the global id like, for example, objects.issues.ProjectIssue does. This leads to an erroneou...
Open Graph Description: Description of the problem, including code/CLI snippet objects.epics.GroupEpic uses iid (group local ID) as ID attribute / encoded_id instead of the global id like, for example, objects.issues.Proj...
X Description: Description of the problem, including code/CLI snippet objects.epics.GroupEpic uses iid (group local ID) as ID attribute / encoded_id instead of the global id like, for example, objects.issues.Proj...
Opengraph URL: https://github.com/python-gitlab/python-gitlab/issues/3261
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"GroupEpic uses \"iid\" as ID attribute but should use \"id\"?","articleBody":"## Description of the problem, including code/CLI snippet\n\n`objects.epics.GroupEpic` uses `iid` (group local ID) as ID attribute / `encoded_id` instead of the global `id` like, for example, `objects.issues.ProjectIssue` does. This leads to an erroneous behavior when updating an epic, i.e., the wrong epic is being updated.\n\n## Expected Behavior\n\n- I retrieve an epic: `epic = top_level_group.epics.list(...)[0]`\n- I manipulate the epic labels: `epic.labels.extend([...])` \u003c-- epic from a sub group\n- I save the epic: `epic.save()`\n- The new labels are saved for _exactly_ this epic, identified by `epic.id`.\n\n## Actual Behavior\n\n- The labels are saved for the first epic with `epic.iid`, which is not necessarily the one that I intended to update.\n\n## Discussion\n\nThe class `GroupEpic` explicitly sets `iid` as `_id_attr`. When updating the epic, the request is sent to `epic.manager.path/{epic_iid}`, but since `epic.manager.path` is the path to the top level group, the epic with id 3 in this top level group is updated instead of the one from the nested group.\n\nSo maybe it's not just using `id` instead of `iid` but fixing the manager (path) so that is uses the path of the actual group that the epic belongs to and not the path of the group that was used to retrieve all epics.\n\n## Specifications\n\n - python-gitlab version: 6.20 (but has been around since months or years and does still exist: https://github.com/python-gitlab/python-gitlab/blob/main/gitlab/v4/objects/epics.py#L26)\n - Gitlab server version (or gitlab.com): recent / not important\n","author":{"url":"https://github.com/sscherfke","@type":"Person","name":"sscherfke"},"datePublished":"2025-09-09T13:33:38.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/3261/python-gitlab/issues/3261"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:5aa896d7-ce5f-6e35-1ca5-7d290d01c459 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E540:3FB21B:1119957:17FE1B7:69723243 |
| html-safe-nonce | 980d5769668fe0f06f39105f3ef5adb1e382d44e8ed4ffa685409d87b1109def |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNTQwOjNGQjIxQjoxMTE5OTU3OjE3RkUxQjc6Njk3MjMyNDMiLCJ2aXNpdG9yX2lkIjoiNzY2OTY3MTE0MTE2OTA1MDE3OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 8283a2adc1ef890f815b66aa8d585b3d36d7d78604a6013d2f0a8673b5ff5463 |
| hovercard-subject-tag | issue:3398522677 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-gitlab/python-gitlab/3261/issue_layout |
| twitter:image | https://opengraph.githubassets.com/024d9855c4a6bb95ea8f4122b8cb6e2739b5642ef699a3f9030d541c31d87197/python-gitlab/python-gitlab/issues/3261 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/024d9855c4a6bb95ea8f4122b8cb6e2739b5642ef699a3f9030d541c31d87197/python-gitlab/python-gitlab/issues/3261 |
| og:image:alt | Description of the problem, including code/CLI snippet objects.epics.GroupEpic uses iid (group local ID) as ID attribute / encoded_id instead of the global id like, for example, objects.issues.Proj... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sscherfke |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2c16db4e575031f6e3be03e0437c1ab663e0b4643ba5cbbfba48c1e4fc056a11 |
| turbo-cache-control | no-preview |
| go-import | github.com/python-gitlab/python-gitlab git https://github.com/python-gitlab/python-gitlab.git |
| octolytics-dimension-user_id | 28886265 |
| octolytics-dimension-user_login | python-gitlab |
| octolytics-dimension-repository_id | 8077625 |
| octolytics-dimension-repository_nwo | python-gitlab/python-gitlab |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 8077625 |
| octolytics-dimension-repository_network_root_nwo | python-gitlab/python-gitlab |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | a12ab519e1537fa080535ea933f81d4fcef34da0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width