stash build api only 1 build shown

I'm trying to use the stash build api to connect Jenkins and Stash. I've got it linked up with a simple python script, but when I view the build results in Stash, it only shows the most recent result. I'm posting to <stash-url>/rest/build-status/latest/commits/<sha1> with state, key, name, and url from my jenkins job. Do I need to do something special to store each build result?

1 answer

1 accepted

Hi Matthew,

What parameters are you passing exactly? According to the documentation:

If a single commit was built by multiple build plans, you can POST multiple results for the same commit. Each result must have a different key attribute.

Basically if you use the same key, you'll end up with only one result. I suspect that's what might be happening.

Does that help?

Charles

PS Have you seen this Jenkins plugin before?

https://github.com/jenkinsci/stashnotifier-plugin

I was looking at the API documentation at https://developer.atlassian.com/static/rest/stash/2.6.0/stash-build-integration-rest.html. It makes sense now that the key should be unique.

That plugin did almost everything I was looking for. There doesn't appear to be a way for it to mark a build as "In Progress".

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

23,453 views 26 12
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you