Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Why is Fix Version description not displayed?

Lacey Also April 13, 2015

In the JIRA field Fix Version, we have versions for multiple release types (Base, Custom, et al). I have added the release type in the Description fields for all Versions. I require the description to show in render dropdown on UI so people don't pick the wrong one for version overlaps (15.0 versus 15.0.0). Renderer only shows the number, not an associated description. Why does this not occur?

 

Running JIRA 5.04 (plans to upgrade to 5.1 within the next three months).

2 answers

0 votes
Ken D: Uemura May 1, 2015

I've tested this through the terminal and worked. It needs to be placed somewhere in the view issue https://answers.atlassian.com/questions/131271

(function() {
    var versions = {};
    if (AJS.Meta.get("issue-key")) {
        jQuery.get('/rest/api/2/project/' + AJS.Meta.get("issue-key").split("-")[0] + '/versions', function(json) {
            for (var i in json) {
                versions[json[i].id] = json[i].description;
            }
        }).then(function() {
            console.log("Versions", versions);
            console.log("Overwriting AJS.List.prototype._renders.suggestion");
            AJS.List.prototype._renders.suggestion = function(descriptor, replacementText) {
                //adding the label as a class for testing.
                var idSuffix = descriptor.fieldText() || descriptor.label();
                var itemId = AJS.escapeHTML(AJS.$.trim(idSuffix.toLowerCase()).replace(/[\s\.]+/g, "-")),
                    listElem = AJS.$('<li class="aui-list-item aui-list-item-li-' + itemId + '"><a class="aui-list-item-link"/></li>'),
                    linkElem = listElem.children();
                if (descriptor.selected()) {
                    listElem.addClass("aui-checked");
                }
                if (this.options.hasLinks) {
                    linkElem.attr("href", descriptor.href() || "#");
                }
                if (descriptor.styleClass()) {
                    linkElem.addClass(descriptor.styleClass());
                }
                if (replacementText) {
                    linkElem.html(replacementText);
                } else if (descriptor.html()) {
                    linkElem.html(descriptor.html());
                } else {
                    linkElem.text(descriptor.label());
                }
                if (descriptor.labelSuffix()) {
                    var suffixSpan = AJS.$("<span class='aui-item-suffix' />").text(descriptor.labelSuffix());
                    linkElem.append(suffixSpan);
                }
                if (descriptor.icon() && descriptor.icon() !== "none") {
                    var icon = AJS.$('<img class="icon"  alt="" />');
                    icon.attr("src", descriptor.icon());
                    linkElem.addClass("aui-iconised-link").prepend(icon);
                }
                // Setting title with version description
                if (versions[descriptor.value()]) {
                    descriptor.properties.title = versions[descriptor.value()];
                }
                if (descriptor.title()) {
                    linkElem.prop('title', descriptor.title());
                } else {
                    linkElem.prop('title', linkElem.text());
                }
                listElem.data("descriptor", descriptor);
                return listElem;
            }
        })
    }
})();
0 votes
Jobin Kuruvilla [Adaptavist]
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.
April 13, 2015

Did you update the description in the correct field configuration?

Lacey Also April 13, 2015

@Jobin Kuruvilla [Go2Group] , yes - edited descriptions for the fix versions on Versions tab in applicable project for which I'm trying to get them to show.

Lacey Also April 13, 2015

(Just so we're clear - the description to be shown is not the FIELD "Fix Versions" but the descriptions for individual fix versions themselves)

Jobin Kuruvilla [Adaptavist]
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.
April 13, 2015

Ah ok. There is no option to show the version description in the dropdown. It only shows the name. You can probably do it with the help of some javascript programming.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events