2

Is it possible for me to have users of my website send bugs to my Bitbucket repo's Issue tracker without redirecting them to the Bitbucket page ?

I know this is possible with authentication but it seems weird that they can add an issue without authentication from the Bitbucket site but not from the API.

Saad Farooq
  • 13,172
  • 10
  • 68
  • 94
  • I'd like to know too. From reading the docs, have you tried creating an issue via the REST API, i.e. https://confluence.atlassian.com/display/BITBUCKET/issues+Resource#issuesResource-POSTanewissue ? The docs say that the call requires authentication for private repos or issue trackers, but is unclear on whether it's necessary for public trackers. – gnuf Jan 16 '13 at 15:40
  • Yeah I tried... it asks for authentication. Doesn't matter if the tracker if public or private. I think the authentication is applied at the repository endpoint level and issues is a resource within. – Saad Farooq Jan 16 '13 at 20:18

2 Answers2

3

I created a PHP library to do this, you don't say what language your website is built on, but this plugin will do the basic work of creating a simple bug submission form, sending a POST to the BitBucket API using Basic Auth and will send a nice confirmation email to the user with the bug # (and optional URL to the bug). The user doesn't have to do any logging in... your code on the server does that.

It's here: http://syntaxseed.com/project/bitbucketphpbuglib/

Sherri
  • 816
  • 2
  • 9
  • 18
  • OK.. I'll have a look in a bit. My main concern with the use of basic authentication. We want users on the site to be able to use the feature without having to use a login and password and since the code is all shared, I didn't really want usernames and password flying around. We ended up making a generic user whose username and password is now flying around. – Saad Farooq May 10 '13 at 23:04
  • @SaadFarooq the basic Auth is for connecting to your BitBucket account, it is done behind the scenes by your app, not by the user at all. – Sherri Apr 28 '14 at 20:02
2

I ended up using Basic Authentication with general user.

The user doesn't have to be part of the team so it can be any user.

edit: its solved on my post see sending issue to bitbucket using oauth via bitbucket api

$account_name = 'companyy';    
$repo_slug = 'issuer';

$oauth_params = array(
    'oauth_consumer_key'      => 'key',
    'oauth_consumer_secret'   => 'secret'
);

$issue = new issues();
//this was the missing peace of the puzzle . one single line
$issue->getClient()->addListener( new OAuthListener($oauth_params) );

$issue->create($account_name, $repo_slug, array(
    'title'     => 'title 123',
    'content'   => 'coententt123 ',
    'kind'      => 'proposal',
    'priority'  => 'blocker'
    ));
Community
  • 1
  • 1
Saad Farooq
  • 13,172
  • 10
  • 68
  • 94