Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,560,455
Community Members
 
Community Events
185
Community Groups

How to add attachment to Jira using REST API in WinDev ?

Good morning all,
I've been on this problem for days and can't find a solution.
I am using the Rest API to chat with Jira (Atlassian) and would like to attach a file on an "issue". I read the doc correctly, I tried my query on PostMan and it works but I cannot find the right functions on WinDev.

Here is my actual code : 

MaReq.URL = "https://karinehoubrix.atlassian.net/rest/api/2/issue/SYN-30/attachments"
MaReq.Header["Authorization"] = "Basic aG91YnJpeC5rYXJpbmVAZ21haWwuY29tOkRyaVl2UWRBZDlHR2RzYTRlZ2Q2MEMwNg=="
MaReq.Header["Accept"] = "application\json"
MaReq.Header["X-Atlassian-Token"] = "no-check"
MaReq.ContentType = "multipart/form-data; boundary=""MyBoundary"""
MaReq.Method = httpPost

MaReq.Header["Content-Disposition"]= "form-data; name=""file""; filename=""C:/Users/karine.houbrix/Pictures/test.png"""

//bufFichier est un Buffer
//bufFichier = fChargeBuffer("C:/Users/karine.houbrix/Pictures/test.png")
//MaReq.Content = bufFichier

Reponse = RESTSend(MaReq)

IF ErreurDétectée THEN
Error(ErrorInfo(errFullDetails))
ELSE
Info(Reponse.CodeEtat)
//Trace(MaReq.Contenu)
Trace(Reponse.Contenu)
END

 

Right now, I have the error 400. Thank you for your help :)  

2 answers

1 accepted

0 votes
Answer accepted
Petter Gonçalves
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Aug 11, 2020

Hello @Karine Houbrix

Welcome to the Atlassian Community!

Since you are asking for help with an integrated development environment (WinDev), I suggest reaching out in our Atlassian Developer Community:

https://community.developer.atlassian.com/ 

The mentioned portal was specifically created for development questions, where you will find articles and suggestions from other third-party partners and Atlassian developers. Feel free to open a new topic about your question there! :)

Let us know if you have any other questions.

For UFT integration with Xray-JIRA with attachment :

https://q-automations.com/2020/04/03/uft-integration-with-xray-jira/

Suggest an answer

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

Atlassian Community Events