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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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

Xray: How to import feature file into test repository

Hello,

I am using Jira v8.5.1 and I am currently working on a project that involves XRAY APIs.

I need to import a Cucumber Test file, so I'm using the POST /rest/raven/1.0/import/feature API.

But now, the client is asking me to import it into a specific XRAY Test Repository.

I could not find so far any solution to this in the documentation. I found how to create a repository, but not how to upload a feature file directly into it.

Do you have any idea how I could achieve this ?

Thanks a lot for your help.

Cedric

1 answer

Hi Cedric,

Currently, this is not possible. However, we have this suggestion already in our backlog:  XRAY-4408

Best Regards,

Team Xray

Hi Cedric Mathis,

Can you please let me know how you are using POST /rest/raven/1.0/import/feature API. I am facing issues with this API. Please send me header section and complete URL for this request.

Hi,

I am using a simple curl for this API :

curl -H "Content-Type:multipart/form-data" -u $CREDENTIALS -F "file=@$FILE_LOCATION" https://$JIRA_URL/rest/raven/1.0/import/feature?projectKey=$PROJECT_KEY

With parameters :

  • $CREDENTIALS  to connect to the application
  • $FILE_LOCATION   which is the feature file I'm uploading
  • $JIRA_URL which is the URL of our Jira server
  • $PROJECT_KEY which is the key of the Jira project in which I'm uploading

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<status>
<status-code>404</status-code>
<message>null for uri: https://JIRAURL/rest/raven/1.0/import/feature?projectKey=$projectKey</message>
</status>

 

I am getting this response when I am hitting this request using POSTMAN. Credentials I have passed as Basic Auth in header of request

Do we require token to authorize this request

I needed an account to Jira, but that's it. There are no specific rights  (basic rights, jira-users).

 

The "null for uri"  is like the page you're trying to reach does not exist.

I have the same problem! 

http://mysite.atlassian.net/rest/raven/1.0/import/feature?projectKey=myproject, I have this uri and I'm authenticating with token in basic auth.

Postman returns null for uri 404, and I don't know what is missing...

Hello Julia,

Personnaly, I did it with curl, like this, and this is working just fine: 

curl -H 'Content-Type:multipart/form-data' -u $USERNAME:'$PASSWORD' -F 'file=@${IMPORT_FILE}' https://${JIRA_URL}/rest/raven/1.0/import/feature?projectKey=${PROJECT_KEY}

 

Just be sure that the user is defined in Jira, and that should do it

Suggest an answer

Log in or Sign up to answer
TAGS

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