Use Bugzilla REST API to Insert Existing Product "Version"

David Miller justdave at bugzilla.org
Thu Mar 20 20:17:10 UTC 2025


I did upload the work-in-progress patch to the bug. It works if all you 
need is create and update. You can get a list of them from grabbing the 
product itself and looking at the versions in it.

On 3/11/25 6:48 PM, David Wright wrote:
>
> Hi Dave,
>
> Thanks for the updated info – we will monitor the bug for your updates 
> and apply the patch as soon as it is available.
>
> Thanks again!
>
> Let us know if you need anything else from our end.
>
> -Dave
>
> *From:*David Miller <justdave at bugzilla.org>
> *Sent:* Friday, March 7, 2025 12:49 AM
> *To:* David Wright <David_Wright at phoenix.com>; support-list at bugzilla.org
> *Subject:* Re: Use Bugzilla REST API to Insert Existing Product "Version"
>
> [Caution, this message was sent from an external sender.]
>
> Indeed there is...  my search foo must be lacking because I didn't 
> find that.  The patch still applies, almost (there's one line that 
> fails, but it's really easy to merge).  It's missing a bunch in that 
> patch to make it work though.  It needs interface information added in 
> Bugzilla::WebService::Server::REST::Resources.
>
> I have a new patch in the works... I have create and update working 
> (you would use update to rename it or toggle is_active), but get and 
> remove aren't working. I uploaded the WIP to the bug.
>
> On 3/5/25 8:24 PM, David Wright wrote:
>
>     Hi David,
>
>     Looks like there are folks who have already expressed the need for
>     this API. In fact someone already has a patch out for this feature
>     request but it has not been merged -
>      https://bugzilla.mozilla.org/show_bug.cgi?id=777047
>     <https://bugzilla.mozilla.org/show_bug.cgi?id=777047>, it’s been
>     there since version 4.2 for over 10 years.
>
>     Any idea if this could get implemented or a patch provided for
>     this fix?
>
>     Thanks,
>
>     Dave
>
>     *From:*David Miller <justdave at bugzilla.org>
>     <mailto:justdave at bugzilla.org>
>     *Sent:* Wednesday, March 5, 2025 2:50 AM
>     *To:* support-list at bugzilla.org; David Wright
>     <David_Wright at phoenix.com> <mailto:David_Wright at phoenix.com>
>     *Subject:* Re: Use Bugzilla REST API to Insert Existing Product
>     "Version"
>
>     [Caution, this message was sent from an external sender.]
>
>     OK, I finally got a chance to play around with this, and...  
>     you're correct, it's not implemented.  The API is indeed there
>     under the hood, but it's not exposed in the REST interface.  This
>     is probably an oversight and we should fix it.  But I started
>     looking into what would be needed to fix it, and discovered that
>     perhaps maybe it wasn't implemented because "version" already
>     exists as an object type in the REST API, and it's the version of
>     Bugzilla, not a product version.  Maybe we can make it be
>     "versions" with an "s"? Or maybe we just overload it and you get
>     the Bugzilla version if you don't specify anything after it and
>     there's no payload, and if there's a payload then we treat it like
>     a product version object?
>
>     Anyhow, I filed this at
>     https://bugzilla.mozilla.org/show_bug.cgi?id=1951899
>
>     On 3/3/25 7:08 PM, Dave Miller wrote:
>
>         I'm planning to experiment with this later tonight and see
>         what I can figure out. Sorry for the delay, I was buried with
>         end-of-the-month paperwork and haven't had a chance to play yet.
>
>         On March 3, 2025 5:33:56 PM EST, David Wright
>         <David_Wright at phoenix.com> <mailto:David_Wright at phoenix.com>
>         wrote:
>
>             Hello,
>
>             Any update for our follow up questions?
>
>             Thanks in advance for the support!
>
>             Thanks,
>
>             David Wright
>
>             Phoenix Technologies
>
>             *From:*David Wright
>             *Sent:* Tuesday, February 25, 2025 10:47 AM
>             *To:* 'Dave Miller' <justdave at bugzilla.org>
>             <mailto:justdave at bugzilla.org>; support-list at bugzilla.org
>             *Subject:* RE: Use Bugzilla REST API to Insert Existing
>             Product "Version"
>
>             Thanks Dave, that is helpful. Glad to hear it should be
>             possible.
>
>             Some follow up questions from our dev working on this issue:
>
>             I need more information to proceed. The link referenced in
>             your comment redirects to what appears to be a code
>             snippet of a Perl script working on the backend, but I
>             need info on how to work with the product out of band
>             through REST API calls.
>
>             I’ve listed some of the questions below that I wasn't able
>             to find an answer to in the docs:
>
>              1. What is the REST URI to call to work with versioning
>                 information for a particular product?
>              2. What is the payload to be passed when making the call
>                 for the below items?
>
>                  1. Adding a new version to a product
>                  2. Updating an existing version in a product
>                  3. Deleting an existing version from the product
>
>             Thanks,
>
>             Dave
>
>             *From:*support-list <support-list-bounces at bugzilla.org>
>             *On Behalf Of *Dave Miller
>             *Sent:* Monday, February 24, 2025 4:55 PM
>             *To:* support-list at bugzilla.org
>             *Subject:* Re: Use Bugzilla REST API to Insert Existing
>             Product "Version"
>
>             [Caution, this message was sent from an external sender.]
>
>             A version is its own object type.
>
>             https://bugzilla.readthedocs.io/en/latest/integrating/api/Bugzilla/Version.html
>
>             You can create a new version there by passing the version
>             name and the ID of the product to attach it to.
>
>             The function docs look like they're missing, but it's in
>             the example at the top.
>
>             On February 24, 2025 7:11:03 PM EST, David Wright
>             <David_Wright at phoenix.com> wrote:
>
>                 Hello,
>
>                 We are trying to Automate insertion of a Product
>                 “Version” instead of having to do it manually.
>
>
>                 According to the Bugzilla API manual, this does not
>                 seem to be an option for UPDATING, only CREATING a new
>                 product.
>
>                 https://bugzilla.readthedocs.io/en/latest/integrating/api/Bugzilla/WebService/Product.html
>
>                 But maybe we are looking at the wrong documenation or
>                 misunderstanding.
>
>                 Is there any way we can use the Bugzilla REST API to
>                 insert a new version for an *existing* product?
>
>                 This is the current manual process:
>
>                 Thanks,
>
>                 David Wright
>
>                 Phoenix Technologies
>
>         -- 
>         Sent from my Android phone with K-9 Mail. Please excuse my
>         brevity.
>
>
>
>
>         _______________________________________________
>
>         support-list mailing list
>
>         support-list at bugzilla.org
>
>         https://lists.bugzilla.org/listinfo/support-list
>
>     -- 
>
>     [Bugzilla Logo]
>
>     	
>
>     *Dave Miller*
>
>     Project Leader
>
>     *Bugzilla Project*
>
>     https://bugzilla.org/
>
>
>
>     _______________________________________________
>
>     support-list mailing list
>
>     support-list at bugzilla.org
>
>     https://lists.bugzilla.org/listinfo/support-list
>
> -- 
>
> [Bugzilla Logo]
>
> 	
>
> *Dave Miller*
>
> Project Leader
>
> *Bugzilla Project*
>
> https://bugzilla.org/
>
>
> _______________________________________________
> support-list mailing list
> support-list at bugzilla.org
> https://lists.bugzilla.org/listinfo/support-list
-- 
[Bugzilla Logo] 	
*Dave Miller*
Project Leader
*Bugzilla Project*
https://bugzilla.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bugzilla.org/pipermail/support-list/attachments/20250320/60932f6c/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 7345 bytes
Desc: not available
URL: <http://lists.bugzilla.org/pipermail/support-list/attachments/20250320/60932f6c/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: HLS5mVRusc19IHsS.png
Type: image/png
Size: 7345 bytes
Desc: not available
URL: <http://lists.bugzilla.org/pipermail/support-list/attachments/20250320/60932f6c/attachment-0003.png>


More information about the support-list mailing list