Use Automation to kick off project resource creation
Asked by Tim Chaffin:

I've been looking at the available actions for Automation, and I'm not sure the functionality is there, that I'm looking for. I wonder if something else might be a better solution. Actions needed include the following, after approval:

* Create a new Confluence space for the approved project.
* Create a new Bitbucket project and default repo.
* Create a branch off of a "Cloud" repository, and commit a templated set of code.
  * After the code is committed, submit a PR including the the new code.
  * An engineer completes the PR, and a pre-baked Pipeline takes it from there.
* (The above process of adding code templates to repositories may be repeated, in various repositories, with various templates)


Answers:
author: Dan Tombs
body: Hi [@Tim Chaffin](/t5/user/viewprofilepage/user-id/419836)

So it would be great to understand what the 'approval' process is for you. But in theory if the approval was to create a Jira project for example Then you can use the webhook action to create all of the items you need to. We use Similar actions to create projects/spaces repos etc. when a service request ticket is approved.

You can use something like:

![Capture.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/215944iB6C2A9EE78FB61CA/image-size/large?v=v2&px=999 "Capture.PNG")

I would check out the api docs for each tool below. I'm more then happy to help you out on creating this rule:

Jira - <https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-projects/#api-rest-api-3-project-post>

Confluence - <https://developer.atlassian.com/cloud/confluence/rest/api-group-space/#api-wiki-rest-api-space-post>

Bitbucket - <https://developer.atlassian.com/cloud/bitbucket/announcement-06-08-18-new-v2-apis/>

Dan

comments: author: Tim Chaffin
body: Apologies, approval in this case would be a request through Jira Service Management, that after approved, would kick off the automation. In this case, that could easily be a particular state the request could transition to, like you've illustrated here.

Ideally at the forefront of the request, a form would exist, to capture intake variables and use as smart variables throughout the automation too.

I'm with you on the same page when it comes to sending web requests, this would be pretty easy for creating a Jira project or a Confluence space.

What I'm still hung up on is committing code to an Infrastructure as Code project. Creating the Atlassian resources can be done pretty easy with the Web Request feature. But what I need is to go into a Bitbucket workspace/repository, and append a file through git. Basically, this would be a Terraform file, and using variables captured from the form, add a new cloud resource in code, and let the repository Pipeline take it from there.


author: Mikael Sandberg
body: Automation cannot currently trigger on project creation, but you could do it on say version created. You could then have a initial version that is always created when you create a project. You would have to use REST API calls, since automation in Confluence cannot create a new space, and Bitbucket doesn't have automation yet.

comments: author: Jack Brickey
body: You actually can trigger on project creation (relatively new). It is only in global obviously.

![45B385CF-1E1A-4392-91FD-254659C20245.jpeg](https://community.atlassian.com/t5/image/serverpage/image-id/215804i3A1F2BEB6CFFABB3/image-size/large?v=v2&px=999 "45B385CF-1E1A-4392-91FD-254659C20245.jpeg")

with that said only GitHub supported AFAIK. Correction, creating of repo not an option but you can create a new branch for your project.