Add Product name of cloned bug to Clone This Bug link so user doesn't have to choose Product manually.

Add Product name of cloned bug to Clone This Bug link so user doesn't have =
to choose Product manually.

Bugzilla 5.0.3.

There's a "Clone This Bug" link in the bottom-right of show_bug.cgi. When I=
 click this link, I always have to choose a Classification and then a Produ=
ct. For my company's use, I expect us to clone into the same Product 99.9% =
of the time. So I'd like to add product name to the URL behind that link. (=
If anyone internally complains, then I'll make this a "Clone This Bug (Same=
 Product)" link later.

MY QUESTION
How can I get the product name of the displayed bug and add that product's =
name to the Clone This Bug URL? I know what it does to the URL, I just don'=
t know how to extract the product name from the current bug so I can put it=
 in the URL.

NOW
http://our_bugzilla_install.com/enter_bug.cgi?cloned_bug_id=3D12533

DESIRED
http://our_bugzilla_install.com/enter_bug.cgi?product=3DExampleProdName&clo=
ned_bug_id=3D12533

Thank you!
0
eirens
4/30/2018 4:23:30 PM
mozilla.support.bugzilla 10065 articles. 0 followers. Post Follow

4 Replies
71 Views

Similar Articles

[PageSpeed] 27

Guten Tag eirens@gmail.com,
am Montag, 30. April 2018 um 18:23 schrieben Sie:

> MY QUESTION
> How can I get the product name of the displayed bug and add that
> product's name to the Clone This Bug URL?

You need to customize templates, the product of the current bug is
available in thois. Have a look especially at "edit" and "show".

>     [%#############%]
>     [%#  PRODUCT  #%]
>     [%#############%]
>     <tr>
>       [% INCLUDE bug/field.html.tmpl
>           bug =3D bug, field =3D bug_fields.product, value =3D bug.product
>           override_legal_values =3D bug.choices.product
>           desc_url =3D "describecomponents.cgi"
>           editable =3D bug.check_can_change_field('product', 0, 1)
>       %]
>     </tr>

> bugzilla\template\en\default\bug\edit.html.tmpl
> bugzilla\template\en\default\bug\show.html.tmpl
https://bugzilla.readthedocs.io/en/5.0/integrating/templates.html

Mit freundlichen Gr=FC=DFen,

Thorsten Sch=F6ning

--=20
Thorsten Sch=F6ning       E-Mail: Thorsten.Schoening@AM-SoFT.de
AM-SoFT IT-Systeme      http://www.AM-SoFT.de/

Telefon...........05151-  9468- 55
Fax...............05151-  9468- 88
Mobil..............0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Gesch=E4ftsf=FChrer: Andreas Muchow

0
windows
4/30/2018 5:04:14 PM
Thank you.

I found that particular URL defined in "navigate.html.tmpl". Here:

....\bugzilla\template\en\default\bug\navigate.html.tmpl

Next step is for me to actually make the change.
0
eirens
4/30/2018 7:55:20 PM
Solved.

In a new custom\bugs\ copy of navigate.html.tmpl, I made a copy of this entry:

    <li>&nbsp;-&nbsp;<a href="enter_bug.cgi?cloned_bug_id=
                        [% bug.bug_id  FILTER uri %]">Clone This 
                        [% terms.Bug %]</a></li>

and changed the copied version to this:

    <li>&nbsp;-&nbsp;<a href="enter_bug.cgi?product=
                        [% bug.product  FILTER uri %]&cloned_bug_id=
                        [% bug.bug_id  FILTER uri %]">Clone This 
                        [% terms.Bug %] (
                        [% bug.product  FILTER uri %])</a></li>

That puts a "Clone This Bug (ProductName)" link next to the old "Clone This Bug" link and it has the URL I desire:

http://bugs.axiom-direct.com/enter_bug.cgi?product=Office*cloned_bug_id=12533
0
eirens
4/30/2018 9:06:44 PM
Solved. 

In a new custom\bugs\ copy of navigate.html.tmpl, I made a copy of this entry: 

    <li>&nbsp;-&nbsp;<a href="enter_bug.cgi?cloned_bug_id= 
                        [% bug.bug_id  FILTER uri %]">Clone This 
                        [% terms.Bug %]</a></li> 

and changed the copied version to this: 

    <li>&nbsp;-&nbsp;<a href="enter_bug.cgi?product= 
                        [% bug.product  FILTER uri %]&cloned_bug_id= 
                        [% bug.bug_id  FILTER uri %]">Clone This 
                        [% terms.Bug %] ( 
                        [% bug.product  FILTER uri %])</a></li> 

That puts a "Clone This Bug (ProductName)" link next to the old "Clone This Bug" link and it has the URL I desire: 

  http://our_bugzilla_install.com/enter_bug.cgi?product=ProductName&cloned_bug_id=12533
0
eirens
4/30/2018 9:24:56 PM
Reply: