Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Excerpt

JIRA 7 bug

Jira
serverAtlassian JIRA
columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
serverId144880e9-a353-312f-9412-ed028e8166fa
keyJRA-59364
causes most 'Created vs. Resolved Chart' gadgets on dashboards to break with the error:

Invalid field. Valid values are count, cumulative.

Broken portlets can be fixed individually by editing them and setting Collection Operation to either Cumulative (emulating the old default behaviour) or Count:

However only the dashboard owner can do this, and it's not exactly intuitive.

This page describes an ugly, painful process whereby a luckless JIRA administrator can identify broken portlets, log in as each affected user and fix them. It requires root access to the JIRA installation, and the ability to run SQL against the JIRA database.

...

The bug affects portlet that have a user preference of isCumulative = true but don't have the preference newly introduced operation = cumulative parameter. So we could identify affected dashboards with the SQL (mysql CONCAT function used to join strings):

Code Block
sql
sql
SELECT concat('https://jira.example.com/secure/Dashboard.jspa?selectPageId=', portalpage.id)
FROM portalpage
	JOIN portletconfiguration ON portalpage.id=portletconfiguration.portalpage
	JOIN gadgetuserpreference ON portletconfiguration.id=gadgetuserpreference.portletconfiguration
WHERE gadgetuserpreference.userprefkey='isCumulative' AND gadgetuserpreference.userprefvalue='true'
	AND NOT EXISTS (SELECT * FROM gadgetuserpreference g WHERE g.portletconfiguration=portletconfiguration.id AND userprefkey='operation' AND userprefvalue='cumulative') ;

This gives one a list of URLs of problematic dashboards:

...

Code Block
sql
sql
SELECT distinct concat('https://jira.example.com/user.jsp?lastPage=/secure/Dashboard.jspa?selectPageId=', portalpage.id, '&user=',  app_user.lower_user_name)
FROM gadgetuserpreference g JOIN portletconfiguration p ON g.PORTLETCONFIGURATION = p.ID
	JOIN portalpage on p.portalpage=portalpage.id
	JOIN cwd_user ON portalpage.username=cwd_user.user_name
	JOIN app_user ON cwd_user.user_name=app_user.user_key
WHERE p.GADGET_XML like '%createdvsresolved-gadget.xml' AND g.USERPREFKEY='isCumulative' AND g.USERPREFVALUE='true'
	AND NOT EXISTS (select * from gadgetuserpreference WHERE portletconfiguration=p.ID AND USERPREFKEY='operation' AND USERPREFVALUE='cumulative');

 

For each URL:

  • Open in a browser
  • Find the broken portlet:
  • Click 'Edit' in the top-right
  • Change the Collection Operation from 'count' to 'Cumulative':

You can re-run the SQL query, whose results should get shorter after each gadget is fixed.

Step 3: Uninstall user.jsp

Log out (of whichever user you last became) and back in as yourself.

...