It will be possible change the header from issue ?

fabio marcelo
Contributor
March 24, 2012

Hi all,

When an issue is created the Header from the issue show the name filled in the field summary right?

It will be possible change this header for this header show a custom field called Title instead Summary ?

Thanks in Advanced

BR

Fabio

4 answers

1 accepted

0 votes
Answer accepted
Dieter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 24, 2012

Olá Fabio,

I have jscripted a short solution (tested with 4.4.5) based on JavaScript that could be placed in the announcement banner. The best place for such kind of scripts is a web resource plugin module which also let's you control that the resource is only included on the view issue page. Here goes the solution:

<script>
(function($){
   $(document).ready(function(){

      // define the field that you want to show in header (instead of summary)
      // must be on screen else behaviour is as usual
      title_field = $("#customfield_10591-val")

      if (title_field) {

         title_val = title_field.text()
         if (title_val && title_val.length > 0) {
         
            // get summary field and save value in summary_val
            summary_field = $("#issue_header_summary a")
            summary_val = summary_field.text()

            // create the new summary element for for Details section
            newsummary = $("#issuedetails").children(":first").clone()
            newsummary_label = $("strong", newsummary)
            newsummary_label.text("Summary:")
            $("#type-val",newsummary).text(summary_val)

            // add the new summary element to details section (at the beginning)
            $("#issuedetails").prepend(newsummary)

            // change the header to value of custom field
            summary_field.text(title_val)
         }
      }
   });
})(AJS.$);
</script>

In the line title_field = ... you have to replace the id by the id of your custom field. This solution falls back to the old behaviour if there is no such a field. Please note that it's important to add the Title field to the screen.

I hope it works well in your environment

fabio marcelo
Contributor
March 27, 2012

Hi Dieter,

Thanks again for your help. I will test your solution in my environment test and let you informed.

Which file in JIra i should change to include a Custom field called "Classification" below from field "Prioridade" in the "Detalhes da Pendencia".

Can I do it in anouncement banner too ? Or there is other file that i can change ?

Thanks in Advance

BR

Fabio

Dieter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 28, 2012
You can create an classificationelement like the newsummaryelement as described in the lines after clone, but then you do not prepend this to the details section but add it after position x using Classificationelement.insertAfter( $("#issuedetails").children(":eq(x)")) X is the position of your prioridade field.(1,2,3,...)
0 votes
fabio marcelo
Contributor
March 24, 2012

Hi Dieter,

Thanks for your help.

Actually i need from the field Summary and too of the custom field Title. But i would like that the custom field Title was showed in the Header from issue and the summary was showed in "Detalhes da Pendencia"for example.

By the way it will be possible add other custom field called Classification in "Detalhes da Pendencia" for example below from the field Priority ?

Thanks in Advanced

BR

Fabio

0 votes
Dieter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 24, 2012

Olá de novo, if you need a copy of the summary in a custom field you could also achieve this by using a plugin, or a groovy postfunction

0 votes
Dieter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 24, 2012
Things like that can be done e.g. using JavaScript in a web resource module plugin for the view issue context, but i still don't understand why you can't use the summary. Also such a solution would work only for the issue screen and it's not quite clear which behaviour you'd expect e.g. in the issue navigator. Can't you use summary because you must outdent the information contained in the custom field on the top of the screen because it's very important?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events