Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

curl POST cmd works to post to execution evidence in xray but doesn't work with python requests.post Edited

Below curl command works if post to execution evidence in Xray and attaching test.log file to evidence field:

curl -H "Content-Type: application/json" -X POST -u user:pwd --data @test.json https://jira.opentv.com/rest/raven/1.0/api/testrun/{id}/attachment

where test.json has this,

{
"data":"VGhpcyBmaWxlIGlzIHRlc3RpbmcgZm9yIHVwbG9hZCB0byBleGVjdXRpb24gZGV0YWlscy4=",
"filename":"test.log",
"contentType":"application/json"
}   (in json 'data' is base64 encoded which is only supported in xray)

but when i try the same with below requests.post it fails. 

requests.post('https://jira.opentv.com/rest/raven/1.0/api/testrun/{id}/attachment',headers = {'Content-Type':'application/json'},data={"data":"VGhpcyBmaWxlIGlzIHRlc3RpbmcgZm9yIHVwbG9hZCB0byBleGVjdXRpb24gZGV0YWlscy4=","fileName":"test.log","Content-Type":"application/json"},auth=('user', 'pwd'))

Thanks in Advance..

the curl cmd is executed from linux machine and python requests.post from windows. Both are reachable to Xray.

1 answer

Hi @Suryakant

Curl command works manually. The request works but will fail when using it inside your custom application. 
Since the Xray itself is working, there is not much else we can help as we don't provide support to custom applications.

We do have several code samples (some using Python) which you could use as a reference to build your own application.

Please check the link Tutorials, Tips and Tricks - Automation to get those samples; remember that those samples are provided "as is" and they are not supposed to be used on production and may need adjustments to work on your environment.

Please let us know if you have any questions or issues with Xray through our Service Desk

Best Regards,

Team Xray

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Marketplace Apps & Integrations

New cloud apps roundup - June 2021

Since our last roundup in April, Atlassian's Marketplace Partners have added over 100 new cloud apps to the Atlassian Marketplace to help your teams work more efficiently. Let’s take a quick look a...

349 views 5 10
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you