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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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

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\""),

 

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bamboo

Bamboo 7.2 is here!

I'm happy to announce that Bamboo 7.2 has been released and it’s overflowing with awesome new features. This will be the last major Server release before the launch of Bamboo DC. Bamboo logs We...

477 views 5 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you