Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How can I export all bamboo plan's java specs in bulk or via API so I can search through Tasks?

jzajac2 November 27, 2020

How can I export all bamboo plan's java specs in bulk or via API so I can search through Tasks?

So yes, the general problem I am trying to solve is to be able to 'search' through Tasks (the name AND the content of, for example, Script tasks (but any type really..) for keywords. The Bamboo REST API does not seem to have any resources for getting at Tasks. I can search on stages and that gets me part of what I want, for example:

bamboo/rest/api/latest/search/stages/{planKey}?{keywords}

However I need to find out information on Tasks: which Tasks are named with or has script code containing keywords. 

If not via the REST API, is there something with Tasks API or Java API? Or even a SQL select query against the DB?

1 answer

0 votes
Robert W
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 9, 2020

You can export the build plans project by project using the following GET api call:


http://myhost.com:8085/rest/api/latest/project/{projectKey}/specs

Bamboo API Documentation - get project Specs

Once you have exported the specs from a project, you can then search through the code for a particular type of task, or keyword.

An example Script Task:


new ScriptTask()
.description("Upload to S3")
.inlineBody("#!/bin/bash\nexport AWS_ACCESS_KEY_ID=${bamboo.awsAccessKeyId}\nexport AWS_SECRET_ACCESS_KEY=${bamboo.awsSecretAccessKeyPassword}\nexport AWS_DEFAULT_REGION=us-east-1\n\n# aws s3 rm s3://<bucket-name>/path/to/file.ext\n/usr/local/bin/aws s3 cp file.ext s3://<bucket-name>/path/to/file.ext --acl public-read\n\necho \"uploaded to https://s3-us-west-2.amazonaws.com/<bucket-name>/path/to/file.ext\""),

 

Hien July 5, 2022

Hi Atlassian Team,

I am using version 6.10.3 and I have the need to export Java Specs from build plans and deployment projects. Is that possible?

What are package and format as in:

/project/{projectKey}/specs?package&format

what are the possible values that I can use?

Could you please provide an example on how to export Java Specs from a build plan and from a deployment project?

Thanks

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events