RedHatQE / pylero

Python wrapper for the Polarion WSDL API
https://redhatqe.github.io/pylero/
MIT License
37 stars 25 forks source link

RFE: Adding hyperlinks with any role for work items #110

Open KwisatzHaderach opened 2 years ago

KwisatzHaderach commented 2 years ago

We need to be able to add hyperlinks with any role to test cases, which is currently not possible with pylero, only with Web UI.

>>> tc.hyperlinks[1].role
testscript1
>>> tc.add_hyperlink('https://github.com', 'testscript1')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/pmatyas/.local/lib/python3.10/site-packages/pylero/work_item.py", line 622, in add_hyperlink
    self.check_valid_field_values(role, "hyperlink-role", {})
  File "/home/pmatyas/.local/lib/python3.10/site-packages/pylero/base_polarion.py", line 995, in check_valid_field_values
    raise PyleroLibException(
pylero.exceptions.PyleroLibException: Acceptable values for hyperlink-role are:[ref_int, ref_ext]
brian12559 commented 2 years ago

It looks like pylero is checking the global hyperlink enum when checking valid IDs. Current workaround is to add the ID to the global enum until the pylero fix is in

leelavg commented 2 years ago

My bad in not updating this issue, I drafted the reply 6d back but didn't press the comment button and so my code stating why it isn't possible got lost.

I didn't know there can be per project hyperlink enum IDs when I revisit pylero.

brian12559 commented 2 years ago

there is per project and also per object. So there is a project level one, then there is a test case level one and a requirement level one, etc My suggestion would be check the lowest level then work your way up