Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Issue Statistics Gadget

Thomas Heyne
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.
January 30, 2013

Hi everybody,

is it possible to customize the default settings of the Issue Statistics gadget ?

Per default the option 'Show Resolved Issue Statistics' is set to 'No'. Can this be set to 'Yes' by passing this to a application properties file or something?

After upgrading our JIRA projects from version 3.13. to 5.0 (via 4.4.) I was wondering why the total of displayed issues on the dashboard was lower than in the 3.13. version. After a couple of minutes I found out that the conversion of the portlets from JIRA 3.13. to JIRA 5.0 gadgets comes with the 'Show Resolved Issue Statistics'= 'No' option.

I want to avoid that I (and all the others user incl. our clients) would have to check all of their gadgets and adapt them manually by editing the gadget and selecting the 'Yes' option.

If possible to change the default behaviour I am in hope that conversion sets the option to 'Yes' in all of the gadgets.

Your answers are appreciated, thanks in advance.

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Renjith Pillai
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.
February 2, 2013
  1. Shutdown JIRA
  2. Backup database
  3. Run the below SQL in the database and COMMIT.
  4. Restart JIRA
update gadgetuserpreference set userprefvalue = true where userprefkey='includeResolvedIssues' AND portletconfiguration in (select id from portletconfiguration where gadget_xml like '%stats-gadget.xml')

Don't blame me if it breaks anything else :) (it shouldn't)

Thomas Heyne
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.
February 3, 2013

Hi Renjith,

your answer was very helpful and the kick-off for the solution.
Here the steps I run to solve the prob:

1. Checking the gadget in JIRA: Total Issues:87
2. Stop JIRA
3. Checking the table gadgetuserpreference

mysql> select * from gadgetuserpreference where userprefkey='includeResolvedIssues' AND portletconfiguration in (select id from portletconfiguration where gadget_xml like '%stats-gadget.xml');
...
4 rows in set (0.03 sec)

but my portlets were not in -> PORTLETCONFIGURATION=11692 !
4. Checking the table portletconfiguration

mysql> select * from portletconfiguration where portalpage=11692;

...
3 rows in set (0.00 sec)

5. Checking the table gadgetuserpreference by my portletconfigurations

mysql> select * from gadgetuserpreference where portletconfiguration BETWEEN 19285 AND 19287;

PORTLETCONFIGURATION | USERPREFKEY

19285 | sortDirection
19285 | isConfigured
19285 | projectOrFilterId
19285 | statType
19285 | sortBy
...
15 rows in set (0.00 sec) -> 3 by 5 rows, but no 'includeResolvedIssues' key !!!

6. Inserting missing 'includeResolvedIssues' values for my portletconfigurations
7. Checking the table gadgetuserpreference by queering only for only stat-gadgets

mysql> select * from gadgetuserpreference where userprefkey='includeResolvedIssues' AND portletconfiguration in (select id from portletconfiguration where gadget_xml like '%stats-gadget.xml');
...
7 rows in set (0.01 sec) -> my 3 rows are included now

8. Running your update statement
9. Checking the table gadgetuserpreference by queering only for only stat-gadgets

...
| 12551 | 19285 | includeResolvedIssues | 1 |
... 7 rows in set (0.01 sec)

10. Re-Running you update statement by using apostrophes around 'true'

...
| 12551 | 19285 | includeResolvedIssues | true |
... 7 rows in set (0.01 sec)

11. Checking the table gadgetuserpreference by queering only for only stat-gadgets
12. Start JIRA
13. Checking the gadget the gadget in JIRA: Total Issues:16110

Thank you very much,
Thomas H

Renjith Pillai
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.
February 4, 2013

Awesome :) (don't know why the includeResolvedIssues is not present by default in the tables). Anyway good.

Thomas Heyne
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.
February 4, 2013

awesome, indeed ...
there was another problem that came up after the import to JIRA 5.0 which was weird ...
all the JIRA Issues Calendar Gadgets that come with the JIRA Calendar plug-in were broken as well

1. Unable to retrieve gadget xml. HTTP error 404

had to repair by replacing the NULL value in the column 'gadget_xml' of the table 'portletconfiguration'

UPDATE portletconfiguration set gadget_xml = 'rest/gadgets/1.0/g/com.atlassian.jira.ext.calendar:issuescalendar-gadget/templates/plugins/jira/portlets/calendar/gadget/calendar-gadget.xml' WHERE portlet_id like 'com.atlassian.jira.ext.calendar:issuesCalander';

2. After looking at the gadget all of the Calendar Gadgets were missing their assigned 'projectOrFilterId'

so, I had to search for the properties in the tables 'propertyentry' and 'propertystring'

select propertyentry.id,propertyentry.entity_name,propertyentry.entity_id,portletconfiguration.portlet_id,propertyentry.property_key,propertystring.propertyvalue from propertyentry,propertystring,portletconfiguration where propertyentry.id like propertystring.id and propertyentry.entity_name like 'PortletConfiguration' and propertyentry.property_key like 'projectOrFilterId' and portletconfiguration.id like propertyentry.entity_id and portletconfiguration.portlet_id like '%:issuesCalander' order by propertyentry.id;

Thomas Heyne
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.
February 4, 2013

3. for the found results I had to add 6 properties each into the 'gadgetuserpreference' table

INSERT INTO gadgetuserpreference (id,portletconfiguration,userprefkey,userprefvalue) VALUES ('12573','15822','projectOrFilterId','filter-10870');
INSERT INTO gadgetuserpreference (id,portletconfiguration,userprefkey,userprefvalue) VALUES ('12574','15822','dateFieldName','duedate');
INSERT INTO gadgetuserpreference (id,portletconfiguration,userprefkey,userprefvalue) VALUES ('12575','15822','isConfigured','true');
INSERT INTO gadgetuserpreference (id,portletconfiguration,userprefkey,userprefvalue) VALUES ('12576','15822','numOfIssueIcons','100');
INSERT INTO gadgetuserpreference (id,portletconfiguration,userprefkey,userprefvalue) VALUES ('12577','15822','displayVersions','true');
INSERT INTO gadgetuserpreference (id,portletconfiguration,userprefkey,userprefvalue) VALUES ('12578','15822','refresh','false');

0 votes
Janki Desai April 25, 2019

How is the Percentage calculated in Issue Statistics Gadget?

TAGS
AUG Leaders

Atlassian Community Events