how to relate(relation) automate run test with defect using REST API

i want to link the automated run failed with new defect using REST API. Is there any API for relation?

I found below API.<space-id>/workspaces/<workspace-id>/defects<space-id>/workspaces/<workspace-id>/tests

Attached: In ALM Octane > Defect > Relation - show automated run link with defect.




  • Hi Adilla,

    I assume you can use the entity run_automated and set the field defect to link the specific run to an existing defect. Actually I didn't try this specific relation but I've linked e.g. requirements to tests and defects in the GDPR Content Pack. You can download it at and review the code at module modOctane / sub subOCTCreateRelation.

    The Content Pack also has a quite useful feature for developers using the Octane REST API: You can easily pull all Octane entities and their fields from your Octane environment (the REST API is enhanced in every new version). For example run_automated on my Octane environment has 78 (!) fields, this screenshot shows only a few of them:


     Hope this helps?




  • On defect you have `run` field.
    When creating new defect you can set this field to reference the run for which you are creating the defect, or alternativelly update existing defect to reference the run.

  • Verified Answer

    thank you All for reply my question.

    I already get answer from here and the rest API required is below:



    body content - contain run id(39056) & defect id(43001) :



    if get error 405 - Method Not Allowed, please insert below variable & values in header content:

    • variable: HPECLIENTTYPE