How to fetch plan owners information for a list of plans in Bamboo from the 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

This document provides the select query to get plan owner information from a list of plans. This KB also provides query to find the information of users who are running/building the build plans.

Environment

All supported versions of Bamboo.

Tested the query in Bamboo 8.0.4.

Solution

warning

This query is tested in Postgresql type DB. Please make changes if required as per your DB instance type.
plan owners
select user_name FROM public.audit_log where Entity_type='Plan' AND msg Like 'Plan has been created%' AND entity_id IN ('ON-ON','THREEF-TWOT');


The above SQL  query displays build owners for the example Build-plans that are having key as in "ON-ON" and "THREEF-TWOT" as in ("PROJECTKEY"-"PLANKEY")

To find the information of users who are running/building the build plans you can join the  buildresultsummary and the  buildresultsummary_customdata table.The information of the username of the individuals would be displayed in the custome_info_value.


users who are running/building the build plans
select bs.build_key, bsc.custom_info_value, bsc.custom_info_key, bs.created_date from buildresultsummary bs , buildresultsummary_customdata bsc
where  bs.buildresultsummary_id = bsc.buildresultsummary_id  
and bsc.custom_info_key ='ManualBuildTriggerReason.userName'
order by bs.created_date desc;



Last modified on Jul 18, 2022

Was this helpful?

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