Forums

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

Get pipeline by uuid is not working, could you please help?

Gaston Kanzepolsky
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 31, 2020

Hi, 

I am running a http request from a groovy script :

def spn = 'myusertoauthenticate'    
def content = 'APPLICATION_JSON'    
def url = "https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}

 
def response = httpRequest authentication: spn, contentType: content, timeout: 20, url: url, validResponseCodes: '200'   

I received a 400 bad request. 

The POST request is working fine and also when I call the GET function without the {pipeline_uuid} I received all the pipelines, but the issue is when I call with the {pipeline_uuid}, the pipeline uuid that I am using is the pipeline uuid that I received in the POST. 

Documentation: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/pipelines/%7Bpipeline_uuid%7D

Thanks, 

1 answer

1 accepted

0 votes
Answer accepted
Gaston Kanzepolsky
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 31, 2020

Fixed. 

I Fixed using the url like this:

def url = "https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines/%7Bpipeline_uuid%7D

My issue was related with the {} in the pipeline uuid, so I replaced using %7B and %7D

Thanks

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events