Bamboo YAML import failed: Document structure is incorrect: Found following unused properties: plan-
Asked by Victorio Berra:

```
Bamboo YAML import failed: Document structure is incorrect: Found following unused properties: plan-permissions
```

My YAML

```
---
version: 2
plan:
  project-key: EEWTWS
  key: 'HEALTH2'  
  name: Health
plan-permissions:
  - groups: '_Bamboo__Build_Admins'
    permissions: admin
```

I dont understand what im doing wrong. I want _Bamboo__Build_Admins to be an admin on the plan when its created.


Answers:
author: Jack Nolddor [Sweet Bananas]
body: Hi Victorio,  

Manage plan permissions to control which users have access to various functions of the build plan using Bamboo YAML was introduced in Bamboo v6.1.0.  

Which Bamboo version are you currently running? Could be this the root couse of your problem?

Anyway, do you mind to try using the following content?

<br />

bamboo.yaml

```
---
version: 2
plan:  
  project-key: EEWTWS
  key: HEALTH2
  name: Health

---
version: 2
plan:  
  key: EEWTWS-HEALTH2

plan-permissions:
 - groups: 
     - _Bamboo__Build_Admins
  permissions: 
     - admin
```

comments: author: Victorio Berra
body: 6.9.2 build 60911 - 04 Jul 19


author: Victorio Berra
body: [Also im not alone.](https://community.atlassian.com/t5/Bamboo-questions/Bamboo-YAML-import-failed-Document-structure-is-incorrect-Found/qaq-p/1147700) But his answer makes no sense. He probably doesnt even realize he disconnected the permissions from his plan by "moving them to a new block" whatever that means. Maybe we are looking at a real bug here?


author: Jack Nolddor [Sweet Bananas]
body: Hi Victorio,

I've added a YAML proposal in my original answer.  
Not sure if it is the same as you are currently using since the YAML you post in the original post seems to be malformed (I believe because copy \& paste here)


author: Victorio Berra
body: I have updated the formatting but yes the copy/paste was an issue.

Your code snippet did not work, I still have the same error "

```
Bamboo YAML import failed: Document structure is incorrect: Found following unused properties: plan-permissions
```

I just saw you made some big edits and created an entirely new YAML. I will try that one second


author: Jack Nolddor [Sweet Bananas]
body: Yes, sorry It is because reading the documentation it seems that the Plan Permissions entity is a first level entity and need to be placed in a separated file as [denis.kot](https://community.atlassian.com/t5/user/viewprofilepage/user-id/1989970) already suggested in [his post.](https://community.atlassian.com/t5/Bamboo-questions/Bamboo-YAML-import-failed-Document-structure-is-incorrect-Found/qaq-p/1147700)


author: Victorio Berra
body: ![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/67527i9F21D02F33D210CC/image-size/large?v=v2&px=999 "image.png")The plan compiled now but the permissions were not applied.


author: Jack Nolddor [Sweet Bananas]
body: I just realized after see the Alexander comment that I forgot to add the project key in the second file (planHEALTH2.yaml)  

So the correct plan key is indeed EEWTWS-HEALTH2


author: Victorio Berra
body: I can not get that to work [@Jack Nolddor \[Sweet Bananas\]](/t5/user/viewprofilepage/user-id/1504038) its the same result, no permissions. Maybe I have to have those includes? II dont think its picking up planHEALTH2.yaml. Nothing is telling it to right?


author: Jack Nolddor [Sweet Bananas]
body: Yeah, that seems to be the problem I've updated again my proposal and merged the two files into one.

Since I'm not pretty sure if plan key should be EEWTWS-HEALTH2 or plan key or HEALTH2 do you mind to try both options, please? (only in the permission section)


author: Victorio Berra
body: That worked! Using the "full" key "EEWTWS-HEALTH2" and having everything in the same file.


author: Jack Nolddor [Sweet Bananas]
body: Yeah! Congrats

I've updated my initial answer to reflect the final solution so you can mark the proposed solution as an 'Accepted answer'. This will help other people with the same or a quite similar problem to find a solution in a easy and faster way.

In addition, by doing this the post will automatically gain the "Solved:" prefix in search results to indicate other people that no further support is needed.

Kind Regards.


author: Victorio Berra
body: I will say even though this is solved, this is incredibly counter intuitive and poorly documented.


author: Jimmy Seddon
body: Thanks [@Jack Nolddor \[Sweet Bananas\]](/t5/user/viewprofilepage/user-id/1504038)!

I've just started using YAML specs myself and found this while trying to figure out plan permissions. This was very helpful.


author: Alexander
body: I'm fairly certain that plan permissions need to be in their own YAML document in order for Bamboo to use them, much like how build and deploy plans need to be separate from each other.

Ideally, it's best practice to keep your plans and permissions in their own file, and include them in your bamboo.yaml.

```
bamboo-specs
|-bamboo.yaml
|-build.yaml
|-permissions.yaml
```

bamboo.yaml:

```
---
!include 'build.yaml'
---
!include 'permissions.yaml'
...
```

build.yaml:

```
---
version: 2
plan:  
  project-key: EEWTWS
  key: HEALTH2
  name: Health
```

I'm not quite sure how the permissions.yaml needs to be formed, but here's my guess at it:

permissions.yaml

```
---
version: 2
plan: "EEWTWS-HEALTH2"

plan-permissions:
  groups: "_Bamboo_Build_Admins"
  permissions: admin
...
```

The three dashes in a YAML file mark the start of a new YAML document.

comments: author: Victorio Berra
body: My YAML all parses correctly but now I get a new error:

```
There was an error when processing yaml file "bamboo.yaml". File structure is correct, contact Atlassian Support for assistance on resolving this issue.Could not parse key 'HEALTH2'java.lang.IllegalArgumentException: Could not parse key 'HEALTH2'


```

I didnt change any of the details, I just created the new files and added the includes


author: Alexander
body: Ah, try this in your permissions.yaml:

```
plan: "EEWTWS-HEALTH2"
```

I'll edit my above answer to put double quotes around that value as well.


author: Victorio Berra
body: What is the difference between double and single quotes in your YAML?


author: Alexander
body: There's no functional difference between the single and double quotes in my example. Good question, I'd suggest looking at some basic YAML syntax guides if you're new to the language.


Tags: spec