Forum Discussion
CarlosValcarcel
Staff
3 months ago(Not sure why this is under API Hub, but...)
I think the issue is that you’re sending issue keys; the API wants the numeric Jira issue ID.
For Zephyr Scale the endpoint to link a Jira issue to a test case is:
POST /v2/testcases/{testCaseKey}/issuelinks Body: { "issueId": <numeric Jira issue id> }
Passing keys like SOF-302 or SOF-T84 will throw exactly what you’re seeing:
createTestCaseIssueLink.issueId: must not be null. community.smartbear.com+1
Fix
- Resolve the Jira issueId from the key:→ returns {"id":"10001", ...}. Use that id in the Zephyr call. (Server/DC uses /rest/api/2/..., same idea.)
GET /rest/api/3/issue/SOF-302?fields=id
- Call Zephyr Scale:(Body must be issueId, not key.)
curl -X POST \ -H "Authorization: Bearer <zephyr-scale-token>" \
-H "Content-Type: application/json" \
"https://api.zephyrscale.smartbear.com/v2/testcases/SOF-T84/issuelinks" \
-d '{ "issueId": 10001 }'
Let me know how it goes!