It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Have total of sub tasks override user story estimate?

We are using time based uset story estimating.

Is it possible to set Jira so that the sum of all sub task time estimates for a user story become the new user story time estimate?

1 answer

Hello,

I have made a workaround

I did a little something its not perfect at all should any of you do better just put it here.

- It add a button left of PLAN mode

- It work only for certain user since it can create a load on the isntance (get the issues data in rest)

It add the sum of subtask instead of story point/time estimate when you click on it. Also add a custom field (we have another kind of priority system)

Add this code into the Announcement banner

<script type='text/javascript'>
AJS.$(document).ready(function () {
    var username = AJS.$('#header-details-user-fullname').attr('data-username');
    console.log(username);
    if (username == 'name1' || username == 'name2(changeme)') {
        var path = window.location.pathname;
        console.log (path);
        if (path.substring(path.lastIndexOf('/') + 1).indexOf('RapidBoard') > -1) {
            AJS.$('#ghx-modes').before('<button class="aui-button" id="add-ubi">Show CF and Aggregate Time</center>');
                AJS.$('.add-ubi').on('click', function () {
                    $('add-ubi').trigger("click");
                });
                AJS.$("#add-ubi").click(function () {
                    //AJS.$("#add-ubi").toggleClass("active");
                    //AJS.$("#add-ubi").remove();
                    AJS.$('.ghx-issues > div').each(function () {
                     try {
                            console.log('Found issue list in sprints');
                            var row = this;
                            var issueKey = AJS.$(this).attr("data-issue-key");
                            //console.log('Found issuekey' + issueKey);
                        if (issueKey)
                        {
                            
                            AJS.$.getJSON(AJS.contextPath() + '/rest/api/latest/issue/' + issueKey, function (data) {
                                console.log('Got data for - ' + issueKey);
                                if (data.fields.customfield_10222 || data.fields.customfield_10222 != null)
                                {
                                    var value = data.fields.customfield_10222.value;
                                    if (value.lenght)
                                    {
                                    value = value.replace("'", "\'");
                                    var actions = AJS.$(row).find('.ghx-end');
                                    AJS.$(actions).before('<style type="text/css"> .ghx-issue-compact .ghx-end-ubi{position:absolute;right:-20px;top:5px;}</style><div class="ghx-end-ubi"><span title="Ubi Priority">' + value + '</span></div>');
                                    }
                                }
                                if (data.fields.aggregatetimeoriginalestimate)
                                {
                                    var value2 = data.fields.aggregatetimeoriginalestimate / 60 / 60 / 8;
                                    var actions2 = AJS.$(row).find('.ghx-end .aui-badge');
                                    AJS.$(actions2).html(value2.toFixed(2).replace(/[.,]00$/, "") + "d");
                                }
 
                            });
                        }
                     }
                        catch (ex)
                        {
                            console.log ("ERROR");
                        }
                    });
                    AJS.$('.js-issue-list > div').each(function () {
                        try {
                            console.log('Found issue list in backlog');
                            var row = this;
                            var issueKey = AJS.$(this).attr("data-issue-key");
                        if (issueKey)
                        {
                            console.log('Found issuekey' + issueKey);
                            AJS.$.getJSON(AJS.contextPath() + '/rest/api/latest/issue/' + issueKey, function (data) {
 
                                console.log('Got data for - ' + issueKey);
                                if (data.fields.customfield_10222 || data.fields.customfield_10222 != null)
                                {
                                    var value = data.fields.customfield_10222.value;
                                    console.log("we are inside of value" +issueKey)
                                    value = value.replace("'", "\'");
                                    var actions = AJS.$(row).find('.ghx-end');
                                    AJS.$(actions).before('<style type="text/css"> .ghx-issue-compact .ghx-end-ubi{position:absolute;right:-20px;top:5px;}</style><div class="ghx-end-ubi"> <span title="Ubi Priority">' + value + '</span></div>');
 
                                }
                                if (data.fields.aggregatetimeoriginalestimate != null || data.fields.aggregatetimeoriginalestimate != 'undefined' || data.fields.aggregatetimeoriginalestimate != "" || data.fields.aggregatetimeoriginalestimate.lenght != 0)
                                {
                                    var value2 = data.fields.aggregatetimeoriginalestimate / 60 / 60 / 8;
                                    var actions2 = AJS.$(row).find('.ghx-end .aui-badge');
                                    AJS.$(actions2).html(value2.toFixed(2).replace(/[.,]00$/, "") + "d");
                                }
 
                            });
                        }
                    }
                            catch (ex)
                    {
                        console.log ("ERROR");
                    }
                    });
        });
    }
}
});
</script>

So here is it I made it quick but ajust it to your need

Martin Poirier

Ubisoft

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Next-gen

Keyboard shortcuts have arrived for next-gen projects!

...ollected feedback from users around the lack of shortcuts, and we’re here to address that: In next-gen projects, I miss the keyboard shortcuts badly. This is particularly true on the Board, but also i...

143 views 0 2
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you