{"id":22128615,"url":"https://github.com/redhat-plumbers-in-action/bugzilla","last_synced_at":"2025-07-02T22:38:17.060Z","repository":{"id":59596459,"uuid":"537148715","full_name":"redhat-plumbers-in-action/bugzilla","owner":"redhat-plumbers-in-action","description":"🐞 A NodeJS module to access Bugzilla instances through the REST API.","archived":false,"fork":false,"pushed_at":"2025-06-16T07:43:28.000Z","size":5570,"stargazers_count":2,"open_issues_count":6,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-16T08:26:34.546Z","etag":null,"topics":["bugzilla","rest-api","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/bugzilla","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/redhat-plumbers-in-action.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-09-15T18:01:56.000Z","updated_at":"2025-06-16T07:43:32.000Z","dependencies_parsed_at":"2023-02-18T20:15:43.265Z","dependency_job_id":"ae2ad7c5-4f0e-4e37-b718-97f02dc03980","html_url":"https://github.com/redhat-plumbers-in-action/bugzilla","commit_stats":{"total_commits":290,"total_committers":4,"mean_commits":72.5,"dds":0.4896551724137931,"last_synced_commit":"4aea39d04cd9df9a7a61c0e8e7554adf39dd17cb"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/redhat-plumbers-in-action/bugzilla","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-plumbers-in-action%2Fbugzilla","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-plumbers-in-action%2Fbugzilla/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-plumbers-in-action%2Fbugzilla/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-plumbers-in-action%2Fbugzilla/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/redhat-plumbers-in-action","download_url":"https://codeload.github.com/redhat-plumbers-in-action/bugzilla/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-plumbers-in-action%2Fbugzilla/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263228410,"owners_count":23433974,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bugzilla","rest-api","typescript"],"created_at":"2024-12-01T17:46:17.390Z","updated_at":"2025-07-02T22:38:17.039Z","avatar_url":"https://github.com/redhat-plumbers-in-action.png","language":"TypeScript","readme":"# Bugzilla | [![npm version](https://badgen.net/npm/v/bugzilla)](https://www.npmjs.com/package/bugzilla) [![Build](https://github.com/redhat-plumbers-in-action/bugzilla/actions/workflows/build.yml/badge.svg)](https://github.com/redhat-plumbers-in-action/bugzilla/actions/workflows/build.yml) [![codecov](https://codecov.io/gh/redhat-plumbers-in-action/bugzilla/branch/main/graph/badge.svg)](https://codecov.io/gh/redhat-plumbers-in-action/bugzilla)\n\nTypesafe access to [Bugzilla's REST API](https://bugzilla.readthedocs.io/en/latest/api/index.html).\n\nVery early work in progress, getting info from a bug or searching bugs is the main priority right\nnow.\n\n## Tests\n\nSome basic tests now exist. `yarn test` will run the main tests. `yarn run itest` will run some\nintegration tests against a real Bugzilla instance however you must have docker installed\nin order to run these.\n\n## API\n\n### Creating the API instance\n\n```javascript\nimport BugzillaAPI from \"bugzilla\";\n\nlet api = new BugzillaAPI(\"https://bugzilla.mozilla.org\", \"\u003capi key\u003e\");\nawait api.version();\n```\n\nOr for username/password authentication:\n\n```javascript\nimport BugzillaAPI from \"bugzilla\";\n\nlet api = new BugzillaAPI(\n  \"https://bugzilla.mozilla.org\",\n  \"\u003cusername\u003e\",\n  \"\u003cpassword\u003e\",\n);\nawait api.version();\n```\n\n### Retrieving bugs by ID\n\n```javascript\nlet bugs = await api.getBugs([123456, 123457]);\n```\n\n### Querying bugs\n\nYou can use a `quicksearch` string:\n\n```javascript\nlet bugs = await api.quicksearch(\"severity:blocker,critical\");\n```\n\nOr any advanced search which can be passed in a number of ways:\n\n```javascript\n// You can just pass a full advanced search url:\nlet bugs = await api.advancedSearch(\n  \"https://bugzilla.mozilla.org/buglist.cgi?email1=dtownsend%40mozilla.com\u0026emailassigned_to1=1\u0026resolution=---\u0026emailtype1=exact\u0026list_id=15603348\",\n);\n\n// Or just the query string part:\nlet bugs = await api.advancedSearch(\n  \"email1=dtownsend%40mozilla.com\u0026emailassigned_to1=1\u0026resolution=---\u0026emailtype1=exact\u0026list_id=15603348\",\n);\n\n// Or as a record:\nlet bugs = await api.advancedSearch({\n  email1: \"dtownsend@mozilla.com\",\n  emailassigned_to1: \"1\",\n  resolution: \"---\",\n  emailtype1: \"exact\",\n});\n```\n\n### Filtering bug fields\n\nTo reduce bandwidth or improve performance it is possible to filter the fields returned by functions\nthat return bugs:\n\n```javascript\n// To only retrieve certain fields.\nlet bug = await api.getBugs([123456]).include([\"id\", \"product\", \"component\"]);\n\n// Or to filter out certain fields.\nlet bug = await api.getBugs([123456]).exclude([\"cc_detail\"]);\n```\n\nAssuming you use a static array the returned types will correctly reflect to available fields.\n\nCurrently the `_all`, `_default`, `_extra` and `_custom` special field shortcuts are not currently\nsupported.\n\nCustom fields are not currently returned.\n\n### Retrieving comments by ID\n\n```javascript\n// .getComment() accepts one parameter, ID of comment, as number\nlet comment = await api.getComment(123456);\n```\n\nReturn value is Comment object.\n\n### Retrieving all comments of bug\n\n```javascript\n// .getBugComments() accepts one parameter, ID of bug, as number\nlet comments = await api.getBugComments(123456);\n```\n\nReturn value is array of Comment objects.\n\n### Creating comments\n\n```javascript\nlet comment = await api.createComment(\n  123456,\n  \"This is new comment on bug #123456\",\n  { is_private: false },\n);\n```\n\nReturned value is ID of the newly-created comment.\n\n### Creating bugs\n\n```javascript\nlet bug = await api.createBug({\n  product: \"TestProduct\",\n  component: \"TestComponent\",\n  version: \"unspecified\",\n  summary: \"'This is a test bug - please disregard\",\n  alias: \"SomeAlias\",\n  op_sys: \"All\",\n  priority: \"P1\",\n  rep_platform: \"All\",\n});\n```\n\nReturned value is ID of the newly-created bug.\n\n### Updating bugs\n\nExample of adding email address on cc list of bug #123456:\n\n```javascript\nlet response = await api.updateBug(123456, {\n  id_or_alias: 123456,\n  cc: { add: \"my@email.io\" },\n});\n```\n\nReturned value is same as described in Bugzilla [docs](https://bugzilla.readthedocs.io/en/latest/api/core/v1/bug.html#update-bug).\n\n### Retrieving attachments by ID\n\n```javascript\n// .getAttachment() accepts one parameter, ID of attachment, as number\nlet attachment = await api.getAttachment(123456);\n```\n\nReturn value is Attachment object.\n\n### Retrieving all attachments of bug\n\n```javascript\n// .getBugsAttachments() accepts one parameter, ID of bug, as number\nlet attachments = await api.getBugAttachments(123456);\n```\n\nReturn value is array of Attachment objects.\n\n### Creating attachments\n\n```javascript\nlet attachment = await api.createAttachment(123456, {\n  ids: [123456, 123457],\n  data:  Buffer.from('Attachment content'),\n  file_name: \"Attachment name\",\n  summary: \"Attachment summary\",\n  content_type: \"text/plain\",\n  is_private?: false,\n});\n```\n\nReturned value is an array of IDs of the newly-created attachments.\n\n### Updating attachments\n\nExample of changing content type of attachment #123456:\n\n```javascript\nlet response = await api.updateAttachment(123456, {\n  attachment_id: 123456,\n  content_type: \"text/plain\",\n});\n```\n\nReturned value is same as described in Bugzilla [docs](https://bugzilla.readthedocs.io/en/latest/api/core/v1/attachment.html#update-attachment).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredhat-plumbers-in-action%2Fbugzilla","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredhat-plumbers-in-action%2Fbugzilla","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredhat-plumbers-in-action%2Fbugzilla/lists"}