How to identify when and who created a Plan or Plan Branch
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
The steps outlined on this article are provided AS-IS. This means we've had reports of them working for some customers — under certain circumstances — yet are not officially supported, nor can we guarantee they'll work for your specific scenario.
You may follow through and validate them on your own non-prod environments prior to production or fall back to supported alternatives if they don't work out.
We also invite you to reach out to our Community for matters that fall beyond Atlassian's scope of support!
Summary
This article will go through a few options to help identify when and who created a Plan or Plan branch in Bamboo. This can be helpful for cases where you see duplicated branches on your plans.
Environment
All supported versions of Bamboo Server & Data Center.
Solution
There are a few different ways to check for that information, which are described below.
Before going through the options below, please note the following regarding the results:
- If a username is related to the branch creation activity, it means an actual Bamboo user performed the action, and you can reach out to them for more information.
- If you see SYSTEM linked to the branch creation activity, it means it was performed automatically by Bamboo based on the plan branch settings for that Build plan. For this case, please check the Plan Branch settings, especially the "Create plan branch" section. You can find more information on how to configure that here.
Audit logs
If your Bamboo instance already had Audit Logs enabled when the plan branch was created, you can find that information by opening the Build Plan >> select the Branch >> Actions >> Configure branch >> Audit log. If you go back to the earliest entry, you'll see who created that branch:
TIME, DATE USER / SYSTEM Plan%has been created.
For example, the following entry shows that Bamboo automatically created the branch on July 11th, 2022 at 1:13 PM.
13:13, 11 Jul 2022 SYSTEM Plan branch has been created.
Querying the database
We can also query the database for that information:
SELECT USER_NAME AS USER,
MSG AS ACTION,
ENTITY_ID AS BRANCH_KEY,
TO_CHAR(TO_TIMESTAMP(MSG_TIME_STAMP / 1000), 'DD/MM/YYYY HH24:MI:SS') AS DATE
FROM AUDIT_LOG
WHERE MSG LIKE 'Plan branch has been created%'
AND ENTITY_ID LIKE '%PROJ-PLAN%'
Please replace PROJ-PLAN with the main branch key. For example, TTT-FBP, where TTT-FBP0, TTT-FBP1, TTT-FBP2 are the branches.
SELECT USER_NAME AS USER,
MSG AS ACTION,
ENTITY_ID AS BRANCH_KEY,
TO_CHAR(TO_TIMESTAMP(MSG_TIME_STAMP / 1000), 'DD/MM/YYYY HH24:MI:SS') AS DATE
FROM AUDIT_LOG
WHERE MSG LIKE 'Plan%has been created%'
Please note that these queries were created and tested on PostgreSQL. If your Bamboo instance is connected to a different DBMS, you will need to adapt the query to the DBMS's syntax (particularly the TO_CHAR function).