0

I am trying to send api request using:

`curl --location 'https://xray.cloud.getxray.app/api/v1/import/execution/cucumber' \
--header 'Authorization: Bearer $token' \
--header 'Content-Type: application/json' \
--data '**jsonresulttest**'`

I am sending with the correct token and adding the json result test for the body api request

I generated the json result test in TestRunner class:

@Service
@RunWith(Cucumber.class)
@CucumberOptions(features = "src/test/java/resources",
        glue = "classpath:com.gth.automation",
        tags = "@GTH-25068",
        plugin = {"json:target/cucumber-report.json", "pretty","html:target/cucumber-reports"},
        monochrome = true,
        publish = false)
public class TestRunner {
}

Adding the result test json from the file target/cucumber-report.json. but I am getting an error from Postman:


{
    "error": "Error creating Test Execution - Issue create failed! - assignee: Field 'assignee' cannot be set. It is not on the appropriate screen, or unknown."
}

I think the structure that is generated in target/cucumber-report.json has a different structure than the Xray API call that is accepted to get. I need help in figuring out how can I produce the correct json structure for the API request

**POST /rest/raven/1.0/import/execution/cucumber**

thanks.

I trying to send Correct API request to

POST /rest/raven/1.0/import/execution/cucumber/multipart
shi
  • 1
  • I have some questions in order to be able to help: 1- Are you using Cloud or Server version of Jira? 2- What framework/tool you are using to execute the tests and generate the results file? 3- Can you share the results file (after cleaning it of any sensible information)? – Cristiano Cunha Jul 24 '23 at 10:35
  • 1.2. I am using the cucumber framework to generate the result test in json formatt 3.. – shi Jul 30 '23 at 10:10

1 Answers1

0

It seems a Jira configuration issue related to the screen configuration associated with Test Execution issues. Please check with your Jira administrator that you can manually create Test Execution issues (you can try to create one by yourself) and that you see the "Assignee" field on the dialog.

Test Execution issue creation dialog

If you don't see it, then use the options on the creation dialog to see if you can add it.

enter image description here

If not, the project administrator can go to the project settings => Issues => Screens and then edit the corresponding Create and Edit issue screen that are associated to the Test Execution issue type.

enter image description here

Note: the "Assignee" should also appear on the view screen of Test Execution issues.

Test Execution issue view screen

Sérgio
  • 1,777
  • 2
  • 10
  • 12
  • Hello Sergio, thank you for your answer, In my test execution issues there is QA Assignee and not – shi Aug 13 '23 at 13:16
  • @shi, so you were able to solve it? – Sérgio Aug 14 '23 at 08:44
  • No, in my Jira project, I already have Assigne in test execution but we are calling this label, QA Assignee. Do you think this is the problem and I need to change it from QA Assignee to Assignee? – shi Aug 14 '23 at 14:21
  • Hmm I'm not sure; you can try it out and see if works. Assignee is a field that exists in Jira by default and usually don't change it.. – Sérgio Aug 14 '23 at 20:08