How to get all the attachments and the corresponding test case, release and project details in Zephyr Enterprise/Community
Please follow the below mentioned instructions to get all the attachments and the corresponding test case, release and project details in Zephyr Enterprise/Community
Log in to MySQL instance that Zephyr connects to.
Windows instructions
Please use the MySQL binaries that chip with Zephyr. The MySQL binaries can be found in “Zephyr_Installation_Location/mysql/bin”. In my machine the location is “C:\Program Files\Zephyr\mysql\bin” and this may be different in your machine.
Open a command prompt and navigate to the above mentioned location and issue the following command. Please note, since Zephyr on Windows OS uses the port number 37638 we need to use this port number as well when connecting to Zephyr’s database.
mysql -uroot -proot –port=37638 itcc
Linux instructions
Since Zephyr does not bundle with built in MySQL instance for Linux, Please use the required credentials to connect to the MySQL instance used by Zephyr.
Once logged in, Please execute the following query.
SELECT a.name, a.item_type, a.id as attachment_id, b.release_id, b.`name`, c.`project_id`, c.`name` from itcc.`attachment` as a, itcc.`testcase` b, itcc.`releases` c, itcc.`project` d where a.`item_id` = b.id and b.`release_id` = c.`id` and c.`project_id` = d.id
Now, After executing the above query just pick the ATTACHMENT_ID and use it with below rest API to get the details.
GET: /flex/services/rest/latest/attachment/3