1

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?

Arijit
  • 69
  • 1
  • 10

1 Answers1

2

Actually, you can try different things about that issue:

  1. Post-build action from Bamboo

After the build is done, you can call a custom Post-Build action which calls the Jira Rest API to create the new issue.

  1. 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.

  1. You can create an Event Listener in Bamboo

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
  • 1
    Actually, BuildFinishedEvent should work for you. It listens both successful or failed builds. – stuck Jan 05 '22 at 15:38