Link Xray Test Execution with Test Plan when using /robot/multipart endpoint

L_Écu Reuil August 27, 2021

Hello everyone,

I have been through a lot of documentation and topics before I decided to ask the following question. I hope somebody here will be able to help me, or at least explain me why it is not possible.

 

I am currently using Xray at the end of our pipeline regression to import the results directly to JIRA. It works perfectly fine atm. Test execution is created as expected, and I am using the "importInfo" parameter to customise it a bit.

 

My problem is:

As mentioned on this page, it is not possible to use "testPlanKey" option if using multipart endpoint.

So my question is, as I am not able (or just too dumb) to add that "testPlanKey" option in the "importInfo" part as well, how can I add the Test Execution, newly created during the import of the results, to a specific already existing Test Plan ?

 

Btw, I am not using Xray Cloud, so cannot use the "xrayFields" part.

Thank you !

 

PS: Does anybody have a doc somewhere with a list of everything you are allowed to put in the "importInfo" JSON part ? That would be really useful to know what I can do or not.

2 answers

0 votes
Rogério Paiva - Xray Xporter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 6, 2021

Hi @L_Écu Reuil 

According to the tags, you are using Xray Cloud, but the documentation page you read is from DC/Server, and the configuration is not exactly the same for DC/Server and Cloud.

Please check the documentation and example found in the Xray Cloud documentation here:

https://docs.getxray.app/display/XRAYCLOUD/Import+Execution+Results+-+REST#ImportExecutionResultsREST-RobotFrameworkXMLresultsMultipart

Any additional questions, please get in touch with Xray Support (http://xraysupport.getxray.app); we would gladly assist you.

Thank you.

Kind regards,
Rogério Paiva [Xray Support Team]

L_Écu Reuil September 8, 2021

Hey Rogério,
Thank you for your answer.

According to which "tags" am I using Xray Cloud ?
We are defnitely using Xray Server here.

Anyway, I found a workaround. I stopped using the multipart endpoint, and am just updating the Summary of my Test Exec directly via the JIRA API.

Kr,
Adrien

Rogério Paiva - Xray Xporter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 22, 2021

Hi @L_Écu Reuil 

The tags can be found on this thread page, on the right side, close to the top.

Please search for "TAGS", and you will find that there are two: "cloud" and "xray".

So I was assuming that it is related to Xray Cloud, since it is server, please try the following:

You just need to find the ID of the custom field "Test Plan" (in my case the id is 10134) and then place it in the JSON file that will be used in the multipart request.

And use a JSON file like in this example (@createTestExec.json):

{
    "fields": {
        "project": {
            "key": "XRAY"
        },
        "summary": "Test Execution for cucumber Execution",
        "issuetype": {
            "id": "10009"
        },
        "customfield_10134" : [
            "CALC-1", "CALC-2"
        ]
    }
}

In case, you need further help, please get in touch with Xray Support (http://xraysupport.getxray.app); we would gladly assist you.

Thank you.

Kind regards,
Rogério Paiva [Xray Support Team]

Prasad_Rondla_Solera_com September 1, 2022

Hi @L_Écu Reuil 

 

Iam also facing same issue with robot mulipart during linking to test plan.Could you please help how did you updating the Summary of Test Exec directly via the JIRA API?.SO that I can implement the same

0 votes
L_Écu Reuil September 2, 2021

Hi everyone,

As my topic has gone quite low in the list, and I did not get any answer yet, I am just bringing it back up. Hopefully somebody knowing the answer will pass by ! :)

Antonio Gil Coto September 28, 2021

Hi, I guess If you are using Xray Server and you want to link brand new Test Execution with an already existent Test Plan, @Rogério Paiva - Xray Xporter  just answered you .... but he didn't explain how to get the key piece of his answer ... 

How/where can we get Test Plan custom field Id? @Rogério Paiva - Xray Xporter  please ... I guess is the test plan custom field at test execution issue type, right?

I am not able to get it ....

Antonio Gil Coto September 28, 2021

OK, I found it!!!!

So, the full process

How Link new test execution with an existent Test Plan using Multipart endpoints for Xray Server+DC

1. Open any Jira ticket

2. Access Jira Administration by clicking on the gearwheel upper right corner icon 

3. Select "Issues" option

4. On the left column menu select "Custom Fields"

5. Search for "Test Plan" 

6. At the end of the row, the "Actions" column, there is again a gearwheel. Click it [for the Test Plan row] and select "Edit"

7. Check the url: https://sandbox.getxray.app/secure/admin/EditCustomField!default.jspa?id=11807

8. You've already got the test plan custom field id: 11807

9. So, you just need to make up the info file with the customized for you custom field key ... "customfield_<your_id>", and add it your test plan id XXX-999

{
"fields": {
"project": {
"key": "XXX"
},
"summary": "Test Execution - Multipart",
"customfield_11807": ["XXX-999"]
}
}

 

Please @Rogério Paiva - Xray Xporter Update your documentation!!!!!!

Rogério Paiva - Xray Xporter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 15, 2021

Hi @Antonio Gil Coto 

I didn't mention how to get the custom field id since this is a Jira feature, not from Xray.

All Xray issue types are based on the Jira issue and have the same features, plus the Xray-specific features.

The issue id is a feature that is common to all issues in Jira (independent of its type), and Atlassian has this described in their documentation:

https://confluence.atlassian.com/jirakb/how-to-get-issue-id-from-the-jira-user-interface-827341428.html

Thank you.

Kind regards,
Rogério Paiva [Xray Support Team]

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events