I have a build plan with a task that triggers another plan via the Bamboo REST API. All of the builds that are triggered by the API have the reason: Manual build by <user>
I would like to be able to set the build reason as Child of <project>-<plan>-<number> like when a build is started as a dependency of another build.
Can I set a custom build reason via the Bamboo REST API?
Hello Jeffrey,
Welcome to Atlassian community.
If my understanding is correct, you are looking at the Metadata screen for a buildresult and looking at the parameter ManualBuildTriggerReason.userName as per below and looking to change the values to a custom one. Please correct my understanding if it's correct.
Solution 1 :
As far as I know within the REST API this param can't be changed but can be overriden(see solution 2), if some how you can modify the column custom_info_value under buildresultsummary_customdata table, you'll be able to see the modified value in Bamboo GUI.
This will require some update query to be fired to the DB.
After the update is run
Solution 2 :
You can define a custom variable on the plan, see below
You'll be able to see this under Variables tab
You can also pass the system variables as well like bamboo.variable.ManualBuildTriggerReason.userName and it's values would be overriden
Let me know if this helps
**please don't forget to Accept the answer if your query was answered**
Regards,
Shashank kumar
I ran the REST API query GET /rest/api/latest/result/{projectKey}-{buildKey}/{buildNumber} to see all of the results of my build. I am interested in modifying buildReason, not ManualBuildTriggerReason.userName.
Is it possible to customize buildReason when calling POST /rest/api/latest/queue/{projectKey}-{buildKey}, or modify its value in a task of the queued plan?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Jeffrey Mendez
As per the GET Rest API which I used
I see you are talking about the below buildReason
I don't think so you can modify this.
As per https://docs.atlassian.com/atlassian-bamboo/REST/8.2.5/#d2e5921 you can pass variables to the Post Request, even if you try to pass buildReason as a variable Bamboo will just consider it as a new one and add it to the metadata
Regards,
Shashank Kumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.