Forums

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

Web request within Automation

robert_gosztyla
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!
July 19, 2022

Hi All

 

I've got problem with triggering Gitlab pipeline from Automation setting in Jira. I've created a rule wich should send web request to trigger running pipeline in Gitlab. Using curl from command line it works fine, e.g:

curl -X POST -F token=some_token -F ref=main "https://gitlab.com/api/v4/projects/some_project_id/trigger/pipeline"

In Automation settings, i've got right target, using content-type as multipart/form-data, as request body i'm using "Custom" setting. "Custom data" field is set as:

-F token=some_token -F ref=main

(of course token and project are specific to Gitlab project). Trying to validate request, got bad request (400) with payload:

{
  "error": "ref is missing, ref is empty, token is missing"
}

 

1 answer

1 accepted

0 votes
Answer accepted
robert_gosztyla
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!
July 19, 2022

I'll found solution: "Custom data" field should look like this (pretty simple):

ref=main&token=some_token

Suggest an answer

Log in or Sign up to answer