How to find favorited plans in Bamboo's database

Still need help?

The Atlassian Community is here for you.

Ask the community


Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

Bamboo users can mark plans as favorite. This article will cover how to find the favorite flag in the database.

Environment

All supported Bamboo versions.

Diagnosis

The favorite flag is technically a label, so table label is first place to look for:

select * from label where "name"=':favourite';
The removal of this flag is also recorded:
select * from label where "name"=':unmark-favourite';

The mapping is done in the table buildresultsummary_label, joined with the label id.

This table is mapped to the table build (plan definitions are stored there) through the build_id.

So, for example, let's say that we want to know all the users that marked the plan PR-PL as favorite. We will have to run:

select l.label_id, l.namespace from label l, buildresultsummary_label bl, build b
where l."name" = ':favourite'
and l.label_id = bl.label_id
and bl.build_id = b.build_id
and b.full_key = 'PR-PL';

(where PR-PL is the plan key)

(info) The table buildresultsummary_label contains a column called "user_name" that also records the username. This column refers to the user that made the change, but not to the actual favoritism.



Last modified on Dec 17, 2021

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.