Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira Bitcbucket integration

Sharath P Bongale October 13, 2020

We have a requirement where we need to update a file in repo with the data we captured in Jira ticket when the Jira ticket reaches certain stage, say appoved. How to do this

1 answer

0 votes
Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 22, 2020

Hello @Sharath P Bongale ,

Welcome to the Atlassian Community!

Can you kindly provide more details on what you are trying to achieve since I am not sure I understand correctly your requirements?

Are you trying to find a way to modify a text in a file that exist in a repository when an issue is transitioned to a given status?

If this is the case then I am afraid there is no such functionality available OOB since the integration is actually working the other way around: you can make a Jira issue transition to a desired status when an action happens on Bitbucket side, not vice-versa.

As written in the Connect Jira Cloud to Bitbucket Cloud documentation page:

By connecting to Bitbucket, you can:

  • Surface repository activity – Jira issues automatically update to show repo branch, commit, pull request activity, and, if you have Bitbucket Pipelines enabled, your builds and deployments.
  • Get deep integration in Bitbucket – See the core details of Jira issues without having to change context, from anywhere in Bitbucket you see a Jira issue key, including commit messages, pull request comments, and deployment information.
  • Automate Jira workflows – Jira workflows sync with repo activity to update automatically as you work.

Read more about the benefits of integrating Jira applications with Bitbucket Cloud. If you're using a Jira Server application, see Linking a Bitbucket or GitHub repository with Jira.

As mentioned in the quoted text, see Integrate Bitbucket and Jira for more details.

 

Once this has been said, you may want to search our marketplace for any 3rd party app/add-on that offers this functionality

 

 

 

Cheers,
Dario

Sharath P Bongale October 23, 2020

@[deleted] : Yes Basically create a new file or update an existing file when issue is transitioned. 

I was trying to use send web request automation.

 

When i tried with Postman, i am able to create file. With the same configuration in jira it didnt work. The issue i felt is data is being sent as raw data from jira but it was form data from postman. so this may be the challenge

Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 23, 2020

Hi @Sharath P Bongale , 

I believe you are on the right path. 

Can you kindly provide more information on the request are you able to send using postman?

Specifically:

  • Are you calling a Bitbucket REST API endpoint? Which one?
  • What is the body sent? 
  • How are you authenticating the request?  

 

Cheers,
Dario

Sharath P Bongale October 24, 2020

@Dario B : I am calling the rest api which is as below 

https://api.bitbucket.org/2.0/repositories/username/repo_slug/src

Body is just key value pair. (Key being file name and value content of the file)

Authentication : I have used app password tagged to the user in Base64 encoding.

I am also able to create file using java code.

 

When i am invoking the same from Jira, commits are being happeing and file is not getting created. when i check the raw commit, its empty.

 

Is there a way i can get any support. else i have to write a utility outside jira which will be invoked by web request and in turn create the file

Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 27, 2020

Hello @Sharath P Bongale ,

If calling the REST API endpoint works fine when sending the request using Postman or Curl (or other tools), then it is expected to work also when sending the request from an automation rule.

Details on how to configure the send web request action are in below link:

Can you kindly review the above page and check you are doing everything correctly? 

 

Specifically, I am not sure what you mean with:

I have used app password tagged to the user in Base64 encoding.

Can you make sure your authentication header has the below form:

Name: Authorization

Value: Basic [BASE64 encoded <USERNAME>:<APP_PASSWORD>]

 

 

auth-header.jpg

 

 

Cheers,
Dario

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events