Lieutenant
Lieutenant
473 views

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

Jump to solution

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

I found below API.

https://octane.abc.com/api/shared_spaces/<space-id>/workspaces/<workspace-id>/defects

https://octane.abc.com/api/shared_spaces/<space-id>/workspaces/<workspace-id>/tests

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

 

Regards

Adilla

0 Likes
1 Solution

Accepted Solutions
Lieutenant
Lieutenant

thank you All for reply my question.

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

 

https://octane.abc.com/api/shared_spaces/<space-id>/workspaces/<workspace-id>/work_items?reference_update_mode=append

 

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

{"data":[{"run":{"data":[{"type":"run","id":"39056"}]},"id":"43001"}]}

 

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

  • variable: HPECLIENTTYPE
  • value: HPE_REST_API_TECH_PREVIEW

View solution in original post

0 Likes
3 Replies
Micro Focus Expert
Micro Focus Expert

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 https://marketplace.microfocus.com/appdelivery/content/gdpr-content-pack 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:

Fields of Octane entity run_automatedFields of Octane entity run_automated

 Hope this helps?

Regards,

Dirk

 

0 Likes
Micro Focus Expert
Micro Focus Expert

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.

0 Likes
Lieutenant
Lieutenant

thank you All for reply my question.

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

 

https://octane.abc.com/api/shared_spaces/<space-id>/workspaces/<workspace-id>/work_items?reference_update_mode=append

 

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

{"data":[{"run":{"data":[{"type":"run","id":"39056"}]},"id":"43001"}]}

 

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

  • variable: HPECLIENTTYPE
  • value: HPE_REST_API_TECH_PREVIEW

View solution in original post

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.