I have an Automation test project in Bamboo, For each build failure, I need to create a subtask in Jira. How I can achieve this goal through automation. Is it possible to write a shell script for this case?
Asked
Active
Viewed 288 times
1 Answers
2
Actually, you can try different things about that issue:
After the build is done, you can call a custom Post-Build action which calls the Jira Rest API to create the new issue.
- Creating a Powershell (because of the tag) which calls a POST request
You can directly send a HTTP request from Powershell with Invoke-WebRequest
command.
You can check out this Stackoverflow question for the POST request.
And of course, you will send the POST request to the Jira in order to create a sub-task. You can check out this Jira documentation for creating a sub-task through Jira Rest Api.
Inside the listener, you can connect to Jira and create a sub-task through the Jira Rest Api with a simple HTTP request, similar to the second bullet.

stuck
- 1,477
- 2
- 14
- 30
-
Thank you for your input, I have one doubt from the Bamboo listener events, I could not find any event for Build failure. If the build fails what event do I need to use. – Arijit Jan 05 '22 at 15:21
-
1Actually, BuildFinishedEvent should work for you. It listens both successful or failed builds. – stuck Jan 05 '22 at 15:38