簡體   English   中英

如何使用 REST API 和 XRay for JIRA 和 Z039892FD59A649C7EEEAE20450AF49C7EEEAE20

[英]How to import json report through automation using REST API and XRay for JIRA and Cucumber + Xray

我可以通過 jira 手動導入執行結果(report.json)並給出適當的狀態。但我想通過自動化來實現我無法這樣做

在此處輸入圖像描述

怎么做

我嘗試在終端中使用下面的 curl 命令..無法獲得預期的結果

curl -H "Content-Type: application/json" -X POST -u username:password --data @report.json http://myurl.net/rest/raven/1.0/import/execution/cucumber

請注意,您顯示的 curl 請求是為 Jira 服務器上的 Xray 量身定制的,從您顯示的屏幕截圖來看,您似乎在 Jira Cloud 上使用 Xray。 這要求您有一個令牌,您首先需要使用另一個請求來獲取該令牌。 如果您是通過“手動”(即從命令行)進行操作,則需要執行以下操作:

token=$(curl -H "Content-Type: application/json" -X POST --data @"cloud_auth.json" https://xray.cloud.xpand-it.com/api/v2/authenticate| tr -d '"')
curl -H "Content-Type: application/json" -X POST -H "Authorization: Bearer $token"  --data @"report.json" https://xray.cloud.xpand-it.com/api/v2/import/execution/cucumber

我的 cloud_auth.json 是這樣的:

{ "client_id": "215FFD69....","client_secret": "1c00f8f2c..." }

請詳細查看雲中的認證API導入cucumber結果的端點(實際上有兩個)。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM